From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Eric Wong <normalperson@yhbt.net>
Cc: git@vger.kernel.org,
Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>
Subject: Re: [RFC] git-send-email: do not double-escape quotes from mutt
Date: Mon, 04 Jan 2016 19:11:58 +0100 [thread overview]
Message-ID: <vpqsi2dxlht.fsf@anie.imag.fr> (raw)
In-Reply-To: <20151227020810.1450-1-normalperson@yhbt.net> (Eric Wong's message of "Sun, 27 Dec 2015 02:08:10 +0000")
Eric Wong <normalperson@yhbt.net> writes:
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -524,8 +524,14 @@ my %parse_alias = (
> if (/^\s*alias\s+(?:-group\s+\S+\s+)*(\S+)\s+(.*)$/) {
> my ($alias, $addr) = ($1, $2);
> $addr =~ s/#.*$//; # mutt allows # comments
> - # commas delimit multiple addresses
> - $aliases{$alias} = [ split_addrs($addr) ];
> + # commas delimit multiple addresses
> + my @addr = split_addrs($addr);
> +
> + # quotes may be escaped in the file,
> + # remove them if paired so we do not
> + # double-escape them later.
I think you meant "remove the escaping" or simply "unescape", not
"remove them", which I'd understand as "remove the quotes".
Other than that, the patch looks good to me, including your proposed
fixup:
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -530,7 +530,7 @@ my %parse_alias = (
# quotes may be escaped in the file,
# remove them if paired so we do not
# double-escape them later.
- s/^\\"(.*?)\\"/"$1"/g foreach @addr;
+ s/\\"/"/g foreach @addr;
$aliases{$alias} = \@addr
Eric Wong <normalperson@yhbt.net> writes:
> alias qn \"Q. N\\\"ame\" <qn@example.org> # becomes "Q. N\"ame"
> alias dq \"Dub O.\" \"Q\" <dq@example.org> # becomes "Dub O. Q"
[...]
> But I'm not sure how to handle the "dq" case or if that even
> happens in practice, as attempting to save an alias with "Dub O." "Q"
> in the From: header, mutt shortens it to the expected \"Dub O. Q\"
> without extra quotes.
I wouldn't worry too much about corner-cases, but perhaps some people do
use escaped quotes inside escaped quotes. I'd say they get what they
deserve ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
next prev parent reply other threads:[~2016-01-04 18:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-27 2:08 [RFC] git-send-email: do not double-escape quotes from mutt Eric Wong
2015-12-28 22:34 ` Junio C Hamano
2015-12-29 2:49 ` Eric Wong
2016-01-04 18:11 ` Matthieu Moy [this message]
2016-01-04 20:53 ` [PATCH v2] " Eric Wong
2016-01-04 21:35 ` Junio C Hamano
2016-01-04 22:01 ` Eric Wong
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=vpqsi2dxlht.fsf@anie.imag.fr \
--to=matthieu.moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=normalperson@yhbt.net \
--cc=remi.lespinet@ensimag.grenoble-inp.fr \
/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.