diff: --color-moved: rename "dimmed_zebra" to "dimmed-zebra"

The --color-moved "dimmed_zebra" mode (with an underscore) is an anachronism. Most options and modes are hyphenated. It is more difficult to type and somewhat more difficult to read than those which are hyphenated. Therefore, rename it to "dimmed-zebra", and nominally deprecate "dimmed_zebra". Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Jul 24, 2018 at 17:58 UTC e3f2f5f9cd9238ae106434278d325eada2719842
3 files changed +7 -4
Documentation/diff-options.txt
+2 -1
@@ -274,10 +274,11 @@ zebra::
274 painted using either the 'color.diff.{old,new}Moved' color or
275 'color.diff.{old,new}MovedAlternative'. The change between
276 the two colors indicates that a new block was detected.
277 -dimmed_zebra::
277 +dimmed-zebra::
278 Similar to 'zebra', but additional dimming of uninteresting parts
279 of moved code is performed. The bordering lines of two adjacent
280 blocks are considered interesting, the rest is uninteresting.
281 + `dimmed_zebra` is a deprecated synonym.
282 --
283
284 --word-diff[=<mode>]::
diff.c
+3 -1
@@ -275,10 +275,12 @@ static int parse_color_moved(const char *arg)
275 return COLOR_MOVED_ZEBRA;
276 else if (!strcmp(arg, "default"))
277 return COLOR_MOVED_DEFAULT;
278 + else if (!strcmp(arg, "dimmed-zebra"))
279 + return COLOR_MOVED_ZEBRA_DIM;
280 else if (!strcmp(arg, "dimmed_zebra"))
281 return COLOR_MOVED_ZEBRA_DIM;
282 else
281 - return error(_("color moved setting must be one of 'no', 'default', 'zebra', 'dimmed_zebra', 'plain'"));
283 + return error(_("color moved setting must be one of 'no', 'default', 'zebra', 'dimmed-zebra', 'plain'"));
284 }
285
286 int git_diff_ui_config(const char *var, const char *value, void *cb)
t/t4015-diff-whitespace.sh
+2 -2
@@ -1223,7 +1223,7 @@ test_expect_success 'plain moved code, inside file' '
1223 test_cmp expected actual
1224 '
1225
1226 -test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '
1226 +test_expect_success 'detect permutations inside moved code -- dimmed-zebra' '
1227 git reset --hard &&
1228 cat <<-\EOF >lines.txt &&
1229 long line 1
@@ -1271,7 +1271,7 @@ test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '
1271 test_config color.diff.newMovedDimmed "normal cyan" &&
1272 test_config color.diff.oldMovedAlternativeDimmed "normal blue" &&
1273 test_config color.diff.newMovedAlternativeDimmed "normal yellow" &&
1274 - git diff HEAD --no-renames --color-moved=dimmed_zebra --color |
1274 + git diff HEAD --no-renames --color-moved=dimmed-zebra --color |
1275 grep -v "index" |
1276 test_decode_color >actual &&
1277 cat <<-\EOF >expected &&