git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Marc Branchaud <marcnarc@xiplink.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] post-receive-email: allow customizing of subject/intro/footer
Date: Thu, 21 Jan 2010 12:59:29 -0500	[thread overview]
Message-ID: <201001211259.30704.vapier@gentoo.org> (raw)
In-Reply-To: <4B5888C2.60508@xiplink.com>

[-- Attachment #1: Type: Text/Plain, Size: 1497 bytes --]

On Thursday 21 January 2010 12:02:58 Marc Branchaud wrote:
> > +	if [ -n "${emailbodyintro}" ] ; then
> > +		printf '\n%s\n' "${emailbodyintro}"
> > +	fi
> 
> Since the script ensures there's always a value set for emailbodyintro, why
> check for it here?  None of the other uses of the new config items
> (emailsubject and emailfooter) have this kind of check.

the other values dont have newlines added to them implicitly.  if it's empty, 
i dont want to useless newlines at the start of the e-mail.

> > -	The $refname_type, $short_refname has been ${change_type}d
> > -	EOF
> > +	printf '\n%s\n' "The @refname_type@, @short_refname@ has been
> > @change_type@d" +	) | subst_vars
> 
> Any reason why that last printf'd line shouldn't be made part of the
> emailbodyintro?

that could work

> 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.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2010-01-21 17:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19  5:12 [PATCH] post-receive-email: allow customizing of subject/intro/footer Mike Frysinger
2010-01-21 17:02 ` Marc Branchaud
2010-01-21 17:59   ` Mike Frysinger [this message]
2010-01-21 18:18     ` Marc Branchaud
2010-01-21 20:09     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2009-08-23  3:51 Mike Frysinger

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=201001211259.30704.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.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).