From: Andy Parkins Date: Tue, 13 Feb 2007 14:24:06 +0000 (+0000) Subject: Only show log entries for new revisions in hooks--update X-Git-Tag: v1.5.1-rc1~295 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=44478d99ee0b2c219a733545efe0cb422658bf60;p=git.git Only show log entries for new revisions in hooks--update If you were issuing emails for two branches, and one merged the other, you would get the same log messages appearing in two separate emails. e.g. A working repository, where the last push to central was done at the revision marked "B", after which two branches were developed further. * -- B -- 1 -- 1 -- M (branch1) \ / 2 -- 2 -- 2 (branch2) Now imagine that branch2 is pushed to the email-generating repository; an email containing all the "2" revisions would be sent. Now, let's say branch1 is pushed, the old update hook would run git-rev-list $newrev ^$baserev Where $newrev would be "M" and $baserev would be "B". This list includes all the "2" revisions as well as all the "1" revisions. This patch addresses this problem by using git-rev-parse --not --all | git-rev-list --stdin $newrev ^$baserev To inhibit the display of all revisions that are already in the repository. Signed-off-by: Andy Parkins Signed-off-by: Junio C Hamano --- diff --git a/templates/hooks--update b/templates/hooks--update index e8c536fb6..a7cf604dd 100644 --- a/templates/hooks--update +++ b/templates/hooks--update @@ -190,7 +190,8 @@ case "$refname_type" in fi echo "" echo $LOGBEGIN - git-rev-list --pretty $newrev ^$baserev + git-rev-parse --not --all | + git-rev-list --stdin --pretty $newrev ^$baserev echo $LOGEND echo "" echo "Diffstat:"