{"thread":{"id":"49599","subject":"Sort output of diff --stat?","startedAt":"2018-10-17T18:15:34Z","lastAt":"2018-10-17T19:25:50Z","messageCount":4,"participants":["Robert Dailey","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"360771","messageId":"CAHd499BSVRytaFKOUhE=A4Zv+MMx=uKrWKUcT13QwzOCZWhEtg@mail.gmail.com","threadId":"49599","inReplyTo":null,"subject":"Sort output of diff --stat?","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2018-10-17T18:15:18Z","receivedAt":"2018-10-17T18:15:34Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"I'd like to sort the output of `git diff --stat` such that files are\nlisted in descending order based on number of lines changed. The\nclosest solution I've found online[1] has several readability issues.\nI'd rather see a built-in solution in git, if one exists. Can anyone\nrecommend a solution?\n\n[1]: https://gist.github.com/jakub-g/7599177\n"},{"id":"360777","messageId":"20181017184720.GF28326@sigill.intra.peff.net","threadId":"49599","inReplyTo":"CAHd499BSVRytaFKOUhE=A4Zv+MMx=uKrWKUcT13QwzOCZWhEtg@mail.gmail.com","subject":"Re: Sort output of diff --stat?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-10-17T18:47:21Z","receivedAt":"2018-10-17T18:47:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 17, 2018 at 01:15:18PM -0500, Robert Dailey wrote:\n\n> I'd like to sort the output of `git diff --stat` such that files are\n> listed in descending order based on number of lines changed. The\n> closest solution I've found online[1] has several readability issues.\n> I'd rather see a built-in solution in git, if one exists. Can anyone\n> recommend a solution?\n\nHmm, I feel like another person asked for this recently, but I can't\nseem to find the thread.\n\nAnyway, no, I don't think there's a solution short of parsing the output\n(you could parse --numstat, which is at least sane, but then you'd have\nto generate your own visual diffstat, which has a lot of corner cases).\n\nWe have --orderfile, but that's about a static order based on filename.\nIt seems reasonable to me for \"--stat\" to learn an option to sort (that\nwould not affect, say, the total diff order, since sorting by line count\nmakes very little sense for most other formats).\n\n-Peff\n"},{"id":"360778","messageId":"CAHd499Ci-DTtv=zKBY-9N60qS9TxerckHNzkOkeiZmUp4jDq_Q@mail.gmail.com","threadId":"49599","inReplyTo":"20181017184720.GF28326@sigill.intra.peff.net","subject":"Re: Sort output of diff --stat?","fromName":"Robert Dailey","fromEmail":"rcdailey.lists@gmail.com","sentAt":"2018-10-17T19:21:57Z","receivedAt":"2018-10-17T19:22:14Z","isPatch":false,"sender":{"key":"rcdailey.lists@gmail.com","avatar":null},"body":"On Wed, Oct 17, 2018 at 1:47 PM Jeff King <peff@peff.net> wrote:\n> Hmm, I feel like another person asked for this recently, but I can't\n> seem to find the thread.\n\nIs it this one?\nhttps://www.mail-archive.com/git@vger.kernel.org/msg159212.html\n\nThat's the only one I was able to find, but no one replied. Thanks for\nyour insight. I didn't get my hopes up, but maybe someday it'll be\nadded.\n"},{"id":"360779","messageId":"20181017192546.GA31563@sigill.intra.peff.net","threadId":"49599","inReplyTo":"CAHd499Ci-DTtv=zKBY-9N60qS9TxerckHNzkOkeiZmUp4jDq_Q@mail.gmail.com","subject":"Re: Sort output of diff --stat?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-10-17T19:25:46Z","receivedAt":"2018-10-17T19:25:50Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 17, 2018 at 02:21:57PM -0500, Robert Dailey wrote:\n\n> On Wed, Oct 17, 2018 at 1:47 PM Jeff King <peff@peff.net> wrote:\n> > Hmm, I feel like another person asked for this recently, but I can't\n> > seem to find the thread.\n> \n> Is it this one?\n> https://www.mail-archive.com/git@vger.kernel.org/msg159212.html\n> \n> That's the only one I was able to find, but no one replied. Thanks for\n> your insight. I didn't get my hopes up, but maybe someday it'll be\n> added.\n\nAh, yeah, that's the one. For some reason I thought I had replied, but\nobviously I did not. ;)\n\n-Peff\n"}]}