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

Re: [PATCH] Add option hooks.emaildiff to include full diff in post-receive-email

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 3, 2011, 18:52 UTC
Message-ID
<7vr552ba4e.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.DEB.2.02.1108022132230.3386@ybpnyubfg6.ybpnyqbznva6>
Jon Jensen <jon@endpoint.com> writes:
Show 9 quoted lines
> -	echo "Summary of changes:"
> -	git diff-tree --stat --summary --find-copies-harder $oldrev..$newrev
> +	if [ -n "$emaildiff" ]; then
> +		echo "Summary of changes and diff:"
> +		git diff-tree --stat --summary --find-copies-harder -p $oldrev..$newrev
> +	else
> +		echo "Summary of changes:"
> +		git diff-tree --stat --summary --find-copies-harder $oldrev..$newrev
> +	fi

Depending on the project, people may want to customize other aspects of the summary generation, e.g. rejecting the overhead of -f-c-h.

Why not do it like this intead?
	diffopts=$(git config hooks.diffopts)
	: ${diffopts:="--stat --summary --find-copies-harder"}
        
	echo "Summary of changes:"
        git diff-tree $diffopts $oldrev..$newrev
Previous: Jon JensenNext: Jon Jensen
Message 2 of 3 in “Add option hooks.emaildiff to include full diff in post-receive-email”
  1. Add option hooks.emaildiff to include full diff in post-receive-emailJon Jensen, Aug 3, 2011
  2. Junio C HamanoAug 3, 2011
  3. Add option hooks.diffopts to customize change summary in post-receive-emailJon Jensen, Aug 4, 2011

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.