Skip to contentSkip to conversation

Bug#428413: commit mail sender messes up order of arguments

PATCH Jonathan Nieder 1 participant 1 message Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

tags 428413 - wontfix
reassign 428413 git git-core/1:1.5.2.1-1
found 428413 git/1:1.7.1-1
quit

Quoted 5 lines · martin f krafft

According to the default hooks/post-receive file, the hook is called with three arguments on stdin:

<oldrev> <newrev> <refname>

Quoted 7 lines

This leads people to assume that in command-line mode, the order should be the same. But it's not, because the email hook instead calls:

generate_email $2 $3 $1

this is at least misleading and not documented anywhere.

So maybe we should document it.

I haven’t checked that the below is actually true; I just took the commit message to v1.5.1~9 and paraphrased it. Thoughts?

---
 contrib/hooks/post-receive-email |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
contrib/hooks/post-receive-email +7 -0
index 58a35c8..30ae63d 100755
@@ -23,6 +23,13 @@
 # possible for the email to be from someone other than the person doing the
 # push.
 #
+# To help with debugging and use on pre-v1.5.1 git servers, this script will
+# also obey the interface of hooks/update, taking its arguments on the
+# command line.  Unfortunately, hooks/update is called once for each ref.
+# To avoid firing one email per ref, this script just prints its output to
+# the screen when used in this mode.  The output can then be redirected if
+# wanted.
+#
 # Config
 # ------
 # hooks.mailinglist
Signature · 8 lines
1.7.1




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]