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

Re: [PATCH] Fix read-tree merging more than 3 trees using 3-way merge

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 17, 2007, 00:59 UTC
Message-ID
<alpine.LFD.0.999.0708161750550.30176@woody.linux-foundation.org>
In-Reply-To
<7vbqd8o1qs.fsf@gitster.siamese.dyndns.org>
On Wed, 15 Aug 2007, Junio C Hamano wrote:
Show 6 quoted lines
>
> For multi-base merges, we allowed read-tree -m to take more than
> three trees (the last two are our and their branches, and all the
> earlier ones, typically one but potentially more, are used as the
> merge base).  Unfortunately, the conversion done by commit 933bf40
> broke this.
Sorry. I didn't even realize people did this. Oops.

I note that the thign you committed limited the number of trees to 4. May I suggest this patch in addition to your patch? Also, is 4 actually the real maximum? Maybe it should be raised?

What *is* the behaviour for four trees? Reading "unpack_trees()" source implies that all other trees go into stage 1, where the first matching entry is used?

		Linus
---
 builtin-read-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index f6764b9..d5f849b 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -21,7 +21,7 @@ static int list_tree(unsigned char *sha1)
 {
 	struct tree *tree;
 
-	if (nr_trees >= 4)
+	if (nr_trees >= MAX_TREES)
 		return -1;
 	tree = parse_tree_indirect(sha1);
 	if (!tree)
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 11 in “1.5.3-rc5 regression on OS X?”
  1. Perrin MeyerAug 15, 2007
  2. Junio C HamanoAug 15, 2007
  3. Brian GernhardtAug 15, 2007
  4. Randal L. SchwartzAug 15, 2007
  5. Junio C HamanoAug 15, 2007
  6. Fix read-tree merging more than 3 trees using 3-way mergeJunio C Hamano, Aug 15, 2007
  7. Linus TorvaldsAug 17, 2007
  8. Junio C HamanoAug 17, 2007
  9. Linus TorvaldsAug 17, 2007
  10. Junio C HamanoAug 17, 2007
  11. Linus TorvaldsAug 17, 2007

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.