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

Confused about diff-tree --cc output

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 4, 2009, 21:13 UTC
Message-ID
<76718490902041313y44eeb99bya33513bc9818aeb0@mail.gmail.com>

I'm a bit confused about the output of "git show 8554af" (i.e. git diff-tree --cc 8554af) on the git tree.

This is a merge of a topic branch of two patches I submitted. If I understand what Junio did, he branched js/maint-remote-remove-mirror from maint, applied the two patches I sent via email, then merged that to next. (Given the topic name he chose, after cooking for a while, I guess it will eventually merge to maint.)

My understanding of "git show <merge commit>" is that it should only show changes if the merge resulted in a conflict that needed to be touched up (ignoring the possibility of an evil merge). Yet git show on this commit shows this diff:

diff --cc builtin-remote.c index abc8dd8,07cfdac..db18bcf

--- a/builtin-remote.c
+++ b/builtin-remote.c
@@@ -539,11 -362,14 +549,14 @@@ static int rm(int argc, const char **ar
  		OPT_END()
  	};
  	struct remote *remote;
 -	struct strbuf buf;
 +	struct strbuf buf = STRBUF_INIT;
  	struct known_remotes known_remotes = { NULL, NULL };
  	struct string_list branches = { NULL, 0, 0, 1 };
- 	struct branches_for_remote cb_data = { NULL, &branches, &known_remotes };
- 	int i;
+ 	struct string_list skipped = { NULL, 0, 0, 1 };
+ 	struct branches_for_remote cb_data = {
+ 		NULL, &branches, &skipped, &known_remotes
+ 	};
+ 	int i, result;

  	if (argc != 2)
  		usage_with_options(builtin_remote_usage, options);

This is the same output shown here:

  http://repo.or.cz/w/git.git?a=commitdiff;h=8554af

However, kernel.org's git shows something different (and more what I
would expect, if any output is to be shown):

  http://git.kernel.org/?p=git/git.git;a=commitdiff;h=8554af

(I guess kernel.org is using something like diff-tree -p 3613d1 8554af
--, but I'm not sure why.)

I don't see any other changes to builtin-remote.c that would have
caused a merge conflict, so, color me confused.

j.
Next: Junio C Hamano
Message 1 of 5 in “Confused about diff-tree --cc output”
  1. Jay SoffianFeb 4, 2009
  2. Junio C HamanoFeb 4, 2009
  3. Jay SoffianFeb 5, 2009
  4. Junio C HamanoFeb 5, 2009
  5. Jay SoffianFeb 5, 2009

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.