]> git.ipfire.org Git - thirdparty/git.git/commit
sideband: offer to configure sanitizing on a per-URL basis
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 16 Jan 2026 22:26:13 +0000 (22:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 23:43:03 +0000 (15:43 -0800)
commitc5b95e19562f0477459e9fa9f0ef89689083a6e2
treebf97add2593f55ef9bcc09b8dc4a50c61fde90fa
parentdf9d873f3ef01839e9b05e09c1cc910c7374887f
sideband: offer to configure sanitizing on a per-URL basis

The main objection against sanitizing the sideband that was raised
during the review of the sideband sanitizing patches, first on the
git-security mailing list, then on the public mailing list, was that
there are some setups where server-side `pre-receive` hooks want to
error out, giving colorful messages to the users on the client side (if
they are not redirecting the output into a file, that is).

To avoid breaking such setups, the default chosen by the sideband
sanitizing patches is to pass through ANSI color sequences.

Still, there might be some use case out there where that is not enough.
Therefore the `sideband.allowControlCharacters` config setting allows
for configuring  levels of sanitizing.

As Junio Hamano pointed out, to keep users safe by default, we need to
be able to scope this to some servers because while a user may trust
their company's Git server, the same might not apply to other Git
servers.

To allow for this, let's imitate the way `http.<url>.*` offers
to scope config settings to certain URLs, by letting users
override the `sideband.allowControlCharacters` setting via
`sideband.<url>.allowControlCharacters`.

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