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

[PATCH] Do not print header in diff-tree --root unless asked to

From
Petr Baudis <pasky@suse.cz>
Date
Mar 25, 2006, 23:28 UTC
Message-ID
<20060325232807.9146.12846.stgit@machine.or.cz>

Currently cg-log -f is broken (shows sha1 in files list for the initial commit) since git-diff-tree would always return the sha1 of the commit when --root was passed. I assume it should do this only when -v was also passed; I'm certain that I don't want it when processing the output.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 diff-tree.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/diff-tree.c b/diff-tree.c
index f55a35a..8d82b5b 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -107,7 +107,8 @@ static int diff_tree_commit(struct commi
 
 	/* Root commit? */
 	if (show_root_diff && !commit->parents) {
-		header = generate_header(sha1, NULL, commit);
+		if (verbose_header)
+			header = generate_header(sha1, NULL, commit);
 		diff_root_tree(sha1, "");
 	}
 
Next: Junio C Hamano
Message 1 of 3 in “Do not print header in diff-tree --root unless asked to”
  1. Do not print header in diff-tree --root unless asked toPetr Baudis, Mar 25, 2006
  2. Junio C HamanoMar 26, 2006
  3. Petr BaudisMar 26, 2006

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.