Skip to content

Commit

Permalink
Only show log entries for new revisions in hooks--update
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Parkins authored and Junio C Hamano committed Feb 14, 2007
1 parent 870b39c commit 44478d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/hooks--update
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit 44478d9

Please sign in to comment.