From: "Alan Raison" <alan@theraisons.me.uk>
To: "'Thiago Farina'" <tfransosi@gmail.com>
Cc: <git@vger.kernel.org>
Subject: RE: [PATCH] Corrected return values in post-receive-email.prep_for_email
Date: Tue, 7 Dec 2010 17:10:04 -0000 [thread overview]
Message-ID: <002c01cb9631$972d6690$c58833b0$@me.uk> (raw)
In-Reply-To: <AANLkTikYnDNRPVd-wd4+3jsX2fBbjxODEGATN5dD7t1E@mail.gmail.com>
In the main loop (lines 734 and 738 in the current master) the && and || operations assume true==0 and false==1; in line with shell defaults.
I tested it on a sourceforge shell (I think using Bash); error conditions reported an error to standard error, then proceeded to generate the email; if prep_for_email succeeded then no mail was sent.
HTH
Alan
-----Original Message-----
From: Thiago Farina [mailto:tfransosi@gmail.com]
Sent: 07 December 2010 16:50
To: Alan Raison
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Corrected return values in post-receive-email.prep_for_email
Care to explain in the change log message why the return value should
be 1 instead of 0?
On Tue, Dec 7, 2010 at 2:32 PM, Alan Raison <alan@theraisons.me.uk> wrote:
> ---
> contrib/hooks/post-receive-email | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/contrib/hooks/post-receive-email
> b/contrib/hooks/post-receive-email
> index 85724bf..020536d 100755
> --- a/contrib/hooks/post-receive-email
> +++ b/contrib/hooks/post-receive-email
> @@ -150,7 +150,7 @@ prep_for_email()
> # Anything else (is there anything else?)
> echo >&2 "*** Unknown type of update to $refname
> ($rev_type)"
> echo >&2 "*** - no email generated"
> - return 0
> + return 1
> ;;
> esac
>
> @@ -166,10 +166,10 @@ prep_for_email()
> esac
> echo >&2 "*** $config_name is not set so no email will be
> sent"
> echo >&2 "*** for $refname update $oldrev->$newrev"
> - return 0
> + return 1
> fi
>
> - return 1
> + return 0
> }
>
> #
> --
> 1.7.3.1.msysgit.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2010-12-07 17:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 16:32 [PATCH] Corrected return values in post-receive-email.prep_for_email Alan Raison
2010-12-07 16:50 ` Thiago Farina
2010-12-07 17:10 ` Alan Raison [this message]
2010-12-07 19:34 ` Junio C Hamano
2010-12-07 19:44 ` Kevin P. Fleming
2010-12-09 13:24 ` [PATCH] Corrected return values in prep_for_email; Alan Raison
2010-12-09 15:19 ` Kevin P. Fleming
2010-12-09 16:03 ` Alan Raison
2010-12-09 17:38 ` Junio C Hamano
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='002c01cb9631$972d6690$c58833b0$@me.uk' \
--to=alan@theraisons.me.uk \
--cc=git@vger.kernel.org \
--cc=tfransosi@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).