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

[PATCH] fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE

From
NENick Edelen <sirnot@gmail.com>
Date
Jun 13, 2009, 20:32 UTC
Message-ID
<op.uvhcoii8tdk399@sirnot.private>
fix show_entry() in tree_diff.c to display tree entries on TREE_IN_RECURSIVE
Signed-off-by: Nick Edelen <sirnot@gmail.com>
---
this seems like how it should act: trees are shown under this option for changes, so it's logical they should also be shown for adds and removals.  at any rate rev-cache needs it, so I sure hope it's supposed to do this...
 tree-diff.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/tree-diff.c b/tree-diff.c
index edd8394..189a298 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -239,6 +239,12 @@ static void show_entry(struct diff_options *opt, const char *prefix, struct tree
 		if (!tree || type != OBJ_TREE)
 			die("corrupt tree sha %s", sha1_to_hex(sha1));
 
+		if (DIFF_OPT_TST(opt, TREE_IN_RECURSIVE)) {
+			newbase[baselen + pathlen] = 0;
+			opt->add_remove(opt, prefix[0], mode, sha1, newbase);
+			newbase[baselen + pathlen] = '/';
+		}
+
 		init_tree_desc(&inner, tree, size);
 		show_tree(opt, prefix, &inner, newbase, baselen + 1 + pathlen);
 
Next: Junio C Hamano
Message 1 of 4 in “fix show_entry() in tree-diff.c for TREE_IN_RECURSIVE”
  1. fix show_entry() in tree-diff.c for TREE_IN_RECURSIVENick Edelen, Jun 13, 2009
  2. Junio C HamanoJun 13, 2009
  3. Junio C HamanoJun 14, 2009
  4. Nick EdelenJun 14, 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.