Skip to content

Commit 1e88f7a

Browse files
jrngitster
authored andcommitted
hooks/post-receive-email: use plumbing instead of git log/show
This way the hook doesn't have to keep being tweaked as porcelain learns new features like color and pagination. While at it, replace the "git rev-list | git shortlog" idiom with plain "git shortlog" for simplicity. Except for depending less on the value of settings like '[log] abbrevCommit', no change in output intended. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d6cbf2f commit 1e88f7a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

contrib/hooks/post-receive-email

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ generate_delete_branch_email()
471471
echo " was $oldrev"
472472
echo ""
473473
echo $LOGBEGIN
474-
git show -s --pretty=oneline $oldrev
474+
git diff-tree -s --always --pretty=oneline $oldrev
475475
echo $LOGEND
476476
}
477477

@@ -547,11 +547,11 @@ generate_atag_email()
547547
# performed on them
548548
if [ -n "$prevtag" ]; then
549549
# Show changes since the previous release
550-
git rev-list --pretty=short "$prevtag..$newrev" | git shortlog
550+
git shortlog "$prevtag..$newrev"
551551
else
552552
# No previous tag, show all the changes since time
553553
# began
554-
git rev-list --pretty=short $newrev | git shortlog
554+
git shortlog $newrev
555555
fi
556556
;;
557557
*)
@@ -571,7 +571,7 @@ generate_delete_atag_email()
571571
echo " was $oldrev"
572572
echo ""
573573
echo $LOGBEGIN
574-
git show -s --pretty=oneline $oldrev
574+
git diff-tree -s --always --pretty=oneline $oldrev
575575
echo $LOGEND
576576
}
577577

@@ -617,7 +617,7 @@ generate_general_email()
617617
echo ""
618618
if [ "$newrev_type" = "commit" ]; then
619619
echo $LOGBEGIN
620-
git show --no-color --root -s --pretty=medium $newrev
620+
git diff-tree -s --always --pretty=medium $newrev
621621
echo $LOGEND
622622
else
623623
# What can we do here? The tag marks an object that is not
@@ -636,7 +636,7 @@ generate_delete_general_email()
636636
echo " was $oldrev"
637637
echo ""
638638
echo $LOGBEGIN
639-
git show -s --pretty=oneline $oldrev
639+
git diff-tree -s --always --pretty=oneline $oldrev
640640
echo $LOGEND
641641
}
642642

0 commit comments

Comments
 (0)