Fix the e-mail message to use "git describe" and the commits.
authorTed Zlatanov <tzz@lifelogs.com>
Fri, 25 Feb 2011 10:56:42 +0000 (04:56 -0600)
committerTed Zlatanov <tzz@lifelogs.com>
Fri, 25 Feb 2011 10:56:42 +0000 (04:56 -0600)
* post-receive: Always show the commit messages and the "git describe"
output.

etc/ChangeLog
etc/post-receive

index 775c3a4..a127951 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-25  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * post-receive: Always show the commit messages and the "git describe"
+       output.
+
 2011-02-18  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * post-receive: Fix $(( bug.  Note that the user name and address are
index ebd230c..5714dcc 100755 (executable)
@@ -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