git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Dynamic diff summary for merge/pull
@ 2012-01-16  4:47 Nguyễn Thái Ngọc Duy
  2012-01-16  4:47 ` [PATCH 1/5] diff: add space around "=" Nguyễn Thái Ngọc Duy
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2012-01-16  4:47 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Linus Torvalds, Nguyễn Thái Ngọc Duy

On Sat, Jan 14, 2012 at 2:49 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> And what I've *really* wanted is to actually see the diff itself if
> it
> is small. So some kind of "dynamic summary": for one-liners (or
> ten-liners), show the whole diff. For medium-sized changes, show the
> whole diffstat. And for really big changes, show an outline and the
> "768 files changed, 179851 lines added, 7630 lines removed" stats.
>
> IOW, whatever fits in, say, 50 lines or less.

Here's an attempt to do that. The main patch is 4/5 to implement
--dynstat. 5/5 just makes merge/pull pass --dynstat to diff machinery.

--dynstat tries various diff output and use one that fits within 50
lines:

 --patch + --shortstat
 --stat (maybe plus --summary)
 --dirstat + --shortstat
 --shortstat

Many hardcoded constants should be more flexible (i.e. 50 lines limit
could be retrieved from terminal settigns), but that's minor for
now imo. I think we should also hint users to do
"git diff --stat --summary HEAD@{1} HEAD" too via advice framework if
we turn --dynstat to default for merge/pull

I have not run "make test" so it may break a few tests because of 2/2.

Nguyễn Thái Ngọc Duy (5):
  diff: add space around "="
  diff: do not duplicate shortstat with "git diff --stat --shortstat"
  diff: buffer dirstat output
  diff: add --dynstat
  merge: support setting merge.[diff]stat to dynstat

 builtin/merge.c |   30 +++++++++++--
 diff.c          |  127 +++++++++++++++++++++++++++++++++++++++++++++++--------
 diff.h          |    1 +
 3 files changed, 135 insertions(+), 23 deletions(-)

-- 
1.7.3.1.256.g2539c.dirty

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

end of thread, other threads:[~2012-01-16  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-16  4:47 [PATCH 0/5] Dynamic diff summary for merge/pull Nguyễn Thái Ngọc Duy
2012-01-16  4:47 ` [PATCH 1/5] diff: add space around "=" Nguyễn Thái Ngọc Duy
2012-01-16  4:47 ` [PATCH 2/5] diff: do not duplicate shortstat with "git diff --stat --shortstat" Nguyễn Thái Ngọc Duy
2012-01-16  4:47 ` [PATCH 3/5] diff: buffer dirstat output Nguyễn Thái Ngọc Duy
2012-01-16  4:48 ` [PATCH 4/5] diff: add --dynstat Nguyễn Thái Ngọc Duy
2012-01-16  4:48 ` [PATCH 5/5] merge: support setting merge.[diff]stat to dynstat Nguyễn Thái Ngọc Duy

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).