git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] send-email: validate & reconfirm interactive responses

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2012, 22:57 UTC
Message-ID
<7v1uj984kp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAOeW2eEOAdVJrVfyZ4osEARXWuXncy3ZSa4ir8BZbUjNjMzbSw@mail.gmail.com>
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> writes:
Show 6 quoted lines
> On Tue, Aug 14, 2012 at 3:25 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> People answer 'y' to "Who should the emails appear to be from?"  and
>> 'n' to "Message-ID to be used as In-Reply-To for the first email?"
>> for some unknown reason.
>
> Yeah, I know :-(. I did feel stupid already. Thanks for improving.

Actually, it is a very understandable mistake and I do not think it is a user stupidity. It is a UI bug in the prompter that gives:

  Who should the emails appear to be from? [Junio C Hamano <gitster@pobox.com>]

and does *not* tell the user that the way to accept the default is to just press RETURN. It makes it look as if it is asking "Is it OK to use this?", and it is a natural response to say "Yes" to the prompt.

We would want to do something like the following pseudo-patch, I think, but I do not know what is the best way to show both $prompt and the "press return" suggestion to the user, so I am not going to do this myself.

A tested patch to improve this is very much welcomed.
Thanks.
diff --git a/git-send-email.perl b/git-send-email.perl
index 607137b..2ec0ce8 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -688,6 +688,9 @@ sub ask {
 		unless defined $term->IN and defined fileno($term->IN) and
 		       defined $term->OUT and defined fileno($term->OUT);
 	while ($i++ < 10) {
+		if (defined $default) {
+			SAY "(press RETURN to accept the default)";
+		}
 		$resp = $term->readline($prompt);
 		if (!defined $resp) { # EOF
 			print "\n";
Previous: Martin von ZweigbergkNext: Stephen Boyd
Message 6 of 13 in “send-email and in-reply-to = n”
  1. Stephen BoydAug 13, 2012
  2. Junio C HamanoAug 13, 2012
  3. Martin von ZweigbergkAug 14, 2012
  4. send-email: validate & reconfirm interactive responsesJunio C Hamano, Aug 14, 2012
  5. Martin von ZweigbergkAug 14, 2012
  6. Junio C HamanoAug 14, 2012
  7. Stephen BoydSep 5, 2012
  8. Junio C HamanoSep 6, 2012
  9. Stephen BoydSep 6, 2012
  10. Junio C HamanoSep 6, 2012
  11. send-email: initial_to and initial_reply_to are both optionalJunio C Hamano, Sep 6, 2012
  12. Stephen BoydSep 6, 2012
  13. Stephen BoydSep 6, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.