Clarifying behavior of diff --stat

2 messages, 2 authors, 2017-06-09 · open the first message on its own page

Clarifying behavior of diff --stat

From: Samuel Lijin <hidden>
Date: 2017-06-08 11:10:48

I noticed when answering a StackOverflow question that apparently
--stat modifies the raw diff itself, instead of just adding a diffstat
to the output. In the linux kernel:

$ git diff-tree --raw -M 00a2430ff07d4e0e0e7e24e02fd8adede333b797
00a2430ff07d4e0e0e7e24e02fd8adede333b797
:040000 040000 f5792c6667c23e113a4f18acfdc5e2c38f5217d7
fb019210ebea7cf439f37d67111797ac7e37cca9 M      drivers

$ git diff-tree --raw --stat -M 00a2430ff07d4e0e0e7e24e02fd8adede333b797
00a2430ff07d4e0e0e7e24e02fd8adede333b797
:100644 100644 c144102ea793541c7e8dad1d42072bb62e71ed4f
a186afeaa7001f3f81abb4f95d9edd3099477867 M
drivers/usb/gadget/Makefile
:000000 100644 0000000000000000000000000000000000000000
6d91f21b52a6301c303aac0a4f62e572d83c02aa A
drivers/usb/gadget/function/Makefile
:100644 100644 ab1065afbbd0c0cac55788dad3b805f9a240b2a9
ab1065afbbd0c0cac55788dad3b805f9a240b2a9 R100
drivers/usb/gadget/f_acm.c      drivers/usb/gadget/function/f_acm.c
:1006
[...]
 drivers/usb/gadget/Makefile                        | 30 +------------------
 drivers/usb/gadget/function/Makefile               | 34 ++++++++++++++++++++++
 drivers/usb/gadget/{ => function}/f_acm.c          |  0
 [...]

Is this intentional? And is there a way to generate a raw version of
the extended stat without using --stat?

Re: Clarifying behavior of diff --stat

From: Jeff King <hidden>
Date: 2017-06-09 05:21:28

On Thu, Jun 08, 2017 at 07:10:00AM -0400, Samuel Lijin wrote:
I noticed when answering a StackOverflow question that apparently
--stat modifies the raw diff itself, instead of just adding a diffstat
to the output. In the linux kernel:
Sort of. Using "--stat" implies "-r", since it only deals with the
actual blobs and would have nothing to show for tree entries.

And since recursive-ness is global to the whole diff, not just one
output format, the --raw output becomes recursive, too.
Is this intentional? And is there a way to generate a raw version of
the extended stat without using --stat?
Try "git diff-tree --raw -r".

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help