Skip to content

Commit 44478d9

Browse files
andyparkinsJunio C Hamano
authored andcommitted
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>
1 parent 870b39c commit 44478d9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

templates/hooks--update

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ case "$refname_type" in
190190
fi
191191
echo ""
192192
echo $LOGBEGIN
193-
git-rev-list --pretty $newrev ^$baserev
193+
git-rev-parse --not --all |
194+
git-rev-list --stdin --pretty $newrev ^$baserev
194195
echo $LOGEND
195196
echo ""
196197
echo "Diffstat:"

0 commit comments

Comments
 (0)