Re: [PATCH] Corrected return values in post-receive-email.prep_for_email

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Alan Raison" <alan@xxxxxxxxxxxxxxxx> writes:

> ---
>  contrib/hooks/post-receive-email |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

No sign-off, no description.

This is a regression introduced by 53cad69 (post-receive-email: ensure
sent messages are not empty, 2010-09-10), I think.

> 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

This used to "exit 1" before 53cad69 and I agree with the patch that
signalling error with "return 1" is the right thing to do here.

>  			;;
>  	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

This used to "exit 0" before 53cad69 to cause the program stop before
sending mails.  Again, I agree with the patch that signalling error is the
right thing to do here.

>  	fi
>  
> -	return 1
> +	return 0

And this obviously is correct.

Kevin, care to review and Ack?  Alan, care to add a few lines of patch
description and sign-off?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]