@matheusbsbs / matheus-bagliano / commits / dbf5e1e974
Fork 0

send-email: change --no-validate to boolean --[no-]validate

There is also now a configuration variable: sendemail[.<identity>].validate Signed-off-by: Michael Witten <mfwitten@mit.edu> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Michael Witten committed Sep 30, 2008 at 07:58 UTC dbf5e1e974ff6264b04759a4a3e04966b056e533
2 files changed +12 -6
Documentation/git-send-email.txt
+7 -2
@@ -182,14 +182,16 @@ configuration variable), then authentication is not attempted.
182 +
183 The --to option must be repeated for each user you want on the to list.
184
185 ---no-validate::
186 - Don't perform any sanity checks on patches.
185 +--[no-]validate::
186 + Perform sanity checks on patches.
187 Currently, validation means the following:
188 +
189 --
190 * Warn of patches that contain lines longer than 998 characters; this
191 is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
192 --
193 ++
194 +This option can be set with sendemail[.<identity>].validate; default to --validate
195
196
197 CONFIGURATION
@@ -242,6 +244,9 @@ sendemail.smtpencryption::
244 sendemail.smtpssl::
245 Legacy boolean that sets 'smtpencryption=ssl' if enabled.
246
247 +sendemail.validate::
248 + Boolean override for --[no-]validate.
249 +
250 Author
251 ------
252 Written by Ryan Anderson <ryan@michonline.com>
git-send-email.perl
+5 -4
@@ -65,7 +65,7 @@ Options:
65 --smtp-ssl * Deprecated. Use '--smtp-encryption ssl'.
66 --quiet * Output one line of info per email.
67 --dry-run * Don't actually send the emails.
68 - --no-validate * Don't perform sanity checks on patches.
68 + --[no-]validate * Perform patch sanity checks. Default on.
69
70 EOT
71 exit(1);
@@ -147,7 +147,7 @@ my ($quiet, $dry_run) = (0, 0);
147 my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd);
148 my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
149 my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
150 -my ($no_validate);
150 +my ($validate);
151 my (@suppress_cc);
152
153 my %config_bool_settings = (
@@ -155,6 +155,7 @@ my %config_bool_settings = (
155 "chainreplyto" => [\$chain_reply_to, 1],
156 "suppressfrom" => [\$suppress_from, undef],
157 "signedoffcc" => [\$signed_off_cc, undef],
158 + "validate" => [\$validate, 1],
159 );
160
161 my %config_settings = (
@@ -221,7 +222,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
222 "dry-run" => \$dry_run,
223 "envelope-sender=s" => \$envelope_sender,
224 "thread!" => \$thread,
224 - "no-validate" => \$no_validate,
225 + "validate!" => \$validate,
226 );
227
228 unless ($rc) {
@@ -374,7 +375,7 @@ for my $f (@ARGV) {
375 }
376 }
377
377 -if (!$no_validate) {
378 +if ($validate) {
379 foreach my $f (@files) {
380 unless (-p $f) {
381 my $error = validate_patch($f);