Skip to content

Commit e3f2f5f

Browse files
sunshinecogitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a42a58d commit e3f2f5f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

Documentation/diff-options.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,11 @@ zebra::
274274
painted using either the 'color.diff.{old,new}Moved' color or
275275
'color.diff.{old,new}MovedAlternative'. The change between
276276
the two colors indicates that a new block was detected.
277-
dimmed_zebra::
277+
dimmed-zebra::
278278
Similar to 'zebra', but additional dimming of uninteresting parts
279279
of moved code is performed. The bordering lines of two adjacent
280280
blocks are considered interesting, the rest is uninteresting.
281+
`dimmed_zebra` is a deprecated synonym.
281282
--
282283

283284
--word-diff[=<mode>]::

diff.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,12 @@ static int parse_color_moved(const char *arg)
275275
return COLOR_MOVED_ZEBRA;
276276
else if (!strcmp(arg, "default"))
277277
return COLOR_MOVED_DEFAULT;
278+
else if (!strcmp(arg, "dimmed-zebra"))
279+
return COLOR_MOVED_ZEBRA_DIM;
278280
else if (!strcmp(arg, "dimmed_zebra"))
279281
return COLOR_MOVED_ZEBRA_DIM;
280282
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'"));
282284
}
283285

284286
int git_diff_ui_config(const char *var, const char *value, void *cb)

t/t4015-diff-whitespace.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ test_expect_success 'plain moved code, inside file' '
12231223
test_cmp expected actual
12241224
'
12251225

1226-
test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '
1226+
test_expect_success 'detect permutations inside moved code -- dimmed-zebra' '
12271227
git reset --hard &&
12281228
cat <<-\EOF >lines.txt &&
12291229
long line 1
@@ -1271,7 +1271,7 @@ test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '
12711271
test_config color.diff.newMovedDimmed "normal cyan" &&
12721272
test_config color.diff.oldMovedAlternativeDimmed "normal blue" &&
12731273
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 |
12751275
grep -v "index" |
12761276
test_decode_color >actual &&
12771277
cat <<-\EOF >expected &&

0 commit comments

Comments
 (0)