Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-20 Thread Felipe Contreras
On Tue, Nov 20, 2012 at 8:56 AM, Krzysztof Mazur krzys...@podlesie.net wrote:

 --- a/git-send-email.perl
 +++ b/git-send-email.perl
 @@ -925,8 +925,11 @@ sub quote_subject {
  sub sanitize_address {
 my ($recipient) = @_;

 +   my $local_part_regexp = qr/[^\s@]+/;
 +   my $domain_regexp = qr/[^.\s@]+(?:\.[^.\s@]+)+/;
 +
 # remove garbage after email address
 -   $recipient =~ s/(.*).*$/$1/;
 +   $recipient =~ s/^(.*?$local_part_regexp\@$domain_regexp).*/$1/;

I don't think all that extra complexity is warranted, to me
s/(.*?)(.*)$/$1/ is just fine.

Cheers.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-20 Thread Andreas Ericsson
On 11/20/2012 11:28 AM, Felipe Contreras wrote:
 On Tue, Nov 20, 2012 at 8:56 AM, Krzysztof Mazur krzys...@podlesie.net 
 wrote:
 
 --- a/git-send-email.perl
 +++ b/git-send-email.perl
 @@ -925,8 +925,11 @@ sub quote_subject {
   sub sanitize_address {
  my ($recipient) = @_;

 +   my $local_part_regexp = qr/[^\s@]+/;
 +   my $domain_regexp = qr/[^.\s@]+(?:\.[^.\s@]+)+/;
 +
  # remove garbage after email address
 -   $recipient =~ s/(.*).*$/$1/;
 +   $recipient =~ s/^(.*?$local_part_regexp\@$domain_regexp).*/$1/;
 
 I don't think all that extra complexity is warranted, to me
 s/(.*?)(.*)$/$1/ is just fine.
 

It's intentionally left without the at-sign so one can send mail to a
local account as well as remote ones. Very nifty when debugging, and
when one wants to preview outgoing emails.

-- 
Andreas Ericsson   andreas.erics...@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-20 Thread Krzysztof Mazur
On Tue, Nov 20, 2012 at 11:28:39AM +0100, Felipe Contreras wrote:
 On Tue, Nov 20, 2012 at 8:56 AM, Krzysztof Mazur krzys...@podlesie.net 
 wrote:
 
  --- a/git-send-email.perl
  +++ b/git-send-email.perl
  @@ -925,8 +925,11 @@ sub quote_subject {
   sub sanitize_address {
  my ($recipient) = @_;
 
  +   my $local_part_regexp = qr/[^\s@]+/;
  +   my $domain_regexp = qr/[^.\s@]+(?:\.[^.\s@]+)+/;
  +
  # remove garbage after email address
  -   $recipient =~ s/(.*).*$/$1/;
  +   $recipient =~ s/^(.*?$local_part_regexp\@$domain_regexp).*/$1/;
 
 I don't think all that extra complexity is warranted, to me
 s/(.*?)(.*)$/$1/ is just fine.
 

Yeah, it's a little bit too complex, but s/(.*?)(.*)$/$1/
causes small regression - '' character is no longer allowed
in phrase before email address. Maybe the initial version,
that removes everything after last '' is better? In this case ''
is not allowed in garbage after email.

Krzysiek
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-20 Thread Krzysztof Mazur
On Tue, Nov 20, 2012 at 08:58:20PM +0100, Andreas Schwab wrote:
 How about s/(.*?[^]*).*$/$1/?  That will still fail on foo@bar
 foo@bar, but you'll need a full rfc822 parser to handle the general
 case anyway.

That will fail also on something foo@bar.


I think it's good compromise between complexity and correctness.

Felipe, may you check, it again? This time the change is trivial.

Andreas, may I add you in Thanks-to?

Thanks,

Krzysiek

-- 8 --
Subject: [PATCH] git-send-email: remove garbage after email address

In some cases it's very useful to add some additional information
after email in Cc-list, for instance:

Cc: Stable kernel sta...@vger.kernel.org #v3.4 v3.5 v3.6

Currently the git refuses to add such invalid email to Cc-list,
when the Email::Valid perl module is available or just uses whole line
as the email address.

Now in sanitize_address() everything after the email address is
removed, so the resulting line is correct email address and Email::Valid
validates it correctly.

To avoid unnecessary complexity this code assumes that in phrase before
email address 'something' never exists.

Signed-off-by: Krzysztof Mazur krzys...@podlesie.net
---
 git-send-email.perl | 4 
 1 file changed, 4 insertions(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index 5a7c29d..157eabc 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -924,6 +924,10 @@ sub quote_subject {
 # use the simplest quoting being able to handle the recipient
 sub sanitize_address {
my ($recipient) = @_;
+
+   # remove garbage after email address
+   $recipient =~ s/(.*?[^]*).*$/$1/;
+
my ($recipient_name, $recipient_addr) = ($recipient =~ 
/^(.*?)\s*(.*)/);
 
if (not $recipient_name) {
-- 
1.8.0.283.gc57d856

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Felipe Balbi
Hi guys,

for whatever reason my git has started acting up with
sta...@vger.kernel.org addresses. It doesn't manage to extract a valid
adress from the string:

 Cc: sta...@vger.kernel.org # v3.4 v3.5 v3.6

Removing the comment at the end of the line makes things work again. I
do remember, however, seeing this working since few weeks back I sent a
mail to stable (in fact the same one I'm using to test), so this could
be related to some perl updates, who knows ?!?

Anyway, here's output of git-send-email:

 $ git send-email --to linux-...@vger.kernel.org 
 ../linux/0001-usb-dwc3-gadget-fix-endpoint-always-busy-bug.diff --dry-run
 ../linux/0001-usb-dwc3-gadget-fix-endpoint-always-busy-bug.diff
 (mbox) Adding cc: Felipe Balbi ba...@ti.com from line 'From: Felipe Balbi 
 ba...@ti.com'
 (body) Adding cc: sta...@vger.kernel.org #v3.4 v3.5 v3.6 from line 'Cc: 
 sta...@vger.kernel.org #v3.4 v3.5 v3.6'
 (body) Adding cc: Felipe Balbi ba...@ti.com from line 'Signed-off-by: 
 Felipe Balbi ba...@ti.com'
 Use of uninitialized value $cc in string eq at 
 /usr/libexec/git-core/git-send-email line 997.
 Use of uninitialized value $cc in quotemeta at 
 /usr/libexec/git-core/git-send-email line 997.
 W: unable to extract a valid address from: sta...@vger.kernel.org #v3.4 
 v3.5 v3.6
 W: unable to extract a valid address from: sta...@vger.kernel.org #v3.4 
 v3.5 v3.6
 Dry-OK. Log says:
 Sendmail: /usr/bin/msmtp -i linux-...@vger.kernel.org ba...@ti.com
 From: Felipe Balbi ba...@ti.com
 To: linux-...@vger.kernel.org
 Cc: Felipe Balbi ba...@ti.com
 Subject: [PATCH] usb: dwc3: gadget: fix 'endpoint always busy' bug
 Date: Mon, 19 Nov 2012 11:54:16 +0200
 Message-Id: 1353318856-14987-1-git-send-email-ba...@ti.com
 X-Mailer: git-send-email 1.8.0
 
 Result: OK

$ perl --version

This is perl 5, version 14, subversion 2 (v5.14.2) built for 
x86_64-linux-gnu-thread-multi
(with 72 registered patches, see perl -V for more detail)

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using man perl or perldoc perl.  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

And attached you can find the patch file which I'm using

-- 
balbi
From 041d81f493d90c940ec41f0ec98bc7c4f2fba431 Mon Sep 17 00:00:00 2001
From: Felipe Balbi ba...@ti.com
Date: Thu, 4 Oct 2012 11:58:00 +0300
Subject: [PATCH] usb: dwc3: gadget: fix 'endpoint always busy' bug

If a USB transfer has already been started, meaning
we have already issued StartTransfer command to that
particular endpoint, DWC3_EP_BUSY flag has also
already been set.

When we try to cancel this transfer which is already
in controller's cache, we will not receive XferComplete
event and we must clear DWC3_EP_BUSY in order to allow
subsequent requests to be properly started.

The best place to clear that flag is right after issuing
DWC3_DEPCMD_ENDTRANSFER.

Cc: sta...@vger.kernel.org #v3.4 v3.5 v3.6
Reported-by: Moiz Sonasath m-sonas...@ti.com
Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/dwc3/gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index c9e729a..7b7dedd 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1904,7 +1904,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
 	ret = dwc3_send_gadget_ep_cmd(dwc, dep-number, cmd, params);
 	WARN_ON_ONCE(ret);
 	dep-resource_index = 0;
-
+	dep-flags = ~DWC3_EP_BUSY;
 	udelay(100);
 }
 
-- 
1.8.0



signature.asc
Description: Digital signature


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Krzysztof Mazur
On Mon, Nov 19, 2012 at 11:57:47AM +0200, Felipe Balbi wrote:
 Hi guys,
 
 for whatever reason my git has started acting up with
 sta...@vger.kernel.org addresses. It doesn't manage to extract a valid
 adress from the string:
 
  Cc: sta...@vger.kernel.org # v3.4 v3.5 v3.6
 
 Removing the comment at the end of the line makes things work again. I
 do remember, however, seeing this working since few weeks back I sent a
 mail to stable (in fact the same one I'm using to test), so this could
 be related to some perl updates, who knows ?!?

You probably just installed Email::Valid package.

The current git-send-email works a little better and just prints an error:

W: unable to extract a valid address from: sta...@vger.kernel.org #v3.4 v3.5 
v3.6


This patch should fix the problem, now after email any garbage is
removed while extracting address.

diff --git a/git-send-email.perl b/git-send-email.perl
index 5a7c29d..bb659da 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -828,7 +828,7 @@ sub extract_valid_address {
# check for a local address:
return $address if ($address =~ /^($local_part_regexp)$/);
 
-   $address =~ s/^\s*(.*)\s*$/$1/;
+   $address =~ s/^\s*(.*).*$/$1/;
if ($have_email_valid) {
return scalar Email::Valid-address($address);
} else {

Krzysiek
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Felipe Balbi
Hi,

On Mon, Nov 19, 2012 at 04:18:45PM +0100, Krzysztof Mazur wrote:
 On Mon, Nov 19, 2012 at 11:57:47AM +0200, Felipe Balbi wrote:
  Hi guys,
  
  for whatever reason my git has started acting up with
  sta...@vger.kernel.org addresses. It doesn't manage to extract a valid
  adress from the string:
  
   Cc: sta...@vger.kernel.org # v3.4 v3.5 v3.6
  
  Removing the comment at the end of the line makes things work again. I
  do remember, however, seeing this working since few weeks back I sent a
  mail to stable (in fact the same one I'm using to test), so this could
  be related to some perl updates, who knows ?!?
 
 You probably just installed Email::Valid package.
 
 The current git-send-email works a little better and just prints an error:
 
 W: unable to extract a valid address from: sta...@vger.kernel.org #v3.4 
 v3.5 v3.6
 
 
 This patch should fix the problem, now after email any garbage is
 removed while extracting address.

worked like a charm. When you send as a proper patch, you can add my:

Tested-by: Felipe Balbi ba...@ti.com

thanks

-- 
balbi


signature.asc
Description: Digital signature


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Junio C Hamano
Krzysztof Mazur krzys...@podlesie.net writes:

 On Mon, Nov 19, 2012 at 11:57:47AM +0200, Felipe Balbi wrote:
 Hi guys,
 
 for whatever reason my git has started acting up with
 sta...@vger.kernel.org addresses. It doesn't manage to extract a valid
 adress from the string:
 
  Cc: sta...@vger.kernel.org # v3.4 v3.5 v3.6
 
 Removing the comment at the end of the line makes things work again. I
 do remember, however, seeing this working since few weeks back I sent a
 mail to stable (in fact the same one I'm using to test), so this could
 be related to some perl updates, who knows ?!?

 You probably just installed Email::Valid package.

 The current git-send-email works a little better and just prints an error:

 W: unable to extract a valid address from: sta...@vger.kernel.org #v3.4 
 v3.5 v3.6


 This patch should fix the problem, now after email any garbage is
 removed while extracting address.

 diff --git a/git-send-email.perl b/git-send-email.perl
 index 5a7c29d..bb659da 100755
 --- a/git-send-email.perl
 +++ b/git-send-email.perl
 @@ -828,7 +828,7 @@ sub extract_valid_address {
   # check for a local address:
   return $address if ($address =~ /^($local_part_regexp)$/);
  
 - $address =~ s/^\s*(.*)\s*$/$1/;
 + $address =~ s/^\s*(.*).*$/$1/;
   if ($have_email_valid) {
   return scalar Email::Valid-address($address);
   } else {

Given that the problematic line

Stable Kernel Maintainance Track sta...@vger.kernel.org # vX.Y

is not even a valid e-mail address, doesn't this new logic belong to
sanitize_address() conceptually?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Felipe Contreras
On Mon, Nov 19, 2012 at 8:27 PM, Junio C Hamano gits...@pobox.com wrote:
 Krzysztof Mazur krzys...@podlesie.net writes:

 On Mon, Nov 19, 2012 at 11:57:47AM +0200, Felipe Balbi wrote:
 Hi guys,

 for whatever reason my git has started acting up with
 sta...@vger.kernel.org addresses. It doesn't manage to extract a valid
 adress from the string:

  Cc: sta...@vger.kernel.org # v3.4 v3.5 v3.6

 Removing the comment at the end of the line makes things work again. I
 do remember, however, seeing this working since few weeks back I sent a
 mail to stable (in fact the same one I'm using to test), so this could
 be related to some perl updates, who knows ?!?

 You probably just installed Email::Valid package.

 The current git-send-email works a little better and just prints an error:

 W: unable to extract a valid address from: sta...@vger.kernel.org #v3.4 
 v3.5 v3.6


 This patch should fix the problem, now after email any garbage is
 removed while extracting address.

 diff --git a/git-send-email.perl b/git-send-email.perl
 index 5a7c29d..bb659da 100755
 --- a/git-send-email.perl
 +++ b/git-send-email.perl
 @@ -828,7 +828,7 @@ sub extract_valid_address {
   # check for a local address:
   return $address if ($address =~ /^($local_part_regexp)$/);

 - $address =~ s/^\s*(.*)\s*$/$1/;
 + $address =~ s/^\s*(.*).*$/$1/;
   if ($have_email_valid) {
   return scalar Email::Valid-address($address);
   } else {

 Given that the problematic line

 Stable Kernel Maintainance Track sta...@vger.kernel.org # vX.Y

 is not even a valid e-mail address, doesn't this new logic belong to
 sanitize_address() conceptually?

That would be great, it would also help the cc-cmd stuff. The
get_maintainer.pl patch from the Linux kernel outputs something like:

David Airlie airl...@linux.ie (maintainer:DRM DRIVERS)
Ben Skeggs bske...@redhat.com
(commit_signer:17/19=89%,commit_signer:43/46=93%)
Maxim Levitsky maximlevit...@gmail.com (commit_signer:3/19=16%)
Greg Kroah-Hartman gre...@linuxfoundation.org (commit_signer:2/19=11%)
Dave Airlie airl...@redhat.com (commit_signer:2/19=11%,commit_signer:3/46=7%)
Alex Deucher alexander.deuc...@amd.com (commit_signer:1/19=5%)
dri-de...@lists.freedesktop.org (open list:DRM DRIVERS)
linux-ker...@vger.kernel.org (open list)

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Krzysztof Mazur
On Mon, Nov 19, 2012 at 11:27:45AM -0800, Junio C Hamano wrote:
 Given that the problematic line
 
   Stable Kernel Maintainance Track sta...@vger.kernel.org # vX.Y
 
 is not even a valid e-mail address, doesn't this new logic belong to
 sanitize_address() conceptually?

Yes, it's much better to do it in the sanitize_address().

Felipe, may you check it?

Krzysiek
-- 8 --
Subject: [PATCH] git-send-email: remove garbage after email address

In some cases it's very useful to add some additional information
after email in Cc-list, for instance:

Cc: Stable kernel sta...@vger.kernel.org #v3.4 v3.5 v3.6

Currently the git refuses to add such invalid email to Cc-list,
when the Email::Valid perl module is available or just uses whole line
as the email address.

Now in sanitize_address() everything after the email address is
removed, so the resulting line is correct email address and Email::Valid
validates it correctly.

Signed-off-by: Krzysztof Mazur krzys...@podlesie.net
---
 git-send-email.perl | 4 
 1 file changed, 4 insertions(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index 5a7c29d..9840d0a 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -924,6 +924,10 @@ sub quote_subject {
 # use the simplest quoting being able to handle the recipient
 sub sanitize_address {
my ($recipient) = @_;
+
+   # remove garbage after email address
+   $recipient =~ s/(.*).*$/$1/;
+
my ($recipient_name, $recipient_addr) = ($recipient =~ 
/^(.*?)\s*(.*)/);
 
if (not $recipient_name) {
-- 
1.8.0.283.gc57d856

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes:

 On Mon, Nov 19, 2012 at 11:58 PM, Krzysztof Mazur krzys...@podlesie.net 
 wrote:

 --- a/git-send-email.perl
 +++ b/git-send-email.perl
 @@ -924,6 +924,10 @@ sub quote_subject {
  # use the simplest quoting being able to handle the recipient
  sub sanitize_address {
 my ($recipient) = @_;
 +
 +   # remove garbage after email address
 +   $recipient =~ s/(.*).*$/$1/;
 +

 Looks fine, but I would do s/(.*?)(.*)$/$1/, so that 'test
 f...@bar.com #comment' gets the second comment removed.

Yeah, but do you need to capture the second group?  IOW, like
s/(.*?).*$/$1/ perhaps?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Junio C Hamano
Krzysztof Mazur krzys...@podlesie.net writes:

 On Mon, Nov 19, 2012 at 11:27:45AM -0800, Junio C Hamano wrote:
 Given that the problematic line
 
  Stable Kernel Maintainance Track sta...@vger.kernel.org # vX.Y
 
 is not even a valid e-mail address, doesn't this new logic belong to
 sanitize_address() conceptually?

 Yes, it's much better to do it in the sanitize_address().

Note that I did not check that all the addresses that are handled by
extract-valid-address came through sanitize-address function, so
unlike your original patch, this change alone may still pass some
garbage to Email::Valid-address().  I tend to think that is a
progress; we should make sure all the addresses are sanitized before
using them for sending messages out.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Krzysztof Mazur
On Mon, Nov 19, 2012 at 04:00:09PM -0800, Junio C Hamano wrote:
 Krzysztof Mazur krzys...@podlesie.net writes:
 
  On Mon, Nov 19, 2012 at 11:27:45AM -0800, Junio C Hamano wrote:
  Given that the problematic line
  
 Stable Kernel Maintainance Track sta...@vger.kernel.org # vX.Y
  
  is not even a valid e-mail address, doesn't this new logic belong to
  sanitize_address() conceptually?
 
  Yes, it's much better to do it in the sanitize_address().
 
 Note that I did not check that all the addresses that are handled by
 extract-valid-address came through sanitize-address function, so

Before sending that patch, I checked that and tested with and without
Email::Valid.

 unlike your original patch, this change alone may still pass some
 garbage to Email::Valid-address().  I tend to think that is a
 progress; we should make sure all the addresses are sanitized before
 using them for sending messages out.

I will try to check that.

Krzysiek
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Failure to extra sta...@vger.kernel.org addresses

2012-11-19 Thread Krzysztof Mazur
On Mon, Nov 19, 2012 at 03:57:36PM -0800, Junio C Hamano wrote:
 Felipe Contreras felipe.contre...@gmail.com writes:
 
  On Mon, Nov 19, 2012 at 11:58 PM, Krzysztof Mazur krzys...@podlesie.net 
  wrote:
 
  --- a/git-send-email.perl
  +++ b/git-send-email.perl
  @@ -924,6 +924,10 @@ sub quote_subject {
   # use the simplest quoting being able to handle the recipient
   sub sanitize_address {
  my ($recipient) = @_;
  +
  +   # remove garbage after email address
  +   $recipient =~ s/(.*).*$/$1/;
  +
 
  Looks fine, but I would do s/(.*?)(.*)$/$1/, so that 'test
  f...@bar.com #comment' gets the second comment removed.
 
 Yeah, but do you need to capture the second group?  IOW, like
 s/(.*?).*$/$1/ perhaps?

I also thought about removing everything after first , but I will
not work for addresses like:

Cc: foo  sta...@vger.kernel.org #v3.4 v3.5 v3.6

What about:

$recipient =~ s/(.*[^@]*@[^]]*).*$/$1/;

or even

diff --git a/git-send-email.perl b/git-send-email.perl
index 9840d0a..b988c57 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -925,8 +925,11 @@ sub quote_subject {
 sub sanitize_address {
my ($recipient) = @_;
 
+   my $local_part_regexp = qr/[^\s@]+/;
+   my $domain_regexp = qr/[^.\s@]+(?:\.[^.\s@]+)+/;
+
# remove garbage after email address
-   $recipient =~ s/(.*).*$/$1/;
+   $recipient =~ s/(.*$local_part_regexp\@$domain_regexp).*$/$1/;
 
my ($recipient_name, $recipient_addr) = ($recipient =~ 
/^(.*?)\s*(.*)/);

which uses regex used by 99% accurate version of extract_valid_address().

Krzysiek
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html