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