git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Corrected return values in prep_for_email;

From
KFKevin P. Fleming <kpfleming@digium.com>
Date
Dec 9, 2010, 15:19 UTC
Message-ID
<4D00F388.5090806@digium.com>
In-Reply-To
<004201cb97a4$6127cc60$23776520$@me.uk>
On 12/09/2010 07:24 AM, Alan Raison wrote:
Show 10 quoted lines
>  From ebe98d1c682f268b39a7eaf3ef529accbf0ac61c Mon Sep 17 00:00:00 2001
> From: Alan Raison<alan@theraisons.me.uk>
> Date: Mon, 6 Dec 2010 15:49:21 +0000
> Subject: [PATCH] Corrected return values in prep_for_email;
>
> Function was returning 0 for failure and 1 for success which was breaking
> the logic in the main loop.
>
> Corrected to return 0 for success, 1 for failure.  Function now also returns
> in all cases, rather than exiting.
Your commit message will need a Signed-Off-By line, but...
Acked-By: Kevin P. Fleming <kpfleming@digium.com>
Show 41 quoted lines
> ---
>   contrib/hooks/post-receive-email |    8 ++++----
>   1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/hooks/post-receive-email
> b/contrib/hooks/post-receive-email
> index 85724bf..f99ea95 100755
> --- a/contrib/hooks/post-receive-email
> +++ b/contrib/hooks/post-receive-email
> @@ -144,13 +144,13 @@ prep_for_email()
>   			short_refname=${refname##refs/remotes/}
>   			echo>&2 "*** Push-update of tracking branch,
> $refname"
>   			echo>&2 "***  - no email generated."
> -			exit 0
> +			return 1
>   			;;
>   		*)
>   			# 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
>   }
>
>   #
-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming@digium.com
Check us out at www.digium.com & www.asterisk.org
Previous: Alan RaisonNext: Alan Raison
Message 7 of 9 in “Corrected return values in post-receive-email.prep_for_email”
  1. Corrected return values in post-receive-email.prep_for_emailAlan Raison, Dec 7, 2010
  2. Thiago FarinaDec 7, 2010
  3. Alan RaisonDec 7, 2010
  4. Junio C HamanoDec 7, 2010
  5. Kevin P. FlemingDec 7, 2010
  6. Corrected return values in prep_for_email;Alan Raison, Dec 9, 2010
  7. Kevin P. FlemingDec 9, 2010
  8. Corrected return values in prep_for_email;Alan Raison, Dec 9, 2010
  9. Junio C HamanoDec 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.