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

[PATCH] git-send-email: kill $prompting variable

From
Rasmus Villemoes <rv@rasmusvillemoes.dk>
Date
Aug 16, 2013, 17:34 UTC
Message-ID
<1376674444-29599-1-git-send-email-rv@rasmusvillemoes.dk>

The variable $prompting is weird. It is only read in one place (when deciding whether to prompt for a Message-ID to use in In-Reply-To), and it will be false unless we've taken the completely unrelated branch filling in @initial_to.

Prompting should be done if the info is needed, not if some unrelated item had to be prompted for. So kill $prompting.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
---
 git-send-email.perl | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 2162478..f608d9b 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -755,13 +755,11 @@ if (!defined $sender) {
 # But it's a no-op to run sanitize_address on an already sanitized address.
 $sender = sanitize_address($sender);
 
-my $prompting = 0;
 if (!@initial_to && !defined $to_cmd) {
 	my $to = ask("Who should the emails be sent to (if any)? ",
 		     default => "",
 		     valid_re => qr/\@.*\./, confirm_only => 1);
 	push @initial_to, parse_address_line($to) if defined $to; # sanitized/validated later
-	$prompting++;
 }
 
 sub expand_aliases {
@@ -785,7 +783,7 @@ sub expand_one_alias {
 @bcclist = expand_aliases(@bcclist);
 @bcclist = validate_address_list(sanitize_address_list(@bcclist));
 
-if ($thread && !defined $initial_reply_to && $prompting) {
+if ($thread && !defined $initial_reply_to) {
 	$initial_reply_to = ask(
 		"Message-ID to be used as In-Reply-To for the first email (if any)? ",
 		default => "",
-- 
1.8.4.rc3.1.g30eccb6
Next: Jeff King
Message 1 of 2 in “git-send-email: kill $prompting variable”
  1. git-send-email: kill $prompting variableRasmus Villemoes, Aug 16, 2013
  2. Jeff KingAug 19, 2013

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.