Skip to contentSkip to conversation

post-receive-email: hooks.showrev: show how to include both web link and patch

PATCH New Jim Meyering 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 post-receive-email: hooks.showrev: show how to include both web link and patch

Add a comment showing how to include a web link (i.e. gitweb/cgit) and a patch in the email that is sent for each pushed commit.
---
The quoting was tricky enough that it's worth documenting. At first I wanted to put \n\n in the printf, but to do so would have meant using \\\\n\\\\n, and in the end, the pair of "echo" statements seemed better.

FYI, I did this for glibc.git:
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=summary

push-triggered messages have been sent to this list since May 21:
http://sourceware.org/ml/glibc-cvs/2009-q2/

 contrib/hooks/post-receive-email |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 contrib/hooks/post-receive-email
contrib/hooks/post-receive-email +4 -0
old mode 100644
new mode 100755
index 60cbab6..2a66063
@@ -44,6 +44,10 @@
 #   --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".
+#   To list a gitweb/cgit URL *and* a full patch for each change set, use this:
+#     "t=%s; printf 'http://.../?id=%%s' \$t; echo;echo; git show -C \$t; echo"
+#   Be careful if "..." contains things that will be expanded by shell "eval"
+#   or printf.
 #
 # Notes
 # -----

--
1.6.3.1.208.gf0011