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

[PATCH] Add --dry-run option to git-send-email

From
MWMatthew Wilcox <matthew@wil.cx>
Date
Oct 10, 2006, 14:58 UTC
Message-ID
<20061010145823.GB8993@parisc-linux.org>

Add a --dry-run option to git-send-email due to having made too many mistakes with it in the past week. I like having a safety catch on my machine gun.

Signed-off-by: Matthew @ilcox <matthew@wil.cx>

--- /usr/bin/git-send-email 2006-07-29 09:52:13.000000000 -0600 +++ ./git-send-email.perl 2006-10-10 08:46:13.000000000 -0600

@@ -40,7 +40,8 @@
 	$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
 
 # Behavior modification variables
-my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc) = (1, 0, 0, 0);
+my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc,
+	$dry_run) = (1, 0, 0, 0, 0);
 my $smtp_server;
 
 # Example reply to:
@@ -63,6 +64,7 @@
 		    "quiet" => \$quiet,
 		    "suppress-from" => \$suppress_from,
 		    "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
+		    "dry-run" => \$dry_run,
 	 );
 
 # Verify the user input
@@ -395,7 +397,9 @@
 		$header .= "References: $references\n";
 	}
 
-	if ($smtp_server =~ m#^/#) {
+	if ($dry_run) {
+		# We don't want to send the email.
+	} elsif ($smtp_server =~ m#^/#) {
 		my $pid = open my $sm, '|-';
 		defined $pid or die $!;
 		if (!$pid) {
Next: Junio C Hamano
Message 1 of 3 in “Add --dry-run option to git-send-email”
  1. Add --dry-run option to git-send-emailMatthew Wilcox, Oct 10, 2006
  2. Junio C HamanoOct 10, 2006
  3. Jakub NarebskiOct 10, 2006

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.