diff options
author | Pete Harlan <pgit@pcharlan.com> | 2008-11-03 23:19:54 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-04 14:43:16 -0800 |
commit | b0a7d111732f644623253927c9ef2d4f3009e668 (patch) | |
tree | 6f1baedc1486b3e5cdf00c926cf8b77cbbaf5dfc | |
parent | 4471649f44d7a8e4b7b927e43b848bb71b75630d (diff) | |
download | git-b0a7d111732f644623253927c9ef2d4f3009e668.tar.gz |
contrib/hooks/post-receive-email: Make revision display configurable
Add configuration option hooks.showrev, letting the user override how
revisions will be shown in the commit email.
Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | contrib/hooks/post-receive-email | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index 2cd373d625..28a3c0e46e 100644 --- a/contrib/hooks/post-receive-email +++ b/contrib/hooks/post-receive-email @@ -38,6 +38,12 @@ # hooks.emailprefix # All emails have their subjects prefixed with this prefix, or "[SCM]" # if emailprefix is unset, to aid filtering +# hooks.showrev +# The shell command used to format each revision in the email, with +# "%s" replaced with the commit id. Defaults to "git rev-list -1 +# --pretty %s", displaying the commit id, author, date and log +# message. To list full patches separated by a blank line, you +# could set this to "git show -C %s; echo". # # Notes # ----- @@ -610,7 +616,16 @@ show_new_revisions() fi git rev-parse --not --branches | grep -v $(git rev-parse $refname) | - git rev-list --pretty --stdin $revspec + if [ -z "$custom_showrev" ] + then + git rev-list --pretty --stdin $revspec + else + git rev-list --stdin $revspec | + while read onerev + do + eval $(printf "$custom_showrev" $onerev) + done + fi } @@ -650,6 +665,7 @@ recipients=$(git config hooks.mailinglist) announcerecipients=$(git config hooks.announcelist) envelopesender=$(git config hooks.envelopesender) emailprefix=$(git config hooks.emailprefix || echo '[SCM] ') +custom_showrev=$(git config hooks.showrev) # --- Main loop # Allow dual mode: run from the command line just like the update hook, or |