On Thu, Jul 26, 2018 at 12:49 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > Chen Bin <chenbin.sh@xxxxxxxxx> writes: > > + git p4 submit --dry-run >out && grep "Would apply" out || echo "Abort submit" > > What is this last "|| echo I always succeed" about? > > Do you want to make sure "git p4 submit" exit with non-zero exit > status *and* its output does not say "Would apply"? The way to > write that would be > > test_must_fail git p4 submit --dry-run >out && > ! grep "Would apply" out I missed the 'test_must_fail' when I suggested this same rewrite[1], which may explain why the suggestion wasn't used in the re-roll. Sorry. [1]: https://public-inbox.org/git/CAPig+cR2gYEwOTVBMRde35rn9oVsixeerbm5iJV+FmnOiBWxqQ@xxxxxxxxxxxxxx/