mirror of
https://github.com/git/git
synced 2024-09-13 21:34:42 +00:00
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>
This commit is contained in:
parent
d6cbf2fa7a
commit
1e88f7a277
|
@ -471,7 +471,7 @@ generate_delete_branch_email()
|
||||||
echo " was $oldrev"
|
echo " was $oldrev"
|
||||||
echo ""
|
echo ""
|
||||||
echo $LOGBEGIN
|
echo $LOGBEGIN
|
||||||
git show -s --pretty=oneline $oldrev
|
git diff-tree -s --always --pretty=oneline $oldrev
|
||||||
echo $LOGEND
|
echo $LOGEND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,11 +547,11 @@ generate_atag_email()
|
||||||
# performed on them
|
# performed on them
|
||||||
if [ -n "$prevtag" ]; then
|
if [ -n "$prevtag" ]; then
|
||||||
# Show changes since the previous release
|
# Show changes since the previous release
|
||||||
git rev-list --pretty=short "$prevtag..$newrev" | git shortlog
|
git shortlog "$prevtag..$newrev"
|
||||||
else
|
else
|
||||||
# No previous tag, show all the changes since time
|
# No previous tag, show all the changes since time
|
||||||
# began
|
# began
|
||||||
git rev-list --pretty=short $newrev | git shortlog
|
git shortlog $newrev
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -571,7 +571,7 @@ generate_delete_atag_email()
|
||||||
echo " was $oldrev"
|
echo " was $oldrev"
|
||||||
echo ""
|
echo ""
|
||||||
echo $LOGBEGIN
|
echo $LOGBEGIN
|
||||||
git show -s --pretty=oneline $oldrev
|
git diff-tree -s --always --pretty=oneline $oldrev
|
||||||
echo $LOGEND
|
echo $LOGEND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ generate_general_email()
|
||||||
echo ""
|
echo ""
|
||||||
if [ "$newrev_type" = "commit" ]; then
|
if [ "$newrev_type" = "commit" ]; then
|
||||||
echo $LOGBEGIN
|
echo $LOGBEGIN
|
||||||
git show --no-color --root -s --pretty=medium $newrev
|
git diff-tree -s --always --pretty=medium $newrev
|
||||||
echo $LOGEND
|
echo $LOGEND
|
||||||
else
|
else
|
||||||
# What can we do here? The tag marks an object that is not
|
# What can we do here? The tag marks an object that is not
|
||||||
|
@ -636,7 +636,7 @@ generate_delete_general_email()
|
||||||
echo " was $oldrev"
|
echo " was $oldrev"
|
||||||
echo ""
|
echo ""
|
||||||
echo $LOGBEGIN
|
echo $LOGBEGIN
|
||||||
git show -s --pretty=oneline $oldrev
|
git diff-tree -s --always --pretty=oneline $oldrev
|
||||||
echo $LOGEND
|
echo $LOGEND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue