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

[PATCH (take 2)] Use diff-tree -p instead of "git diff" in git-export.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 27, 2005, 23:18 UTC
Message-ID
<7vsm1bdd15.fsf@assigned-by-dhcp.cox.net>

Now diff-tree can produce patch itself, there is no reason to depend on Cogito to show diff in the git-export output anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

This is a reworked patch---we just made -p to imply recursive so we can just say diff-tree -p, not diff-tree -p -r like I said in the previous patch.

git-export.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)

--- k/git-export.c +++ l/git-export.c

@@ -18,7 +18,7 @@ void show_commit(struct commit *commit)
 		char *against = sha1_to_hex(commit->parents->item->object.sha1);
 		printf("\n\n======== diff against %s ========\n", against);
 		fflush(NULL);
-		sprintf(cmdline, "git diff -r %s:%s", against, hex);
+		sprintf(cmdline, "diff-tree -p %s %s", against, hex);
 		system(cmdline);
 	}
 	printf("======== end ========\n\n");
Message 1 of 1 in “Use diff-tree -p instead of "git diff" in git-export.”
  1. Use diff-tree -p instead of "git diff" in git-export.Junio C Hamano, Apr 27, 2005

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.