git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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-trees

That's valuable feedback, thank you! As you saw, I changed it accordingly in v2.

Ciao, Johannes

Previous: Junio C HamanoNext: Johannes Schindelin via GitGitGadget
Message 4 of 12 in “merge-tree: accept 3 trees as arguments”
  1. merge-tree: accept 3 trees as argumentsJohannes Schindelin via GitGitGadget, Jan 26, 2024
  2. Eric SunshineJan 26, 2024
  3. Junio C HamanoJan 26, 2024
  4. Johannes SchindelinJan 30, 2024
  5. merge-tree: accept 3 trees as argumentsJohannes Schindelin via GitGitGadget, Jan 28, 2024
  6. Junio C HamanoJan 29, 2024
  7. Elijah NewrenJan 30, 2024
  8. Junio C HamanoJan 30, 2024
  9. Elijah NewrenJan 31, 2024
  10. Junio C HamanoJan 31, 2024
  11. Johannes SchindelinJan 30, 2024
  12. Elijah NewrenJan 31, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.