summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-09-29 15:26:12 -0700
committerJunio C Hamano <gitster@pobox.com>2010-09-29 15:26:12 -0700
commitb886656403ed26a9a78f73724c640a3149636ada (patch)
treef49c1c5cbcdd45683f99a76f418bceda66ccd8d4 /git-send-email.perl
parent34289ec35f2c9b1d7a1956e609a053f982e2ddd3 (diff)
parenta03bc5b6ad4ada4eb0669289429a9bc21ff6cdb0 (diff)
downloadgit-b886656403ed26a9a78f73724c640a3149636ada.tar.gz
Merge branch 'tr/send-email-refuse-sending-unedited-cover-letter'
* tr/send-email-refuse-sending-unedited-cover-letter: send-email: Refuse to send cover-letter template subject
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl13
1 files changed, 13 insertions, 0 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 08c8c3c25f..8cc4161155 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -86,6 +86,7 @@ git send-email [options] <file | directory | rev-list options >
--[no-]validate * Perform patch sanity checks. Default on.
--[no-]format-patch * understand any non optional arguments as
`git format-patch` ones.
+ --force * Send even if safety checks would prevent it.
EOT
exit(1);
@@ -163,6 +164,7 @@ if ($@) {
my ($quiet, $dry_run) = (0, 0);
my $format_patch;
my $compose_filename;
+my $force = 0;
# Handle interactive edition of files.
my $multiedit;
@@ -302,6 +304,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
"validate!" => \$validate,
"format-patch!" => \$format_patch,
"8bit-encoding=s" => \$auto_8bit_encoding,
+ "force" => \$force,
);
unless ($rc) {
@@ -703,6 +706,16 @@ if (!defined $auto_8bit_encoding && scalar %broken_encoding) {
default => "UTF-8");
}
+if (!$force) {
+ for my $f (@files) {
+ if (get_patch_subject($f) =~ /\*\*\* SUBJECT HERE \*\*\*/) {
+ die "Refusing to send because the patch\n\t$f\n"
+ . "has the template subject '*** SUBJECT HERE ***'. "
+ . "Pass --force if you really want to send.\n";
+ }
+ }
+}
+
my $prompting = 0;
if (!defined $sender) {
$sender = $repoauthor || $repocommitter || '';