git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 0/5] Dynamic diff summary for merge/pull
Date: Mon, 16 Jan 2012 11:47:56 +0700	[thread overview]
Message-ID: <1326689281-23788-1-git-send-email-pclouds@gmail.com> (raw)

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

             reply	other threads:[~2012-01-16  4:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  4:47 Nguyễn Thái Ngọc Duy [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326689281-23788-1-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).