* [PATCH] post-receive-email hook: handle order of arguments consistently
@ 2007-06-14 9:09 Gerrit Pape
2007-06-14 10:19 ` Andy Parkins
0 siblings, 1 reply; 4+ messages in thread
From: Gerrit Pape @ 2007-06-14 9:09 UTC (permalink / raw)
To: Junio C Hamano, git; +Cc: 428413
The post-receive-email hook usually gets its arguments through stdin, but
also supports them to be specified at the command line. The order of the
arguments should consistently follow the documentation no matter how they
are passed to the script.
This was noticed and suggested by martin f krafft through
http://bugs.debian.org/428413
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
contrib/hooks/post-receive-email | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index c589a39..f84532f 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -605,7 +605,7 @@ envelopesender=$(git-repo-config hooks.envelopesender)
if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
# Output to the terminal in command line mode - if someone wanted to
# resend an email; they could redirect the output to sendmail themselves
- PAGER= generate_email $2 $3 $1
+ PAGER= generate_email $1 $2 $3
else
if [ -n "$envelopesender" ]; then
envelopesender="-f '$envelopesender'"
--
1.5.2.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] post-receive-email hook: handle order of arguments consistently
2007-06-14 9:09 [PATCH] post-receive-email hook: handle order of arguments consistently Gerrit Pape
@ 2007-06-14 10:19 ` Andy Parkins
2007-08-07 13:58 ` Gerrit Pape
0 siblings, 1 reply; 4+ messages in thread
From: Andy Parkins @ 2007-06-14 10:19 UTC (permalink / raw)
To: git; +Cc: Gerrit Pape, Junio C Hamano, 428413
On Thursday 2007 June 14, Gerrit Pape wrote:
> The post-receive-email hook usually gets its arguments through stdin, but
> also supports them to be specified at the command line. The order of the
> arguments should consistently follow the documentation no matter how they
> are passed to the script.
That wasn't done casually. It was done so that the same script would work as
an update hook as well.
I have no objection to the change, as the update hook was not the right place
for generating emails. However, it let me use that same update hook on a
system that did not have a git with support for the post-receive hook.
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] post-receive-email hook: handle order of arguments consistently
2007-06-14 10:19 ` Andy Parkins
@ 2007-08-07 13:58 ` Gerrit Pape
2007-08-07 17:38 ` Andy Parkins
0 siblings, 1 reply; 4+ messages in thread
From: Gerrit Pape @ 2007-08-07 13:58 UTC (permalink / raw)
To: git, Junio C Hamano
The post-receive-email hook usually gets its arguments through stdin,
but also supports them to be specified at the command line. The order
of the arguments should consistently follow the documentation no matter
how they are passed to the script.
This was noticed and suggested by martin f krafft through
http://bugs.debian.org/428413
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
On Thu, Jun 14, 2007 at 11:19:17AM +0100, Andy Parkins wrote:
> On Thursday 2007 June 14, Gerrit Pape wrote:
> > The post-receive-email hook usually gets its arguments through stdin, but
> > also supports them to be specified at the command line. The order of the
> > arguments should consistently follow the documentation no matter how they
> > are passed to the script.
>
> That wasn't done casually. It was done so that the same script would work as
> an update hook as well.
>
> I have no objection to the change, as the update hook was not the right place
> for generating emails. However, it let me use that same update hook on a
> system that did not have a git with support for the post-receive hook.
Hi, I suggest to apply this patch for 1.5.3. Thanks, Gerrit.
contrib/hooks/post-receive-email | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index c589a39..f84532f 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -605,7 +605,7 @@ envelopesender=$(git-repo-config hooks.envelopesender)
if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
# Output to the terminal in command line mode - if someone wanted to
# resend an email; they could redirect the output to sendmail themselves
- PAGER= generate_email $2 $3 $1
+ PAGER= generate_email $1 $2 $3
else
if [ -n "$envelopesender" ]; then
envelopesender="-f '$envelopesender'"
--
1.5.3.GIT
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] post-receive-email hook: handle order of arguments consistently
2007-08-07 13:58 ` Gerrit Pape
@ 2007-08-07 17:38 ` Andy Parkins
0 siblings, 0 replies; 4+ messages in thread
From: Andy Parkins @ 2007-08-07 17:38 UTC (permalink / raw)
To: git; +Cc: Gerrit Pape, Junio C Hamano
On Tuesday 2007, August 07, Gerrit Pape wrote:
> The post-receive-email hook usually gets its arguments through stdin,
> but also supports them to be specified at the command line. The order
> of the arguments should consistently follow the documentation no matter
> how they are passed to the script.
As I said the last time this was posted, this was done on purpose so that
the command line arguments match the order of the arguments to the update
hook.
Keeping them in that order allows the script to be used as an update hook in
older versions of git.
Whether that is sensible or not is for Junio and the gang to decide; but
there was good reason for doing it that way. Also, I'm not sure what
documentation you're talking about - use in command line mode is a bonus
feature anyway, it's not necessary in normal hook mode anyway. If you're
going to be strict about matching documentation then the command line mode
should be removed.
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-07 17:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-14 9:09 [PATCH] post-receive-email hook: handle order of arguments consistently Gerrit Pape
2007-06-14 10:19 ` Andy Parkins
2007-08-07 13:58 ` Gerrit Pape
2007-08-07 17:38 ` Andy Parkins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).