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

Re: git-show --stat on first commit

From
PBPeter Baumann <peter.b.baumann@stud.informatik.uni-erlangen.de>
Date
Nov 21, 2006, 17:16 UTC
Message-ID
<slrnem6d3i.7bn.Peter.B.Baumann@xp.machine.xx>
In-Reply-To
<ejv8pc$cig$1@sea.gmane.org>
On 2006-11-21, Jakub Narebski <jnareb@gmail.com> wrote:
Show 36 quoted lines
> Peter Baumann wrote:
>
>> On 2006-11-21, Santi Béjar <sbejar@gmail.com> wrote:
>>> On 11/21/06, Andy Parkins <andyparkins@gmail.com> wrote:
>>>> Hello,
>>>>
>>>> I'm sure this one will be known about already.  git-show --stat on the the
>>>> first commit doesn't show anything.  I assume it's because git-diff-tree has
>>>> nothing to diff against (although shouldn't that be an everything-new diff?).
>>>>
>>>> Given the above; does anyone have a suggestion for what I could use as a
>>>> replacement?  Even just a list of the new files would be useful.
>
> You can always use git-ls-tree
>
>>> $ git show --stat --root
>>>
>>> In general the initial commit diff (or stat) is hidden, but perhaps it
>>> make sense to show it in "git show", you asked fo this specifically.
>> 
>> Why not make --root the default? I also stumbled over this behaviour and
>> even asked on this list.
>> 
>> In my opinion this will help new users which are supprised that they
>> can't get the diff of the inital commit (which is totaly non-intuitiv behavior).
>> 
>> And one less "wart" to clean, which another thread is all about. :-)
>
> Because for projects imported into git first commit diff is huge,
> and not very interesting. By the way, git show by default doesn't show
> diff for merges (you need --cc for that), nor rename detection (you need
> -M for that).
>
> But you can always set default diff-tree options, including --root, --cc
> and -M in the show.difftree configuration variable (either in repo config,
> or in user config). It is IMHO better solution than changing defaults.
Ah. I wasn't aware of this. Thank for this nice tip.
Peter
Previous: Jakub NarebskiNext: Linus Torvalds
Message 6 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.