Skip to content

Commit

Permalink
Merge branch 'mw/send-email'
Browse files Browse the repository at this point in the history
* mw/send-email:
  Add --dry-run option to git-send-email
  • Loading branch information
Junio C Hamano committed Oct 19, 2006
2 parents a420585 + 6130259 commit 32788ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ sub format_2822_time {
$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:
Expand Down Expand Up @@ -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,
"dry-run" => \$dry_run,
);

# Verify the user input
Expand Down Expand Up @@ -423,7 +425,9 @@ sub send_message
$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) {
Expand Down

0 comments on commit 32788ad

Please sign in to comment.