]> git.ipfire.org Git - thirdparty/git.git/commit
sideband: do allow ANSI color sequences by default
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 16 Jan 2026 22:26:11 +0000 (22:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 23:43:03 +0000 (15:43 -0800)
commit63cbc995dbff6af870dfdb9f8088d715286adaf6
treeb13e1632c4f0cdd11e7ce157390b2467afef89d4
parent932a03f1191e369b618971de143dd627a4bdb7c7
sideband: do allow ANSI color sequences by default

The preceding two commits introduced special handling of the sideband
channel to neutralize ANSI escape sequences before sending the payload
to the terminal, and `sideband.allowControlCharacters` to override that
behavior.

However, as reported by brian m. carlson, some `pre-receive` hooks that
are actively used in practice want to color their messages and therefore
rely on the fact that Git passes them through to the terminal, even
though they have no way to determine whether the receiving side can
actually handle Escape sequences (think e.g. about the practice
recommended by Git that third-party applications wishing to use Git
functionality parse the output of Git commands).

In contrast to other ANSI escape sequences, it is highly unlikely that
coloring sequences can be essential tools in attack vectors that mislead
Git users e.g. by hiding crucial information.

Therefore we can have both: Continue to allow ANSI coloring sequences to
be passed to the terminal by default, and neutralize all other ANSI
Escape sequences.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/sideband.txt
sideband.c
t/t5409-colorize-remote-messages.sh