# [PATCH] Use diff-tree -p -r instead of "git diff" in git-export.

1 messages from 2005-04-27 to 2005-04-27. Participants: Junio C Hamano.
Thread: https://gitlist.dev/t/359

## Junio C Hamano, 2005-04-27 22:26

Subject: [PATCH] Use diff-tree -p -r instead of "git diff" in git-export.
Message-ID: <7vd5sfeu0n.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd5sfeu0n.fsf%40assigned-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>
---

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

# - diff.c: don't add extra '/' to pathname
# + 04/27 15:23 Use diff-tree -p in git-export.
--- 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 -r %s %s", against, hex);
 		system(cmdline);
 	}
 	printf("======== end ========\n\n");


```
