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

[PATCH] show changed tree objects with recursive git-diff-tree

From
Nicolas Pitre <nico@cam.org>
Date
May 21, 2005, 01:40 UTC
Message-ID
<Pine.LNX.4.62.0505202131520.4397@localhost.localdomain>

When -p is not used, git-diff-tree currently shows changed tree objects but only when not recursive. This patch makes the recursive output show tree objects as well.

This has the immediate benefit of making git-deltafy-script handle deltafication of tree objects.

Signed-off-by: Nicolas Pitre <nico@cam.org>
diff --git a/diff-tree.c b/diff-tree.c
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -131,7 +131,10 @@ static int compare_tree_entry(void *tree
 
 	if (recursive && S_ISDIR(mode1)) {
 		int retval;
-		char *newbase = malloc_base(base, path1, pathlen1);
+		char *newbase;
+		if (!silent && !generate_patch)
+			diff_change(mode1, mode2, sha1, sha2, base, path1);
+		newbase = malloc_base(base, path1, pathlen1);
 		retval = diff_tree_sha1(sha1, sha2, newbase);
 		free(newbase);
 		return retval;
diff --git a/git-deltafy-script b/git-deltafy-script
--- a/git-deltafy-script
+++ b/git-deltafy-script
@@ -9,8 +9,6 @@
 # NOTE: the "best earlier version" is not implemented in mkdelta yet
 #       and therefore only the next eariler version is used at this time.
 #
-# TODO: deltafy tree objects as well.
-#
 # The -d argument allows to provide a limit on the delta chain depth.
 # If 0 is passed then everything is undeltafied.
 
Next: Junio C Hamano
Message 1 of 9 in “show changed tree objects with recursive git-diff-tree”
  1. show changed tree objects with recursive git-diff-treeNicolas Pitre, May 21, 2005
  2. Junio C HamanoMay 21, 2005
  3. Linus TorvaldsMay 21, 2005
  4. Nicolas PitreMay 23, 2005
  5. Junio C HamanoMay 25, 2005
  6. Nicolas PitreMay 25, 2005
  7. Junio C HamanoMay 25, 2005
  8. Linus TorvaldsMay 21, 2005
  9. Junio C HamanoMay 21, 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.