Re: [PATCH] merge-tree: accept 3 trees as arguments
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 30, 2024, 20:05 UTC
- Message-ID
- <71c5d2cb-46fb-b6f5-7180-d7b769dcc686@gmx.de>
- In-Reply-To
- <xmqqplxoozh9.fsf@gitster.g>
Hi Junio,
On Fri, 26 Jan 2024, Junio C Hamano wrote:
Show 10 quoted lines
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> > writes: > > > From: Johannes Schindelin <johannes.schindelin@gmx.de> > > > > When specifying a merge base explicitly, there is actually no good > > reason why the inputs need to be commits: that's only needed if the > > merge base has to be deduced from the commit graph. > > yes, Yes, YES, YEAHHHHH!
:-D
Show 23 quoted lines
> > diff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh
> > index 12ac4368736..71f21bb834f 100755
> > --- a/t/t4301-merge-tree-write-tree.sh
> > +++ b/t/t4301-merge-tree-write-tree.sh
> > @@ -945,4 +945,12 @@ test_expect_success 'check the input format when --stdin is passed' '
> > test_cmp expect actual
> > '
> >
> > +test_expect_success '--merge-base with tree OIDs' '
> > + git merge-tree --merge-base=side1^ side1 side3 >tree &&
> > + tree=$(cat tree) &&
> > + git merge-tree --merge-base=side1^^{tree} side1^{tree} side3^{tree} >tree2 &&
> > + tree2=$(cat tree2) &&
> > + test $tree = $tree2
> > +'
>
> You do not need $tree and $tree2 variables that would make it harder
> to diagnose a failure case when we break merge-tree. You have tree
> and tree2 as files, and I think it is sufficient to do
>
> git merge-tree ... >result-from-commits &&
> git merge-tree ... >result-from-trees &&
> test_cmp result-from-commits result-from-treesThat's valuable feedback, thank you! As you saw, I changed it accordingly in v2.
Ciao, Johannes