Re: [PATCH 1/1] add hook pre-p4-submit
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 26, 2018, 21:20 UTC
- Message-ID
- <CAPig+cQQmOpEpUNSjw58b-_+Ep3v0XA+vuqqqgHVOaFgtKt3fA@mail.gmail.com>
- In-Reply-To
- <xmqq36w6rlh7.fsf@gitster-ct.c.googlers.com>
On Thu, Jul 26, 2018 at 12:49 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Chen Bin <chenbin.sh@gmail.com> 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@mail.gmail.com/