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 <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed Aug 2, 2013 at 16:22 UTC 1e88f7a277c4cf96a425ffa66e30177b858bc965
1 file changed +6 -6
contrib/hooks/post-receive-email
+6 -6
@@ -471,7 +471,7 @@ generate_delete_branch_email()
471 echo " was $oldrev"
472 echo ""
473 echo $LOGBEGIN
474 - git show -s --pretty=oneline $oldrev
474 + git diff-tree -s --always --pretty=oneline $oldrev
475 echo $LOGEND
476 }
477
@@ -547,11 +547,11 @@ generate_atag_email()
547 # performed on them
548 if [ -n "$prevtag" ]; then
549 # Show changes since the previous release
550 - git rev-list --pretty=short "$prevtag..$newrev" | git shortlog
550 + git shortlog "$prevtag..$newrev"
551 else
552 # No previous tag, show all the changes since time
553 # began
554 - git rev-list --pretty=short $newrev | git shortlog
554 + git shortlog $newrev
555 fi
556 ;;
557 *)
@@ -571,7 +571,7 @@ generate_delete_atag_email()
571 echo " was $oldrev"
572 echo ""
573 echo $LOGBEGIN
574 - git show -s --pretty=oneline $oldrev
574 + git diff-tree -s --always --pretty=oneline $oldrev
575 echo $LOGEND
576 }
577
@@ -617,7 +617,7 @@ generate_general_email()
617 echo ""
618 if [ "$newrev_type" = "commit" ]; then
619 echo $LOGBEGIN
620 - git show --no-color --root -s --pretty=medium $newrev
620 + git diff-tree -s --always --pretty=medium $newrev
621 echo $LOGEND
622 else
623 # What can we do here? The tag marks an object that is not
@@ -636,7 +636,7 @@ generate_delete_general_email()
636 echo " was $oldrev"
637 echo ""
638 echo $LOGBEGIN
639 - git show -s --pretty=oneline $oldrev
639 + git diff-tree -s --always --pretty=oneline $oldrev
640 echo $LOGEND
641 }
642