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

[PATCH] send-email: initial_to and initial_reply_to are both optional

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 6, 2012, 21:21 UTC
Message-ID
<7vr4qe26gz.fsf_-_@alter.siamese.dyndns.org>
In-Reply-To
<7vipbq3omb.fsf@alter.siamese.dyndns.org>

We may pick up additional recipients from the format-patch output files we are sending, in which case it is perfectly valid to leave the @initial_to empty when the prompt asks. We may want to start a new discussion thread without replying to anything, and it is valid to leave $initial_reply_to empty.

An earlier update to avoid y@example.com stuffed in address fields did not take these two cases into account.

Noticed and fix suggested by Stephen Boyd.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * I am tempted to queue this, after asking you to eyeball it, and
   then update the author to pass the blame to you before merging it
   to 'next'.
 git-send-email.perl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index e89729b..b1fb7e6 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -759,7 +759,8 @@ sub file_declares_8bit_cte {
 }
 
 if (!@initial_to && !defined $to_cmd) {
-	my $to = ask("Who should the emails be sent to? ",
+	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++;
@@ -786,7 +787,8 @@ sub expand_one_alias {
 
 if ($thread && !defined $initial_reply_to && $prompting) {
 	$initial_reply_to = ask(
-		"Message-ID to be used as In-Reply-To for the first email? ",
+		"Message-ID to be used as In-Reply-To for the first email (if any)? ",
+		default => "",
 		valid_re => qr/\@.*\./, confirm_only => 1);
 }
 if (defined $initial_reply_to) {
-- 
1.7.12.321.g60f00e5
Previous: Junio C HamanoNext: Stephen Boyd
Message 11 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.