git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git@vger.kernel.org, Nanako Shiraishi <nanako3@lavabit.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH v2] send-email: add --confirm option
Date: Mon, 02 Mar 2009 18:47:22 -0800	[thread overview]
Message-ID: <7v1vtfjpad.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1235924234-16923-1-git-send-email-jaysoffian@gmail.com> (Jay Soffian's message of "Sun, 1 Mar 2009 11:17:14 -0500")

Jay Soffian <jaysoffian@gmail.com> writes:

>  - When the user specifies "all" in response to a confirm prompt, we
>    hint them about how to use "sendemail.confirm" config setting.

I think the logic is wrong.  Even when you have configured to usually ask,
you may want to say "I know Cc settings for this particular series is all
good, but I still want the safety in my future invocations.".

How about doing it this way instead?

> @@ -346,6 +350,13 @@ if ($suppress_cc{'body'}) {
>  	delete $suppress_cc{'body'};
>  }
>  
> +# Set confirm
> +if (!defined $confirm) {
> +	$confirm = scalar %suppress_cc ? 'compose' : 'auto';

This is not "Set confirm" but "set the default value to $confirm".  Also
set $confirm_unconfigured = "true" here.

> @@ -837,6 +836,27 @@ X-Mailer: git-send-email $gitversion
>  	unshift (@sendmail_parameters,
>  			'-f', $raw_from) if(defined $envelope_sender);
> +	if ($needs_confirm && !$dry_run) {

And use it here; give some help for people who haven't seen this new
message and haven't decided:

	    if (!$confirm_unconfigured) {
		print "By default the command asks if you are sure about\n";
		print "the CC list computed from various places.  If you\n";
                print "do not want this confirmation step, you can say\n";
                print "    $ git config --global sendemail.confirm never\n";
                print "to squelch it.\n";
		print "A good setting might be:\n";
                print "    $ git config --global sendemail.confirm auto\n";
		print "to squelch this help text that is given until you\n";
		print "configure the variable to some value.\n";
	    }

> +		print "\n$header\n";
> +		while (1) {
> +			chomp ($_ = $term->readline(
> +				"Send this email? ([y]es|[n]o|[q]uit|[a]ll): "
> +			));
> +			last if /^(?:yes|y|no|n|quit|q|all|a)/i;
> +			print "\n";
> +		}
> +		if (/^n/i) {
> +			return;
> +		} elsif (/^q/i) {
> +			cleanup_compose_files();
> +			exit(0);
> +		} elsif (/^a/i) {
> +			$confirm = 'never';

And drop the following two:

> +			print "You may disable all future prompting via sendemail.confirm;\n";
> +			print "Run 'git send-email --help' for details.\n";
> +		}
> +	}

  parent reply	other threads:[~2009-03-03  2:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-01  8:23 [PATCH] send-email: add --confirm option Jay Soffian
2009-03-01  9:03 ` Junio C Hamano
2009-03-01 14:05   ` Jay Soffian
2009-03-01 16:17   ` [PATCH v2] " Jay Soffian
2009-03-01 17:09     ` Paul Gortmaker
2009-03-01 17:49       ` Jay Soffian
2009-03-02  8:24         ` Nanako Shiraishi
2009-03-02  9:01           ` Junio C Hamano
2009-03-02  9:23             ` Nanako Shiraishi
2009-03-02 10:35             ` Felipe Contreras
2009-03-02 12:33           ` Jay Soffian
2009-03-02  7:34     ` Junio C Hamano
2009-03-02 12:35       ` Jay Soffian
2009-03-03  2:47     ` Junio C Hamano [this message]
2009-03-03  4:52       ` [PATCH v3] send-email: add --confirm option and configuration setting Jay Soffian
2009-03-03  6:53         ` Junio C Hamano
2009-03-03 10:11         ` Nanako Shiraishi
2009-03-03 11:54         ` Bert Wesarg
2009-03-03 16:22           ` Jay Soffian
2009-03-03 16:48             ` Junio C Hamano
2009-03-03 18:05               ` Bert Wesarg
2009-03-03 18:18                 ` Jay Soffian

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v1vtfjpad.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=nanako3@lavabit.com \
    --cc=paul.gortmaker@windriver.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).