Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Add --dry-run option to git-send-email
author
Matthew Wilcox
<matthew@wil.cx>
Tue, 10 Oct 2006 14:58:23 +0000
(08:58 -0600)
committer
Junio C Hamano
<junkio@cox.net>
Wed, 11 Oct 2006 08:18:57 +0000
(
01:18
-0700)
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-send-email.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0503f9c
)
diff --git
a/git-send-email.perl
b/git-send-email.perl
index 3f50abaeb6901772b22e6ca2c1e87b4bd92f3b92..04c89422523a9272bd1ba9c3020cb12db0018cfa 100755
(executable)
--- a/
git-send-email.perl
+++ b/
git-send-email.perl
@@
-87,7
+87,8
@@
sub format_2822_time {
$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
# Behavior modification variables
$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:
my $smtp_server;
# Example reply to:
@@
-116,6
+117,7
@@
sub format_2822_time {
"quiet" => \$quiet,
"suppress-from" => \$suppress_from,
"no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
"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
);
# Verify the user input
@@
-423,7
+425,9
@@
sub send_message
$header .= "References: $references\n";
}
$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) {
my $pid = open my $sm, '|-';
defined $pid or die $!;
if (!$pid) {