From: Pete Harlan <pgit@pcharlan.com>
To: Andy Parkins <andyparkins@gmail.com>, git@vger.kernel.org
Cc: Pete Harlan <pgit@pcharlan.com>
Subject: [PATCH v2 2/2] contrib/hooks/post-receive-email: Make revision display configurable
Date: Mon, 3 Nov 2008 23:19:54 -0800 [thread overview]
Message-ID: <1225783194-24640-3-git-send-email-pgit@pcharlan.com> (raw)
In-Reply-To: <1225783194-24640-2-git-send-email-pgit@pcharlan.com>
In-Reply-To: <7v7i7kthkc.fsf@gitster.siamese.dyndns.org>
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>
---
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 2cd373d..28a3c0e 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
--
1.6.0.3.533.ge0502
prev parent reply other threads:[~2008-11-04 7:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7v7i7kthkc.fsf@gitster.siamese.dyndns.org>
2008-11-04 7:19 ` [PATCH v2 0/2] post-receive-email configurable rev display Pete Harlan
2008-11-04 23:55 ` Junio C Hamano
2008-11-04 7:19 ` [PATCH v2 1/2] contrib/hooks/post-receive-email: Put rev display in separate function Pete Harlan
2008-11-04 7:19 ` Pete Harlan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1225783194-24640-3-git-send-email-pgit@pcharlan.com \
--to=pgit@pcharlan.com \
--cc=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox