{"thread":{"id":"46143","subject":"Clarifying behavior of diff --stat","startedAt":"2017-06-08T11:10:48Z","lastAt":"2017-06-09T05:21:28Z","messageCount":2,"participants":["Samuel Lijin","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"321749","messageId":"CAJZjrdUHm2JAGsjurcGxONQomAtvV_GMgzqb0pPEovHSySd=KA@mail.gmail.com","threadId":"46143","inReplyTo":null,"subject":"Clarifying behavior of diff --stat","fromName":"Samuel Lijin","fromEmail":"sxlijin@gmail.com","sentAt":"2017-06-08T11:10:00Z","receivedAt":"2017-06-08T11:10:48Z","isPatch":false,"sender":{"key":"sxlijin@gmail.com","avatar":"https://gravatar.com/avatar/01777bf1eae64e2b4dca97dcac182a6abbcf6fd8cb4d5b8fa33edf9f8cc21746?d=mp&s=160"},"body":"I noticed when answering a StackOverflow question that apparently\n--stat modifies the raw diff itself, instead of just adding a diffstat\nto the output. In the linux kernel:\n\n$ git diff-tree --raw -M 00a2430ff07d4e0e0e7e24e02fd8adede333b797\n00a2430ff07d4e0e0e7e24e02fd8adede333b797\n:040000 040000 f5792c6667c23e113a4f18acfdc5e2c38f5217d7\nfb019210ebea7cf439f37d67111797ac7e37cca9 M      drivers\n\n$ git diff-tree --raw --stat -M 00a2430ff07d4e0e0e7e24e02fd8adede333b797\n00a2430ff07d4e0e0e7e24e02fd8adede333b797\n:100644 100644 c144102ea793541c7e8dad1d42072bb62e71ed4f\na186afeaa7001f3f81abb4f95d9edd3099477867 M\ndrivers/usb/gadget/Makefile\n:000000 100644 0000000000000000000000000000000000000000\n6d91f21b52a6301c303aac0a4f62e572d83c02aa A\ndrivers/usb/gadget/function/Makefile\n:100644 100644 ab1065afbbd0c0cac55788dad3b805f9a240b2a9\nab1065afbbd0c0cac55788dad3b805f9a240b2a9 R100\ndrivers/usb/gadget/f_acm.c      drivers/usb/gadget/function/f_acm.c\n:1006\n[...]\n drivers/usb/gadget/Makefile                        | 30 +------------------\n drivers/usb/gadget/function/Makefile               | 34 ++++++++++++++++++++++\n drivers/usb/gadget/{ => function}/f_acm.c          |  0\n [...]\n\nIs this intentional? And is there a way to generate a raw version of\nthe extended stat without using --stat?\n"},{"id":"321812","messageId":"20170609052121.f5fudcq6yz5d3r56@sigill.intra.peff.net","threadId":"46143","inReplyTo":"CAJZjrdUHm2JAGsjurcGxONQomAtvV_GMgzqb0pPEovHSySd=KA@mail.gmail.com","subject":"Re: Clarifying behavior of diff --stat","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-06-09T05:21:21Z","receivedAt":"2017-06-09T05:21:28Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 08, 2017 at 07:10:00AM -0400, Samuel Lijin wrote:\n\n> I noticed when answering a StackOverflow question that apparently\n> --stat modifies the raw diff itself, instead of just adding a diffstat\n> to the output. In the linux kernel:\n\nSort of. Using \"--stat\" implies \"-r\", since it only deals with the\nactual blobs and would have nothing to show for tree entries.\n\nAnd since recursive-ness is global to the whole diff, not just one\noutput format, the --raw output becomes recursive, too.\n\n> Is this intentional? And is there a way to generate a raw version of\n> the extended stat without using --stat?\n\nTry \"git diff-tree --raw -r\".\n\n-Peff\n"}]}