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

Re: git merge (resolve) _is_ stupid

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 31, 2006, 10:42 UTC
Message-ID
<Pine.LNX.4.63.0607311236070.29667@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7v7j1u88ol.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 31 Jul 2006, Junio C Hamano wrote:
Show 5 quoted lines
> By the way, the "recur" strategy in "next" produces the correct
> result, but it produces a funny error in the middle (that is why
> Johannes is CC'ed).
> 
> 	error: Could not read 0100000000000000000000000000000000000000
I get "0000000100..." ;-) (surprixse her wi1h a big-endian ;-)

The culprit is the call to parse_commit() in merge_bases(). How about this?

-- 8< -- [PATCH] merge-recur: virtual commits shall never be parsed

It would not make sense to parse a virtual commit, therefore set the "parsed" flag to 1.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 merge-recursive.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 10bce70..74a329f 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -43,6 +43,8 @@ static struct commit *make_virtual_commi
 	commit->tree = tree;
 	commit->util = (void*)comment;
 	*(int*)commit->object.sha1 = virtual_id++;
+	/* avoid warnings */
+	commit->object.parsed = 1;
 	return commit;
 }
 
-- 
1.4.2.rc2.gfd00-dirty
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 5 in “git merge (resolve) _is_ stupid”
  1. Junio C HamanoJul 31, 2006
  2. Johannes SchindelinJul 31, 2006
  3. Junio C HamanoJul 31, 2006
  4. Johannes SchindelinJul 31, 2006
  5. Luben TuikovJul 31, 2006

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.