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

Re: Log message printout cleanups

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 18, 2006, 16:06 UTC
Message-ID
<Pine.LNX.4.64.0604180854550.3701@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0604180827040.3701@g5.osdl.org>
On Tue, 18 Apr 2006, Linus Torvalds wrote:
Show 10 quoted lines
> 
> But this all looks very nice. I agree that "git log --stat" is a very nice 
> way to look at the log, much better than "git-whatchanged". And the thing 
> that has really fallen out of this all is how you can do
> 
> 	git log --stat --full-diff drivers/pci/
> 
> which git-whatchanged historically didn't support (of course, now it 
> does, but you're right, the new "git log" is so nice that I'm starting to 
> teach myself not to use "git whatchanged" any more).

Junio, I just tested the "master" branch, and "git log --stat" doesn't work there. You may _think_ it works because you've tested it on the git tree, were it looks like it is working, but it's missing setting "recursive", so it won't actually go into any subdirectories (so it mostly works for git itself which has most stuff in the top-level directory, but it almost completely doesn't work for linux)

"git log -r --stat" works, so it's really just a missing that.
Something like this (this is master, not "next").

"next" actually has the same bug, but there it is hidden because "git log" sets recursive automatically. Which may or may not be appropriate. It might be worthwhile to fix it properly in "next" too (there the same

	if (...output_format == DIFF_FORMAT_PATCH)
		...recursive = 1;
is in revision.c: setup_revisions()).
		Linus
----
diff --git a/git.c b/git.c
index 140ed18..f98c9ba 100644
--- a/git.c
+++ b/git.c
@@ -344,7 +344,8 @@ static int cmd_log(int argc, const char 
 			opt.ignore_merges = 0;
 		if (opt.dense_combined_merges)
 			opt.diffopt.output_format = DIFF_FORMAT_PATCH;
-		if (opt.diffopt.output_format == DIFF_FORMAT_PATCH)
+		if (opt.diffopt.output_format == DIFF_FORMAT_PATCH ||
+		    opt.diffopt.output_format == DIFF_FORMAT_DIFFSTAT)
 			opt.diffopt.recursive = 1;
 		if (!full_diff && rev.prune_data)
 			diff_tree_setup_paths(rev.prune_data, &opt.diffopt);
Previous: Linus TorvaldsNext: Junio C Hamano
Message 15 of 18 in “Fixes for option parsing”
  1. Linus TorvaldsApr 16, 2006
  2. Junio C HamanoApr 17, 2006
  3. Linus TorvaldsApr 17, 2006
  4. Linus TorvaldsApr 17, 2006
  5. Junio C HamanoApr 17, 2006
  6. Linus TorvaldsApr 17, 2006
  7. Log message printout cleanupsLinus Torvalds, Apr 17, 2006
  8. Junio C HamanoApr 17, 2006
  9. Linus TorvaldsApr 17, 2006
  10. Junio C HamanoApr 18, 2006
  11. Junio C HamanoApr 18, 2006
  12. Linus TorvaldsApr 18, 2006
  13. Junio C HamanoApr 18, 2006
  14. Linus TorvaldsApr 18, 2006
  15. Linus TorvaldsApr 18, 2006
  16. Junio C HamanoApr 18, 2006
  17. diff --stat: make sure to set recursive.Junio C Hamano, Apr 18, 2006
  18. Linus TorvaldsApr 18, 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.