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

Re: [PATCH UI experiment] diffstat: annotate/highlight new or removed files

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2012, 21:03 UTC
Message-ID
<7v626bwir8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1350311749-15447-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 28 quoted lines
> diffstat does not show whether a file is added or deleted. I know
> --summary does. But the problem with --summary is it makes me look for
> information of a file in two places: diffstat and summary. And with a
> commit that adds/removes a lot, showing both --stat --summary can be
> long.
>
> This patch adds "(new)", "(gone)" or "(new mode)" to diffstat, with
> highlight, to easily catch file additions/removals. The extra text is
> chosen to be short enough so that it won't take up too much space for
> path names:
>
>  .gitignore                  |   1 +
>  Makefile                    |   3 +
>  t/t3070-wildmatch.sh (new)  | 188 ++++++++++++++++++++++++
>  t/t3070/wildtest.txt (gone) | 165 ---------------------
>  test-wildmatch.c (new)      |  14 ++
>  wildmatch.c                 |   5 +-
>  6 files changed, 210 insertions(+), 166 deletions(-)
>
> I don't put creation modes in there too because most of the time it
> does not matter much to me and I could look down to --summary for mode
> verification. But we could put "(new+x)" for 0755 and just "(new)" for
> 0644. "(new mode)" then could become "(+x)", "(-x)" or something like
> that.
>
> Coloring is to me an improvement over --summary. Probably the main
> point. Without it, perhaps it's not worth putting extra text to
> diffstat.

It is kind of surprising that you did not choose to paint new in green and gone in red, and rather paint everything in yellow.

I personally think the above in monochrome is fairly easy to read; with coloring, it might become too distracting, though.

Just a nit, "new mode" is too similar to "new". Everything is "new" in the sense that they have "new contents"; it may be better phrased without saying "new" but giving a stress on "changed".

Thanks for a fun patch.  I am not strongly against it.
Previous: Nguyễn Thái Ngọc DuyNext: Nguyen Thai Ngoc Duy
Message 2 of 3 in “diffstat: annotate/highlight new or removed files”
  1. diffstat: annotate/highlight new or removed filesNguyễn Thái Ngọc Duy, Oct 15, 2012
  2. Junio C HamanoOct 15, 2012
  3. Nguyen Thai Ngoc DuyOct 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.