Only show log entries for new revisions in hooks--update
commit44478d99ee0b2c219a733545efe0cb422658bf60
authorAndy Parkins <andyparkins@gmail.com>
Tue, 13 Feb 2007 14:24:06 +0000 (13 14:24 +0000)
committerJunio C Hamano <junkio@cox.net>
Wed, 14 Feb 2007 05:40:24 +0000 (13 21:40 -0800)
treee316904a43217d35ad3ce58d5e6cbb16f670d71d
parent870b39c15fd084d4db977298b3d3af645b57d083
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 <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
templates/hooks--update