All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: git@vger.kernel.org,
	Felipe Contreras <felipe.contreras@gmail.com>,
	Andreas Schwab <schwab@linux-m68k.org>,
	Felipe Balbi <balbi@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: Re: [PATCH 5/5] git-send-email: allow edit invalid email address
Date: Mon, 26 Nov 2012 09:08:34 -0800	[thread overview]
Message-ID: <7vobikthpp.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1353607932-10436-5-git-send-email-krzysiek@podlesie.net> (Krzysztof Mazur's message of "Thu, 22 Nov 2012 19:12:12 +0100")

Krzysztof Mazur <krzysiek@podlesie.net> writes:

> In some cases the user may want to send email with "Cc:" line with
> email address we cannot extract. Now we allow user to extract
> such email address for us.
>
> Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
> ---
>  git-send-email.perl | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index d42dca2..9996735 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -851,10 +851,10 @@ sub extract_valid_address_or_die {
>  
>  sub validate_address {
>  	my $address = shift;
> -	if (!extract_valid_address($address)) {
> +	while (!extract_valid_address($address)) {
>  		print STDERR "error: unable to extract a valid address from: $address\n";
> -		$_ = ask("What to do with this address? ([q]uit|[d]rop): ",
> -			valid_re => qr/^(?:quit|q|drop|d)/i,
> +		$_ = ask("What to do with this address? ([q]uit|[d]rop|[e]dit): ",
> +			valid_re => qr/^(?:quit|q|drop|d|edit|e)/i,
>  			default => 'q');
>  		if (/^d/i) {
>  			return undef;
> @@ -862,6 +862,9 @@ sub validate_address {
>  			cleanup_compose_files();
>  			exit(0);
>  		}
> +		$address = ask("Who should the email be sent to (if any)? ",
> +			default => "",
> +			valid_re => qr/\@.*\./, confirm_only => 1);

Not having this new code inside "elsif (/^e/) { }" feels somewhat
sloppy, even though it is not *too* bad.  Also do we know this
function will never be used for addresses other than recipients' (I
gave a cursory look to see what is done to the $sender and it does
not seem to go through this function, tho)?

  reply	other threads:[~2012-11-26 17:50 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19  9:57 Failure to extra stable@vger.kernel.org addresses Felipe Balbi
2012-11-19 15:18 ` Krzysztof Mazur
2012-11-19 15:37   ` Felipe Balbi
2012-11-19 19:27   ` Junio C Hamano
2012-11-19 21:59     ` Felipe Contreras
2012-11-19 22:58     ` Krzysztof Mazur
2012-11-19 23:12       ` Felipe Contreras
2012-11-19 23:57         ` Junio C Hamano
2012-11-20  7:31           ` Krzysztof Mazur
2012-11-20  7:56             ` Krzysztof Mazur
2012-11-20 10:28               ` Felipe Contreras
2012-11-20 11:08                 ` Andreas Ericsson
2012-11-20 11:59                 ` Krzysztof Mazur
2012-11-20 19:58                   ` Andreas Schwab
2012-11-20 21:21                     ` Krzysztof Mazur
2012-11-20 22:06                       ` Felipe Contreras
2012-11-20 22:30                         ` Junio C Hamano
2012-11-20 23:09                           ` Krzysztof Mazur
2012-11-20 23:43                             ` Junio C Hamano
2012-11-22 18:12                               ` [PATCH 1/5] git-send-email: remove garbage after email address Krzysztof Mazur
2012-11-22 18:12                                 ` [PATCH 2/5] git-send-email: fix fallback code in extract_valid_address() Krzysztof Mazur
2012-11-22 18:12                                 ` [PATCH 3/5] git-send-email: remove invalid addresses earlier Krzysztof Mazur
2012-11-26 17:02                                   ` Junio C Hamano
2012-11-22 18:12                                 ` [PATCH 4/5] git-send-email: ask what to do with an invalid email address Krzysztof Mazur
2012-11-22 18:12                                 ` [PATCH 5/5] git-send-email: allow edit " Krzysztof Mazur
2012-11-26 17:08                                   ` Junio C Hamano [this message]
2012-11-26 17:33                                     ` Krzysztof Mazur
2012-11-26 22:58                                       ` Junio C Hamano
2012-11-26 23:33                                         ` Krzysztof Mazur
2012-11-26 23:50                                           ` Junio C Hamano
2012-11-27 10:53                                             ` Krzysztof Mazur
2012-11-20  0:00       ` Failure to extra stable@vger.kernel.org addresses Junio C Hamano
2012-11-20  7:15         ` Krzysztof Mazur
2012-11-20  7:54       ` Felipe Balbi

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=7vobikthpp.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=balbi@ti.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=krzysiek@podlesie.net \
    --cc=schwab@linux-m68k.org \
    --cc=tomi.valkeinen@ti.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.