]> git.ipfire.org Git - thirdparty/git.git/commit
config: add core.commentString
authorJeff King <peff@peff.net>
Wed, 27 Mar 2024 08:19:22 +0000 (04:19 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Mar 2024 15:48:54 +0000 (08:48 -0700)
commit9ccf3e9b22b6843892319b189fd7aed37c451420
treeaaf233162df938b5609b1961318d14d154e04f46
parent8b311478ad16b2fe9d2f5b5febec9f5e8f7fd52d
config: add core.commentString

The core.commentChar code recently learned to accept more than a
single ASCII character. But using it is annoying with multiple versions
of Git, since older ones will reject it outright:

    $ git.v2.44.0 -c core.commentchar=foo stripspace -s
    error: core.commentChar should only be one ASCII character
    fatal: unable to parse 'core.commentchar' from command-line config

Let's add an alias core.commentString. That's arguably a better name
anyway, since we now can handle strings, and it makes it possible to
have a config that works reasonably with both old and new versions of
Git (see the example in the documentation).

This is strictly an alias, so there's not much point in adding duplicate
tests; I added a single one to t0030 that exercises the alias code.

Note also that the error messages for invalid values will now show the
variable the config parser handed us, and thus will be normalized to
lowercase (rather than camelcase). A few tests in t0030 are adjusted to
match.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/core.txt
config.c
t/t0030-stripspace.sh