public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH v3 6/7] send-email: suppress leading and trailing whitespaces in addresses
@ 2015-06-09 18:50 Remi Lespinet
  2015-06-09 18:50 ` [PATCH v3 7/7] send-email: suppress leading and trailing whitespaces before alias expansion Remi Lespinet
  2015-06-10  8:17 ` [PATCH v3 6/7] send-email: suppress leading and trailing whitespaces in addresses Matthieu Moy
  0 siblings, 2 replies; 11+ messages in thread
From: Remi Lespinet @ 2015-06-09 18:50 UTC (permalink / raw)
  To: git
  Cc: Remi Galan, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite, Matthieu Moy

Remove leading and trailing whitespaces when sanitizing addresses so
that git send-email give the same output when passing arguments like
" jdoe@example•com   " or "\t jdoe@example•com " as with
"jdoe@example•com".

The next commit will introduce a test for this aswell.

Signed-off-by: Remi Lespinet <remi.lespinet@ensimag•grenoble-inp.fr>
---
 git-send-email.perl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index ea03308..3d144bd 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -978,6 +978,9 @@ sub sanitize_address {
 	# remove garbage after email address
 	$recipient =~ s/(.*>).*$/$1/;
 
+	# remove leading and trailing whitespace
+	$recipient =~ s/^\s+|\s+$//g;
+
 	my ($recipient_name, $recipient_addr) = ($recipient =~ /^(.*?)\s*(<.*)/);
 
 	if (not $recipient_name) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-10 16:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 18:50 [PATCH v3 6/7] send-email: suppress leading and trailing whitespaces in addresses Remi Lespinet
2015-06-09 18:50 ` [PATCH v3 7/7] send-email: suppress leading and trailing whitespaces before alias expansion Remi Lespinet
2015-06-10  8:32   ` Matthieu Moy
2015-06-10  9:30     ` Remi Lespinet
2015-06-10 15:15       ` Junio C Hamano
2015-06-10 15:28         ` Matthieu Moy
2015-06-10 16:10           ` Remi Lespinet
2015-06-10 16:15           ` Junio C Hamano
2015-06-10 16:25             ` Matthieu Moy
2015-06-10  8:17 ` [PATCH v3 6/7] send-email: suppress leading and trailing whitespaces in addresses Matthieu Moy
2015-06-10  8:33   ` Remi Lespinet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox