{"thread":{"id":"53956","subject":"Diff --stat for files that differ only in whitespace","startedAt":"2020-07-31T13:10:55Z","lastAt":"2020-07-31T20:43:46Z","messageCount":7,"participants":["Matt Rogers","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"402525","messageId":"CAOjrSZtQPQ8Xxuz+7SGykR8Q-gFDEZANSE5yQASqKjpbUAq_5Q@mail.gmail.com","threadId":"53956","inReplyTo":null,"subject":"Diff --stat for files that differ only in whitespace","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2020-07-31T13:10:44Z","receivedAt":"2020-07-31T13:10:55Z","isPatch":false,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"When using a repository with \"core.autocrlf=false\" I'm trying to run a diff\nbetween two commits that have many files (~1000) changed that differ mostly\nin line endings or other whitespace.  When I run\n`git diff --stat --ignore-all-space <commit-1> <commit-2>` I'm getting an output\nthat has many files listed like:\n\nsome-file.txt | 0\n\nThis is easy enough to parse through when it's a small number of files but when\nthere is ~1000 files with only maybe 1500 insertions/deletions showing it's not\nreally useful to me to see a list of those 1000 files, if there was a way to\nsort by number of insertion/deletions or filter out the files that had 0\neffective changes that would solve my problem.\n\n\nSimple example:\n\n```\nmkdir example && cd example\ngit init\ngit config --local core.autocrlf false\necho HELLO > file.txt\necho WORLD >> file.txt\ngit add file.txt\ngit commit -m \"first kind of line endings\"\n\n<use an editor to swap out the line endings>\ngit add file.txt\ngit commit -m \"second kind of line endings\"\n\ngit diff --stat --ignore-all-space HEAD~1 HEAD\n```\n\nThanks,\nMatthew Rogers\n"},{"id":"402562","messageId":"xmqq8sez4mk7.fsf@gitster.c.googlers.com","threadId":"53956","inReplyTo":"CAOjrSZtQPQ8Xxuz+7SGykR8Q-gFDEZANSE5yQASqKjpbUAq_5Q@mail.gmail.com","subject":"Re: Diff --stat for files that differ only in whitespace","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-31T17:32:56Z","receivedAt":"2020-07-31T17:33:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matt Rogers <mattr94@gmail.com> writes:\n\n> some-file.txt | 0\n>\n> This is easy enough to parse through when it's a small number of files but when\n> there is ~1000 files with only maybe 1500 insertions/deletions showing it's not\n> really useful to me to see a list of those 1000 files, if there was a way to\n> sort by number of insertion/deletions or filter out the files that had 0\n> effective changes that would solve my problem.\n\nWhether you are interested in whitespace or not, if you are\nprocessing the diff output with scripts, --numstat (not --stat)\nmay be simpler to work with.\n"},{"id":"402565","messageId":"20200731174149.GB843002@coredump.intra.peff.net","threadId":"53956","inReplyTo":"CAOjrSZtQPQ8Xxuz+7SGykR8Q-gFDEZANSE5yQASqKjpbUAq_5Q@mail.gmail.com","subject":"Re: Diff --stat for files that differ only in whitespace","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-31T17:41:49Z","receivedAt":"2020-07-31T17:41:52Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 31, 2020 at 09:10:44AM -0400, Matt Rogers wrote:\n\n> When using a repository with \"core.autocrlf=false\" I'm trying to run a diff\n> between two commits that have many files (~1000) changed that differ mostly\n> in line endings or other whitespace.  When I run\n> `git diff --stat --ignore-all-space <commit-1> <commit-2>` I'm getting an output\n> that has many files listed like:\n> \n> some-file.txt | 0\n\nThis seemed familiar, so I dug up some prior discussion here:\n\n  https://lore.kernel.org/git/1484704915.2096.16.camel@mattmccutchen.net/\n\nWe didn't come to a resolution there, but there is a patch to play with,\nand I think nobody was opposed to the notion that with the right\ncode change we could be suppressing these whitespace-only stat lines\n\n-Peff\n"},{"id":"402579","messageId":"CAOjrSZskJRj+TVV35fEp-Mhd+proVV72rh3vAcVFnNfhRy2ayA@mail.gmail.com","threadId":"53956","inReplyTo":"20200731174149.GB843002@coredump.intra.peff.net","subject":"Re: Diff --stat for files that differ only in whitespace","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2020-07-31T19:26:16Z","receivedAt":"2020-07-31T19:26:30Z","isPatch":false,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"On Fri, Jul 31, 2020 at 1:41 PM Jeff King <peff@peff.net> wrote:\n>\n> This seemed familiar, so I dug up some prior discussion here:\n>\n>   https://lore.kernel.org/git/1484704915.2096.16.camel@mattmccutchen.net/\n>\n> We didn't come to a resolution there, but there is a patch to play with,\n> and I think nobody was opposed to the notion that with the right\n> code change we could be suppressing these whitespace-only stat lines\n>\n> -Peff\n\n\nI think for now I'm going to feed --numstat into a script like Junio suggested.\nOut of curiosity what would it take to get that patch into git? Is it just a\nmatter of someone just verifying it and submitting it?\n\n--\nMatthew Rogers\n"},{"id":"402581","messageId":"20200731194810.GA849395@coredump.intra.peff.net","threadId":"53956","inReplyTo":"CAOjrSZskJRj+TVV35fEp-Mhd+proVV72rh3vAcVFnNfhRy2ayA@mail.gmail.com","subject":"Re: Diff --stat for files that differ only in whitespace","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-07-31T19:48:10Z","receivedAt":"2020-07-31T19:48:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 31, 2020 at 03:26:16PM -0400, Matt Rogers wrote:\n\n> > This seemed familiar, so I dug up some prior discussion here:\n> >\n> >   https://lore.kernel.org/git/1484704915.2096.16.camel@mattmccutchen.net/\n> >\n> > We didn't come to a resolution there, but there is a patch to play with,\n> > and I think nobody was opposed to the notion that with the right\n> > code change we could be suppressing these whitespace-only stat lines\n> >\n> > -Peff\n> \n> \n> I think for now I'm going to feed --numstat into a script like Junio suggested.\n> Out of curiosity what would it take to get that patch into git? Is it just a\n> matter of someone just verifying it and submitting it?\n\nYeah, I think it would require making an argument that the patch covers\nthe correct set of cases (or fixing it if it doesn't), and probably\nadding some tests.\n\n-Peff\n"},{"id":"402588","messageId":"xmqqeeor300w.fsf@gitster.c.googlers.com","threadId":"53956","inReplyTo":"CAOjrSZskJRj+TVV35fEp-Mhd+proVV72rh3vAcVFnNfhRy2ayA@mail.gmail.com","subject":"Re: Diff --stat for files that differ only in whitespace","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-07-31T20:25:03Z","receivedAt":"2020-07-31T20:25:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matt Rogers <mattr94@gmail.com> writes:\n\n> On Fri, Jul 31, 2020 at 1:41 PM Jeff King <peff@peff.net> wrote:\n>>\n>> This seemed familiar, so I dug up some prior discussion here:\n>>\n>>   https://lore.kernel.org/git/1484704915.2096.16.camel@mattmccutchen.net/\n>>\n>> We didn't come to a resolution there, but there is a patch to play with,\n>> and I think nobody was opposed to the notion that with the right\n>> code change we could be suppressing these whitespace-only stat lines\n>>\n>> -Peff\n>\n>\n> I think for now I'm going to feed --numstat into a script like Junio suggested.\n> Out of curiosity what would it take to get that patch into git? Is it just a\n> matter of someone just verifying it and submitting it?\n\nAfter re-reading the thread, I think it takes a bit more than just\nre-reading and testing, because even the author of the patch said\n(and I think I still agree with the assessment) that the patch does\none thing that is not exactly what we want it to do.  So we'd need\nto tweak it more to do what we want to do, I would suspect.\n"},{"id":"402597","messageId":"CAOjrSZu7-KxgoxNTWiYF+_suDMo6S808L6iRWvK0HYZT8rqN7A@mail.gmail.com","threadId":"53956","inReplyTo":"xmqqeeor300w.fsf@gitster.c.googlers.com","subject":"Re: Diff --stat for files that differ only in whitespace","fromName":"Matt Rogers","fromEmail":"mattr94@gmail.com","sentAt":"2020-07-31T20:43:33Z","receivedAt":"2020-07-31T20:43:46Z","isPatch":false,"sender":{"key":"mattr94@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5719846?v=4"},"body":"On Fri, Jul 31, 2020 at 4:25 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n>\n> After re-reading the thread, I think it takes a bit more than just\n> re-reading and testing, because even the author of the patch said\n> (and I think I still agree with the assessment) that the patch does\n> one thing that is not exactly what we want it to do.  So we'd need\n> to tweak it more to do what we want to do, I would suspect.\n\nGot it, I'll try to look into this more over the weekend then if there's\nno problems with that\n\n-- \nMatthew Rogers\n"}]}