Re: [PATCH 4/7] merge-ort: capture and print ll-merge warnings in our preferred fashion
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Oct 1, 2021, 07:23 UTC
- Message-ID
- <871r55tdgw.fsf@evledraar.gmail.com>
- In-Reply-To
- <CABPp-BFyh239+7FLuUuoRJJbcE8NxHZABPTXPmSQhvRSPCiGvQ@mail.gmail.com>
On Thu, Sep 30 2021, Elijah Newren wrote:
Show 34 quoted lines
> On Thu, Sep 30, 2021 at 9:53 AM Ævar Arnfjörð Bjarmason > <avarab@gmail.com> wrote: >> >> >> 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 > ?
Yes, sorry. I was going for lazy pseudocode. I meant maybe the "grep" can be shared between the two.