Re: [PATCH] post-receive-email: allow customizing of subject/intro/footer
- From
Marc Branchaud <marcnarc@xiplink.com>
- Date
- Jan 21, 2010, 18:18 UTC
- Message-ID
- <4B589A87.2090808@xiplink.com>
- In-Reply-To
- <201001211259.30704.vapier@gentoo.org>
Mike Frysinger wrote:
Show 26 quoted lines
> On Thursday 21 January 2010 12:02:58 Marc Branchaud wrote:
>>
>> So, overall, why not make generate_email_header() be simply:
>>
>> generate_email_header()
>> {
>> # --- Email (all stdout will be the email)
>> # Generate header
>> subst_vars <<-EOF
>> To: $recipients
>> Subject: ${emailprefix}${emailsubject}
>> X-Git-Refname: @refname@
>> X-Git-Reftype: @refname_type@
>> X-Git-Oldrev: @oldrev@
>> X-Git-Newrev: @newrev@
>>
>> ${emailbodyintro}
>>
>> EOF
>> }
>>
>> This would also let you simply subst_vars() so that it needn't support
>> piped invocations, no? (Not a very drastic simplification, but still...)
>
> if emailbodyintro is empty, this adds two useless newlines. otherwise, this
> would be fine i think.Personally, I can live with that limitation. I think it's unlikely that anyone will want to get rid of the intro entirely, though maybe that's just me.
One alternative is to remove the newline after ${emailbodyintro}, but I think most users will want the newline after the intro and that it's too easy to forget to put it there when editing the setting.
Anyway, I don't have a strong opinion on the newline question. The main change I'd like to see is including that last intro line in emailbodyintro instead of hardwiring it into the code.
M.