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

Clarifying behavior of diff --stat

From
Samuel Lijin <sxlijin@gmail.com>
Date
Jun 8, 2017, 11:10 UTC
Message-ID
<CAJZjrdUHm2JAGsjurcGxONQomAtvV_GMgzqb0pPEovHSySd=KA@mail.gmail.com>

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?

Next: Jeff King
Message 1 of 2 in “Clarifying behavior of diff --stat”
  1. Samuel LijinJun 8, 2017
  2. Jeff KingJun 9, 2017

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.