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

Re: [PATCH] config option core.showroot to enable showing the diff of the root commit

From
PBPeter Baumann <peter.b.baumann@stud.informatik.uni-erlangen.de>
Date
Nov 24, 2006, 07:53 UTC
Message-ID
<slrnemd98k.a3v.Peter.B.Baumann@xp.machine.xx>
In-Reply-To
<7vzmahfx6q.fsf@assigned-by-dhcp.cox.net>
On 2006-11-24, Junio C Hamano <junkio@cox.net> wrote:
Show 15 quoted lines
>> "git-diff-tree --color HEAD" (with explicit command line
>> instruction to color it) still colours its output, but "[diff]
>> color = auto" in ~/.gitconfig would not affect the coloring.
>> Hence, "git-diff-tree HEAD" with the configuration entry gives
>> monochrome.
>>
>> "git diff HEAD" on the other hand looks at '[diff] color = auto"
>> and will color its output without being told on the command
>> line.
>
> Since this is about "log" family that deals with revision
> structure, how about....
>
> -- >8 --
> [PATCH] config option log.showroot to show the diff of root commits
[...]
Patch looks good.

One question, what's the difference between git-log -p and git-whatchanged -p? I could only see it differ in the root commit handling.

Interesting parts marked with | as first character of the line.
  git-repo-config --get log.showroot
  false
  git-log -p 8bc9a0c769ac1df7820f2dbf8f7b7d64835e3c68
  commit 8bc9a0c769ac1df7820f2dbf8f7b7d64835e3c68
  Author: Linus Torvalds <torvalds@ppc970.osdl.org>
  Date:   Thu Apr 7 15:16:10 2005 -0700
      Add copyright notices.
      The tool interface sucks (especially "committing" information, which is just
      me doing everything by hand from the command line), but I think this is in
      theory actually a viable way of describing the world. So copyright it.
  diff --git a/cat-file.c b/cat-file.c
  index 74a0a23..d8f0121 100644
  --- a/cat-file.c
  +++ b/cat-file.c
  @@ -1,3 +1,8 @@
  +/*
  + * GIT - The information manager from hell
  + *
  + * Copyright (C) Linus Torvalds, 2005
  + */
   #include "cache.h"
   int main(int argc, char **argv)
  [... rest of the diff ...]
| commit e83c5163316f89bfbde7d9ab23ca2e25604af290
| Author: Linus Torvalds <torvalds@ppc970.osdl.org>
| Date:   Thu Apr 7 15:13:13 2005 -0700
|
|     Initial revision of "git", the information manager from hell
|
  [ ... as specified in log.showroot, no diff of the root commit ...]
  git-whatchanged -p 8bc9a0c769ac1df7820f2dbf8f7b7d64835e3c68
  commit 8bc9a0c769ac1df7820f2dbf8f7b7d64835e3c68
  Author: Linus Torvalds <torvalds@ppc970.osdl.org>
  Date:   Thu Apr 7 15:16:10 2005 -0700
  
      Add copyright notices.
      
      The tool interface sucks (especially "committing" information, which is just
      me doing everything by hand from the command line), but I think this is in
      theory actually a viable way of describing the world. So copyright it.
  
  diff --git a/cat-file.c b/cat-file.c
  index 74a0a23..d8f0121 100644
  --- a/cat-file.c
  +++ b/cat-file.c
  @@ -1,3 +1,8 @@
  +/*
  + * GIT - The information manager from hell
  + *
  + * Copyright (C) Linus Torvalds, 2005
  + */
   #include "cache.h"
   
   int main(int argc, char **argv)
  [... rest of the diff ...]
|
| [ ... no commit message etc from the root commit is shown ...]
|

As you can see, the root commit isn't shown. Is this intentional? Or is it just me not getting the different meaning of git-log and git-whatchanged?

Setting "log.showroot = true" the output of the 2 commands is identical.
Peter
Previous: Junio C HamanoNext: Junio C Hamano
Message 31 of 35 in “git-show --stat on first commit”
  1. Andy ParkinsNov 21, 2006
  2. Jakub NarebskiNov 21, 2006
  3. Santi BéjarNov 21, 2006
  4. Peter BaumannNov 21, 2006
  5. Jakub NarebskiNov 21, 2006
  6. Peter BaumannNov 21, 2006
  7. Linus TorvaldsNov 21, 2006
  8. Shawn PearceNov 21, 2006
  9. Peter BaumannNov 21, 2006
  10. Linus TorvaldsNov 21, 2006
  11. Olivier GalibertNov 21, 2006
  12. Shawn PearceNov 21, 2006
  13. Petr BaudisNov 21, 2006
  14. Petr BaudisNov 21, 2006
  15. Jakub NarebskiNov 21, 2006
  16. Petr BaudisNov 21, 2006
  17. Shawn PearceNov 21, 2006
  18. Andy ParkinsNov 21, 2006
  19. Petr BaudisNov 21, 2006
  20. Shawn PearceNov 21, 2006
  21. Petr BaudisNov 21, 2006
  22. Junio C HamanoNov 21, 2006
  23. Jakub NarebskiNov 21, 2006
  24. Andy ParkinsNov 23, 2006
  25. Jakub NarebskiNov 24, 2006
  26. config option core.showroot to enable showing the diff of the root commitPeter Baumann, Nov 23, 2006
  27. Junio C HamanoNov 23, 2006
  28. Peter BaumannNov 23, 2006
  29. Junio C HamanoNov 24, 2006
  30. Junio C HamanoNov 24, 2006
  31. Peter BaumannNov 24, 2006
  32. Junio C HamanoNov 24, 2006
  33. Peter BaumannNov 24, 2006
  34. Carl WorthNov 21, 2006
  35. Junio C HamanoNov 21, 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.