From fbafb7c682272e039e7aacbf8c0ef8de3c0eb157 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Fri, 23 Nov 2018 11:16:50 +0000 Subject: diff: document --no-color-moved Add documentation for --no-color-moved. Signed-off-by: Phillip Wood Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 0378cd574e..151690f814 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -293,6 +293,10 @@ dimmed-zebra:: `dimmed_zebra` is a deprecated synonym. -- +--no-color-moved:: + Turn off move detection. This can be used to override configuration + settings. It is the same as `--color-moved=no`. + --color-moved-ws=:: This configures how white spaces are ignored when performing the move detection for `--color-moved`. -- cgit v1.3-5-g9baa From 748aa1aa34a316b8f26a3664f3fdcd273e1c5c39 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Fri, 23 Nov 2018 11:16:51 +0000 Subject: Use "whitespace" consistently Most of the messages and documentation use 'whitespace' rather than 'white space' or 'white spaces' convert to latter two to the former for consistency. Signed-off-by: Phillip Wood Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 4 ++-- Documentation/git-cat-file.txt | 8 ++++---- diff.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 151690f814..57a2f4cb7a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -298,7 +298,7 @@ dimmed-zebra:: settings. It is the same as `--color-moved=no`. --color-moved-ws=:: - This configures how white spaces are ignored when performing the + This configures how whitespace is ignored when performing the move detection for `--color-moved`. ifdef::git-diff[] It can be set by the `diff.colorMovedWS` configuration setting. @@ -316,7 +316,7 @@ ignore-all-space:: Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none. allow-indentation-change:: - Initially ignore any white spaces in the move detection, then + Initially ignore any whitespace in the move detection, then group the moved code blocks only into a block if the change in whitespace is the same per line. This is incompatible with the other modes. diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt index 74013335a1..9a2e9cdafb 100644 --- a/Documentation/git-cat-file.txt +++ b/Documentation/git-cat-file.txt @@ -23,8 +23,8 @@ In the second form, a list of objects (separated by linefeeds) is provided on stdin, and the SHA-1, type, and size of each object is printed on stdout. The output format can be overridden using the optional `` argument. If either `--textconv` or `--filters` was specified, the input is expected to -list the object names followed by the path name, separated by a single white -space, so that the appropriate drivers can be determined. +list the object names followed by the path name, separated by a single +whitespace, so that the appropriate drivers can be determined. OPTIONS ------- @@ -79,7 +79,7 @@ OPTIONS Print object information and contents for each object provided on stdin. May not be combined with any other options or arguments except `--textconv` or `--filters`, in which case the input lines - also need to specify the path, separated by white space. See the + also need to specify the path, separated by whitespace. See the section `BATCH OUTPUT` below for details. --batch-check:: @@ -87,7 +87,7 @@ OPTIONS Print object information for each object provided on stdin. May not be combined with any other options or arguments except `--textconv` or `--filters`, in which case the input lines also - need to specify the path, separated by white space. See the + need to specify the path, separated by whitespace. See the section `BATCH OUTPUT` below for details. --batch-all-objects:: diff --git a/diff.c b/diff.c index dc9965e836..7fc92dcd3d 100644 --- a/diff.c +++ b/diff.c @@ -320,7 +320,7 @@ static int parse_color_moved_ws(const char *arg) if ((ret & COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE) && (ret & XDF_WHITESPACE_FLAGS)) - die(_("color-moved-ws: allow-indentation-change cannot be combined with other white space modes")); + die(_("color-moved-ws: allow-indentation-change cannot be combined with other whitespace modes")); string_list_clear(&l, 0); -- cgit v1.3-5-g9baa From b73bcbac4a9d8c76ccdda0f0ac4b122b8e96e4b7 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Fri, 23 Nov 2018 11:16:52 +0000 Subject: diff: allow --no-color-moved-ws Allow --no-color-moved-ws and --color-moved-ws=no to cancel any previous --color-moved-ws option. Signed-off-by: Phillip Wood Reviewed-by: Stefan Beller Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 7 +++++++ diff.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'Documentation/diff-options.txt') diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 57a2f4cb7a..e1744fa80d 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -306,6 +306,8 @@ endif::git-diff[] These modes can be given as a comma separated list: + -- +no:: + Do not ignore whitespace when performing move detection. ignore-space-at-eol:: Ignore changes in whitespace at EOL. ignore-space-change:: @@ -322,6 +324,11 @@ allow-indentation-change:: other modes. -- +--no-color-moved-ws:: + Do not ignore whitespace when performing move detection. This can be + used to override configuration settings. It is the same as + `--color-moved-ws=no`. + --word-diff[=]:: Show a word diff, using the to delimit changed words. By default, words are delimited by whitespace; see diff --git a/diff.c b/diff.c index 7fc92dcd3d..4ef0042bf7 100644 --- a/diff.c +++ b/diff.c @@ -304,7 +304,9 @@ static int parse_color_moved_ws(const char *arg) strbuf_addstr(&sb, i->string); strbuf_trim(&sb); - if (!strcmp(sb.buf, "ignore-space-change")) + if (!strcmp(sb.buf, "no")) + ret = 0; + else if (!strcmp(sb.buf, "ignore-space-change")) ret |= XDF_IGNORE_WHITESPACE_CHANGE; else if (!strcmp(sb.buf, "ignore-space-at-eol")) ret |= XDF_IGNORE_WHITESPACE_AT_EOL; @@ -5036,6 +5038,8 @@ int diff_opt_parse(struct diff_options *options, if (cm < 0) die("bad --color-moved argument: %s", arg); options->color_moved = cm; + } else if (!strcmp(arg, "--no-color-moved-ws")) { + options->color_moved_ws_handling = 0; } else if (skip_prefix(arg, "--color-moved-ws=", &arg)) { options->color_moved_ws_handling = parse_color_moved_ws(arg); } else if (skip_to_optional_arg_default(arg, "--color-words", &options->word_regex, NULL)) { -- cgit v1.3-5-g9baa