Thread (22 messages) flat view 22 messages, 9 authors, 2016-08-11

Re: git-show --stat on first commit

From: Peter Baumann <hidden>
Date: 2016-08-11 20:32:37

On 2006-11-21, Jakub Narebski [off-list ref] wrote:
Peter Baumann wrote:
quoted
On 2006-11-21, Santi Béjar [off-list ref] wrote:
quoted
On 11/21/06, Andy Parkins [off-list ref] wrote:
quoted
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
quoted
quoted
$ 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help