All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] make git-send-email.perl handle email addresses with no names when Email::Valid is present
Date: Thu, 12 Jul 2007 23:34:14 -0700	[thread overview]
Message-ID: <20070713063414.GN24317@kroah.com> (raw)
In-Reply-To: <7vr6ncrh22.fsf@assigned-by-dhcp.cox.net>

On Thu, Jul 12, 2007 at 10:47:17PM -0700, Junio C Hamano wrote:
> Greg KH <greg@kroah.com> writes:
> 
> > When using git-send-email.perl on a changeset that has:
> > 	Cc: <stable@kernel.org>
> > in the body of the description, and the Email::Valid perl module is
> > installed on the system, the email address will be deemed "invalid" for
> > some reason (Email::Valid isn't smart enough to handle this?) and
> > complain and not send the address the email.
> 
> That appears to be the case.
> 
>         bad foo
>         bad <foo@bar.baz>
>         ok  foo@bar.baz
>         ok  Foo <foo@bar.baz>
> 
> > Anyway, this tiny patch fixes this problem for me.  Note, my perl-foo is
> > quite week, so this could probably be easily done in one line for those
> > with better reg-ex skills.
> 
> > --- a/git-send-email.perl
> > +++ b/git-send-email.perl
> > @@ -410,6 +410,9 @@ sub extract_valid_address {
> >  	return $address if ($address =~ /^($local_part_regexp)$/);
> >  
> >  	if ($have_email_valid) {
> > +		if ($address =~ s/^<//) {
> > +			$address =~ s/>$//;
> > +		}
> >  		return scalar Email::Valid->address($address);
> >  	} else {
> 
> I'd probably do:
> 
> 	if ($have_email_valid) {
> 		$address =~ s/^<(.*)>$/$1/;

Ah, yeah, that looks better :)

Thanks for the fix,

greg k-h

  reply	other threads:[~2007-07-13  6:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13  4:17 [PATCH] make git-send-email.perl handle email addresses with no names when Email::Valid is present Greg KH
2007-07-13  5:47 ` Junio C Hamano
2007-07-13  6:34   ` Greg KH [this message]
2007-07-13  8:28     ` Stephen Rothwell
2007-07-14  4:00       ` Greg KH
2007-07-14 10:38         ` Stephen Rothwell
2007-08-09 12:28 ` Uwe Kleine-König

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=20070713063414.GN24317@kroah.com \
    --to=greg@kroah.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.