git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Sort output of diff --stat?
@ 2018-10-17 18:15 Robert Dailey
  2018-10-17 18:47 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Dailey @ 2018-10-17 18:15 UTC (permalink / raw)
  To: Git

I'd like to sort the output of `git diff --stat` such that files are
listed in descending order based on number of lines changed. The
closest solution I've found online[1] has several readability issues.
I'd rather see a built-in solution in git, if one exists. Can anyone
recommend a solution?

[1]: https://gist.github.com/jakub-g/7599177

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sort output of diff --stat?
  2018-10-17 18:15 Sort output of diff --stat? Robert Dailey
@ 2018-10-17 18:47 ` Jeff King
  2018-10-17 19:21   ` Robert Dailey
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2018-10-17 18:47 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Git

On Wed, Oct 17, 2018 at 01:15:18PM -0500, Robert Dailey wrote:

> I'd like to sort the output of `git diff --stat` such that files are
> listed in descending order based on number of lines changed. The
> closest solution I've found online[1] has several readability issues.
> I'd rather see a built-in solution in git, if one exists. Can anyone
> recommend a solution?

Hmm, I feel like another person asked for this recently, but I can't
seem to find the thread.

Anyway, no, I don't think there's a solution short of parsing the output
(you could parse --numstat, which is at least sane, but then you'd have
to generate your own visual diffstat, which has a lot of corner cases).

We have --orderfile, but that's about a static order based on filename.
It seems reasonable to me for "--stat" to learn an option to sort (that
would not affect, say, the total diff order, since sorting by line count
makes very little sense for most other formats).

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sort output of diff --stat?
  2018-10-17 18:47 ` Jeff King
@ 2018-10-17 19:21   ` Robert Dailey
  2018-10-17 19:25     ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Dailey @ 2018-10-17 19:21 UTC (permalink / raw)
  To: peff; +Cc: Git

On Wed, Oct 17, 2018 at 1:47 PM Jeff King <peff@peff.net> wrote:
> Hmm, I feel like another person asked for this recently, but I can't
> seem to find the thread.

Is it this one?
https://www.mail-archive.com/git@vger.kernel.org/msg159212.html

That's the only one I was able to find, but no one replied. Thanks for
your insight. I didn't get my hopes up, but maybe someday it'll be
added.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Sort output of diff --stat?
  2018-10-17 19:21   ` Robert Dailey
@ 2018-10-17 19:25     ` Jeff King
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff King @ 2018-10-17 19:25 UTC (permalink / raw)
  To: Robert Dailey; +Cc: Git

On Wed, Oct 17, 2018 at 02:21:57PM -0500, Robert Dailey wrote:

> On Wed, Oct 17, 2018 at 1:47 PM Jeff King <peff@peff.net> wrote:
> > Hmm, I feel like another person asked for this recently, but I can't
> > seem to find the thread.
> 
> Is it this one?
> https://www.mail-archive.com/git@vger.kernel.org/msg159212.html
> 
> That's the only one I was able to find, but no one replied. Thanks for
> your insight. I didn't get my hopes up, but maybe someday it'll be
> added.

Ah, yeah, that's the one. For some reason I thought I had replied, but
obviously I did not. ;)

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-17 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 18:15 Sort output of diff --stat? Robert Dailey
2018-10-17 18:47 ` Jeff King
2018-10-17 19:21   ` Robert Dailey
2018-10-17 19:25     ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).