Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-apply: what is detected and fixed is not just trailing spaces.
author
Junio C Hamano
<junkio@cox.net>
Sun, 3 Jun 2007 02:55:54 +0000
(19:55 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 3 Jun 2007 03:02:19 +0000
(20:02 -0700)
But we kept saying "trailing whitespace" all the same. Reword the
error messages a bit.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-apply.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d3017e9
)
diff --git
a/builtin-apply.c
b/builtin-apply.c
index e71789803749b22a3ec041b2bce533957cea1c72..c6f736c14e4840bde2efd204e7f88a3556e9eed9 100644
(file)
--- a/
builtin-apply.c
+++ b/
builtin-apply.c
@@
-55,7
+55,7
@@
static enum whitespace_eol {
} new_whitespace = warn_on_whitespace;
static int whitespace_error;
static int squelch_whitespace_errors = 5;
} new_whitespace = warn_on_whitespace;
static int whitespace_error;
static int squelch_whitespace_errors = 5;
-static int applied_after_
stripping
;
+static int applied_after_
fixing_ws
;
static const char *patch_input_file;
static void parse_whitespace_option(const char *option)
static const char *patch_input_file;
static void parse_whitespace_option(const char *option)
@@
-1657,7
+1657,7
@@
static int apply_line(char *output, const char *patch, int plen)
if (add_nl_to_tail)
output[plen++] = '\n';
if (fixed)
if (add_nl_to_tail)
output[plen++] = '\n';
if (fixed)
- applied_after_
stripping
++;
+ applied_after_
fixing_ws
++;
return output + plen - buf;
}
return output + plen - buf;
}
@@
-2884,18
+2884,17
@@
int cmd_apply(int argc, const char **argv, const char *unused_prefix)
squelched == 1 ? "" : "s");
}
if (new_whitespace == error_on_whitespace)
squelched == 1 ? "" : "s");
}
if (new_whitespace == error_on_whitespace)
- die("%d line%s add%s
trailing whitespace
s.",
+ die("%d line%s add%s
whitespace error
s.",
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
- if (applied_after_
stripping
)
+ if (applied_after_
fixing_ws
)
fprintf(stderr, "warning: %d line%s applied after"
fprintf(stderr, "warning: %d line%s applied after"
- "
stripping trailing whitespace
s.\n",
- applied_after_
stripping
,
- applied_after_
stripping
== 1 ? "" : "s");
+ "
fixing whitespace error
s.\n",
+ applied_after_
fixing_ws
,
+ applied_after_
fixing_ws
== 1 ? "" : "s");
else if (whitespace_error)
else if (whitespace_error)
- fprintf(stderr, "warning: %d line%s add%s trailing"
- " whitespaces.\n",
+ fprintf(stderr, "warning: %d line%s add%s whitespace errors.\n",
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");