git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/5] Dynamic diff summary for merge/pull

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Jan 16, 2012, 04:47 UTC
Message-ID
<1326689281-23788-1-git-send-email-pclouds@gmail.com>

On Sat, Jan 14, 2012 at 2:49 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:

Show 8 quoted lines
> 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
Next: Nguyễn Thái Ngọc Duy
Message 1 of 6 in “Dynamic diff summary for merge/pull”
  1. 0/5 Dynamic diff summary for merge/pullNguyễn Thái Ngọc Duy, Jan 16, 2012
  2. 1/5 diff: add space around "="Nguyễn Thái Ngọc Duy, Jan 16, 2012
  3. 2/5 diff: do not duplicate shortstat with "git diff --stat --shortstat"Nguyễn Thái Ngọc Duy, Jan 16, 2012
  4. 3/5 diff: buffer dirstat outputNguyễn Thái Ngọc Duy, Jan 16, 2012
  5. 4/5 diff: add --dynstatNguyễn Thái Ngọc Duy, Jan 16, 2012
  6. 5/5 merge: support setting merge.[diff]stat to dynstatNguyễn Thái Ngọc Duy, Jan 16, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.