{"thread":{"id":"5871","subject":"[PATCH] Add --dry-run option to git-send-email","startedAt":"2006-10-10T14:58:23Z","lastAt":"2006-10-10T21:03:31Z","messageCount":3,"participants":["Matthew Wilcox","Junio C Hamano","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"28516","messageId":"20061010145823.GB8993@parisc-linux.org","threadId":"5871","inReplyTo":null,"subject":"[PATCH] Add --dry-run option to git-send-email","fromName":"Matthew Wilcox","fromEmail":"matthew@wil.cx","sentAt":"2006-10-10T14:58:23Z","receivedAt":"2006-10-10T14:58:23Z","isPatch":true,"sender":{"key":"matthew@wil.cx","avatar":null},"body":"\nAdd a --dry-run option to git-send-email due to having made too many\nmistakes with it in the past week.  I like having a safety catch on my\nmachine gun.\n\nSigned-off-by: Matthew @ilcox <matthew@wil.cx>\n\n--- /usr/bin/git-send-email\t2006-07-29 09:52:13.000000000 -0600\n+++ ./git-send-email.perl\t2006-10-10 08:46:13.000000000 -0600\n@@ -40,7 +40,8 @@\n \t$initial_reply_to,$initial_subject,@files,$from,$compose,$time);\n \n # Behavior modification variables\n-my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc) = (1, 0, 0, 0);\n+my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc,\n+\t$dry_run) = (1, 0, 0, 0, 0);\n my $smtp_server;\n \n # Example reply to:\n@@ -63,6 +64,7 @@\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"suppress-from\" => \\$suppress_from,\n \t\t    \"no-signed-off-cc|no-signed-off-by-cc\" => \\$no_signed_off_cc,\n+\t\t    \"dry-run\" => \\$dry_run,\n \t );\n \n # Verify the user input\n@@ -395,7 +397,9 @@\n \t\t$header .= \"References: $references\\n\";\n \t}\n \n-\tif ($smtp_server =~ m#^/#) {\n+\tif ($dry_run) {\n+\t\t# We don't want to send the email.\n+\t} elsif ($smtp_server =~ m#^/#) {\n \t\tmy $pid = open my $sm, '|-';\n \t\tdefined $pid or die $!;\n \t\tif (!$pid) {\n"},{"id":"28528","messageId":"7vslhw12w4.fsf@assigned-by-dhcp.cox.net","threadId":"5871","inReplyTo":"20061010145823.GB8993@parisc-linux.org","subject":"Re: [PATCH] Add --dry-run option to git-send-email","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-10T17:44:59Z","receivedAt":"2006-10-10T17:44:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthew Wilcox <matthew@wil.cx> writes:\n\n> Add a --dry-run option to git-send-email due to having made too many\n> mistakes with it in the past week.  I like having a safety catch on my\n> machine gun.\n>\n> Signed-off-by: Matthew @ilcox <matthew@wil.cx>\n\nGood.\n\nWhen I have to look into other people's issues with send-email,\nI used to say \"--smtp-server=/var/tmp/send\" which is this\nscript:\n\n        #!/bin/sh\n        for i\n        do\n                echo \"arg $i\"\n        done\n        sed -e 's/^/Msg: /'\n\nI hope your patch makes the above hack unneeded (I want to see\nwhat is fed to sendmail, what goes on the header and body).\n"},{"id":"28555","messageId":"egh1ou$fqm$1@sea.gmane.org","threadId":"5871","inReplyTo":"20061010145823.GB8993@parisc-linux.org","subject":"Re: [PATCH] Add --dry-run option to git-send-email","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-10T21:03:31Z","receivedAt":"2006-10-10T21:03:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Matthew Wilcox wrote:\n\n> Add a --dry-run option to git-send-email due to having made too many\n> mistakes with it in the past week.  I like having a safety catch on my\n> machine gun.\n\n+1\n\nI'd like also for git-send-email to check if there are any patches to send,\nas I oftend did forgot to provide patches.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}