]> Kevux Git Server - rit/commitdiff
sideband: drop 'default' configuration
authorJunio C Hamano <gitster@pobox.com>
Thu, 5 Mar 2026 23:34:51 +0000 (15:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Mar 2026 21:52:28 +0000 (13:52 -0800)
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>
Documentation/config/sideband.adoc
sideband.c

index 32088bbf2f0a40e2a6b926e07df2e748067c1082..96fade7f5fee393f5bb78d922925d937380f2f09 100644 (file)
@@ -6,7 +6,6 @@ sideband.allowControlCharacters::
        a comma-separated list of the following keywords):
 +
 --
-       `default`::
        `color`::
                Allow ANSI color sequences, line feeds and horizontal tabs,
                but mask all other control characters. This is the default.
index a90db9e2880cba40a1ac071cfe115ac06888b75b..04282a568edd90de0f46a974435abcffc077c689 100644 (file)
@@ -33,8 +33,8 @@ static enum {
        ALLOW_ANSI_COLOR_SEQUENCES    = 1<<0,
        ALLOW_ANSI_CURSOR_MOVEMENTS   = 1<<1,
        ALLOW_ANSI_ERASE              = 1<<2,
-       ALLOW_DEFAULT_ANSI_SEQUENCES  = ALLOW_ANSI_COLOR_SEQUENCES,
        ALLOW_ALL_CONTROL_CHARACTERS  = 1<<3,
+       ALLOW_DEFAULT_ANSI_SEQUENCES  = ALLOW_ANSI_COLOR_SEQUENCES
 } allow_control_characters = ALLOW_CONTROL_SEQUENCES_UNSET;
 
 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)
 
        allow_control_characters = ALLOW_NO_CONTROL_CHARACTERS;
        while (*value) {
-               if (skip_prefix_in_csv(value, "default", &value))
-                       allow_control_characters |= ALLOW_DEFAULT_ANSI_SEQUENCES;
-               else if (skip_prefix_in_csv(value, "color", &value))
+               if (skip_prefix_in_csv(value, "color", &value))
                        allow_control_characters |= ALLOW_ANSI_COLOR_SEQUENCES;
                else if (skip_prefix_in_csv(value, "cursor", &value))
                        allow_control_characters |= ALLOW_ANSI_CURSOR_MOVEMENTS;