From: Junio C Hamano Date: Wed, 03 Aug 2011 18:52:49 GMT Subject: Re: [PATCH] Add option hooks.emaildiff to include full diff in post-receive-email Message-ID: <7vr552ba4e.fsf@alter.siamese.dyndns.org> In-Reply-To: Jon Jensen writes: > - 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