From e9156c3bb674c2423e992c544ae8616a340e8003 Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Fri, 25 Feb 2011 04:56:42 -0600 Subject: [PATCH] Fix the e-mail message to use "git describe" and the commits. * post-receive: Always show the commit messages and the "git describe" output. --- etc/ChangeLog | 5 +++++ etc/post-receive | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 775c3a4a8..a127951fe 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2011-02-25 Teodor Zlatanov + + * post-receive: Always show the commit messages and the "git describe" + output. + 2011-02-18 Teodor Zlatanov * post-receive: Fix $(( bug. Note that the user name and address are diff --git a/etc/post-receive b/etc/post-receive index ebd230ca8..5714dccbf 100755 --- a/etc/post-receive +++ b/etc/post-receive @@ -182,9 +182,13 @@ generate_email() # Email parameters # The email subject will contain the best description of the ref # that we can build from the parameters - describe=$(git describe $rev 2>/dev/null) - if [ -z "$describe" ]; then - describe=$( (git log --format="%s" $oldrev...$newrev | perl -e'@p = <>; chomp @p; print "=", scalar @p, "= ", join(" ; ", @p)') 2>/dev/null) + describe_commit=$( (git log --format="%s" $oldrev...$newrev | perl -e'@p = <>; chomp @p; print "=", scalar @p, "= ", join(" ; ", @p)') 2>/dev/null) + describe_last=$(git describe $rev 2>/dev/null) + + if [ -z "$describe_last" ]; then + describe=$describe_commit + else + describe="$describe_last $describe_commit" fi if [ -z "$describe" ]; then -- 2.25.1