Re: [PATCH 4/7] merge-ort: capture and print ll-merge warnings in our preferred fashion
- From
Elijah Newren <newren@gmail.com>
- Date
- Oct 1, 2021, 01:54 UTC
- Message-ID
- <CABPp-BFyh239+7FLuUuoRJJbcE8NxHZABPTXPmSQhvRSPCiGvQ@mail.gmail.com>
- In-Reply-To
- <87a6jut36p.fsf@evledraar.gmail.com>
On Thu, Sep 30, 2021 at 9:53 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 28 quoted lines
> > > On Tue, Aug 31 2021, Elijah Newren via GitGitGadget wrote: > > > @@ -108,8 +108,14 @@ test_expect_success 'refuse to merge binary files' ' > > printf "\0\0" >binary-file && > > git add binary-file && > > git commit -m binary2 && > > - test_must_fail git merge F >merge.out 2>merge.err && > > - grep "Cannot merge binary files: binary-file (HEAD vs. F)" merge.err > > + if test "$GIT_TEST_MERGE_ALGORITHM" = ort > > + then > > + test_must_fail git merge F >merge.out && > > + grep "Cannot merge binary files: binary-file (HEAD vs. F)" merge.out > > + else > > + test_must_fail git merge F >merge.out 2>merge.err && > > + grep "Cannot merge binary files: binary-file (HEAD vs. F)" merge.err > > + fi > > ' > > To save readers from eyeballing if a single character has changed here, > which I don't think it has, just do: > > if ... > then > cmd >actual > else > other cmd >actual
Do you mean other cmd >/dev/null 2>actual ?
Show 20 quoted lines
> fi && > grep [...] > > I.e. no need to duplicate the "grep" here just because of merge.out v.s. merge.err. > > [...] > > > - test_must_fail git merge bin-main 2>stderr && > > - grep -i "warning.*cannot merge.*HEAD vs. bin-main" stderr > > + if test "$GIT_TEST_MERGE_ALGORITHM" = ort > > + then > > + test_must_fail git merge bin-main >stdout && > > + grep -i "warning.*cannot merge.*HEAD vs. bin-main" stdout > > + else > > + test_must_fail git merge bin-main 2>stderr && > > + grep -i "warning.*cannot merge.*HEAD vs. bin-main" stderr > > + fi > > > ditto.