From: Junio C Hamano Date: Tue, 28 Feb 2006 01:07:16 +0000 (-0800) Subject: git-apply --whitespace=nowarn X-Git-Tag: v1.2.4^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5c0d46eb3d5ab9182a2c6d942189671720f80f74;p=git.git git-apply --whitespace=nowarn Andrew insists --whitespace=warn should be the default, and I tend to agree. This introduces --whitespace=warn, so if your project policy is more lenient, you can squelch them by having apply.whitespace=nowarn in your configuration file. Signed-off-by: Junio C Hamano --- diff --git a/apply.c b/apply.c index 4748d7f8..af9900ff 100644 --- a/apply.c +++ b/apply.c @@ -39,7 +39,7 @@ static enum whitespace_eol { warn_on_whitespace, error_on_whitespace, strip_whitespace, -} new_whitespace = nowarn_whitespace; +} new_whitespace = warn_on_whitespace; static int whitespace_error = 0; static int squelch_whitespace_errors = 5; static int applied_after_stripping = 0; @@ -48,13 +48,17 @@ static const char *patch_input_file = NULL; static void parse_whitespace_option(const char *option) { if (!option) { - new_whitespace = nowarn_whitespace; + new_whitespace = warn_on_whitespace; return; } if (!strcmp(option, "warn")) { new_whitespace = warn_on_whitespace; return; } + if (!strcmp(option, "nowarn")) { + new_whitespace = nowarn_whitespace; + return; + } if (!strcmp(option, "error")) { new_whitespace = error_on_whitespace; return;