Re: [PATCH] post-receive-email: ensure sent messages are not empty

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

 



"Kevin P. Fleming" <kpfleming@xxxxxxxxxx> writes:

> @@ -687,10 +699,12 @@ 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
> +	prep_for_email $2 $3 $1
> +	PAGER= generate_email
>  else
>  	while read oldrev newrev refname
>  	do
> -		generate_email $oldrev $newrev $refname | send_mail
> +		prep_for_email $oldrev $newrev $refname
> +		generate_email | send_mail
>  	done

As "prep" exits, when this is run as a hook to read many updated refs, any
inappropriate update to one ref will cause messages for later refs from
getting sent out.  Earlier such an update may have sent an empty message
but at least didn't break messages for other refs, if I am reading the
code correctly.  Is that what you really want?

Perhaps you would want to do something like this instead, after adjusting
the exit code from the new "prep" shell function?

	while ...
        do
        	prep_for_email || continue
                generate_email | send_mail
	done

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