Skip to content

Commit 826cc47

Browse files
committed
sideband: drop 'default' configuration
The topic so far allows users to tweak the configuration variable sideband.allowControlCharacters to override the hardcoded default, but among which there is the value called 'default'. The plan [*] of the series is to loosen the setting by a later commit in the series and schedule it to tighten at the Git 3.0 boundary for end users, at which point, the meaning of this 'default' value will change. Which is a dubious design. A user expresses their preference by setting configuration variable in order to guard against sudden change brought in by changes to the hardcoded default behaviour, and letting them set it to 'default' that will change at the Git 3.0 boundary defeats its purpose. If a user wants to say "I am easy and can go with whatever hardcoded default Git implementors choose for me", they simply leave the configuration variable unspecified. Let's remove it from the state before Git 3.0 so that those users who set it to 'default' will not see the behaviour changed under their feet all of sudden. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 602c83f commit 826cc47

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Documentation/config/sideband.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ sideband.allowControlCharacters::
66
a comma-separated list of the following keywords):
77
+
88
--
9-
`default`::
109
`color`::
1110
Allow ANSI color sequences, line feeds and horizontal tabs,
1211
but mask all other control characters. This is the default.

sideband.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ static enum {
3333
ALLOW_ANSI_COLOR_SEQUENCES = 1<<0,
3434
ALLOW_ANSI_CURSOR_MOVEMENTS = 1<<1,
3535
ALLOW_ANSI_ERASE = 1<<2,
36-
ALLOW_DEFAULT_ANSI_SEQUENCES = ALLOW_ANSI_COLOR_SEQUENCES,
3736
ALLOW_ALL_CONTROL_CHARACTERS = 1<<3,
37+
ALLOW_DEFAULT_ANSI_SEQUENCES = ALLOW_ANSI_COLOR_SEQUENCES
3838
} allow_control_characters = ALLOW_CONTROL_SEQUENCES_UNSET;
3939

4040
static inline int skip_prefix_in_csv(const char *value, const char *prefix,
@@ -62,9 +62,7 @@ int sideband_allow_control_characters_config(const char *var, const char *value)
6262

6363
allow_control_characters = ALLOW_NO_CONTROL_CHARACTERS;
6464
while (*value) {
65-
if (skip_prefix_in_csv(value, "default", &value))
66-
allow_control_characters |= ALLOW_DEFAULT_ANSI_SEQUENCES;
67-
else if (skip_prefix_in_csv(value, "color", &value))
65+
if (skip_prefix_in_csv(value, "color", &value))
6866
allow_control_characters |= ALLOW_ANSI_COLOR_SEQUENCES;
6967
else if (skip_prefix_in_csv(value, "cursor", &value))
7068
allow_control_characters |= ALLOW_ANSI_CURSOR_MOVEMENTS;

0 commit comments

Comments
 (0)