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

Re: [PATCH] Add a configuration option to control diffstat after merge

From
Junio C Hamano <junkio@cox.net>
Date
May 23, 2007, 20:18 UTC
Message-ID
<7v646j2t1e.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070523200223.GB2554@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 12 quoted lines
> The diffstat can be controlled either with command-line options
> (--summary|--no-summary) or with merge.diffstat. The default is
> left as it was: diffstat is active by default.
>
> Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
> ---
>
> I have to explain the implementation a bit: in Windows, every exec is
> *very* expensive, so I tried to avoid a call to git-config as long as
> possible. The stupid OS is my reason for this change, actually:
> diffstat not just takes too long. It also takes a *long* while before
> the diffstat even starts!

Even on Linux, if your project is well modularized and your workflow is "merge small and merge often" like the kernel is, it is not unusual that the final diffstat takes much longer than a merge. But the diffstat is not an eye-candy but is an important safety measure from the workflow point of view.

Show 8 quoted lines
> @@ -168,6 +169,11 @@ do
>  	shift
>  done
>  
> +if test -z "$show_diffstat"; then
> +    test "$(git-config merge.diffstat)" = false && show_diffstat=false
> +    test -z "$show_diffstat" && show_diffstat=t
> +fi
Isn't this hunk wrong?
[merge]
	diffstat = 0
        diffstat = false

should both mean "merge.diffstat is set to false". "git config --bool" does that.

And when merge.diffstat does not appear in the configuration file, "git config --bool merge.diffstat" exits non-zero.

if test -z "$show_diffstat"; then
    test "$(git-config --bool merge.diffstat)" = false && show_diffstat=false
    test -z "$show_diffstat" && show_diffstat=t
fi
Previous: Alex RiesenNext: Alex Riesen
Message 6 of 9 in “disable merge summaries if they are disabled”
  1. disable merge summaries if they are disabledAlex Riesen, May 23, 2007
  2. Alex RiesenMay 23, 2007
  3. Junio C HamanoMay 23, 2007
  4. Alex RiesenMay 23, 2007
  5. Add a configuration option to control diffstat after mergeAlex Riesen, May 23, 2007
  6. Junio C HamanoMay 23, 2007
  7. Alex RiesenMay 23, 2007
  8. Add a configuration option to control diffstat after mergeAlex Riesen, May 23, 2007
  9. Junio C HamanoMay 23, 2007

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.