]> git.ipfire.org Git - thirdparty/git.git/commit
config: warn on core.commentString=auto
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 26 Aug 2025 13:35:27 +0000 (14:35 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Aug 2025 15:52:44 +0000 (08:52 -0700)
commita0e6aaea7da5134bdc784c6d68d4cc2125865330
treebeb4c0512ab49f0e84a619372b1bf425b8d8140d
parentfdae4114a696014b6bf28ad9b1bc076bd8d7eec8
config: warn on core.commentString=auto

As support for this setting was deprecated in the last commit print a
warning (or die when WITH_BREAKING_CHANGES is enabled) if it is set.
Avoid bombarding the user with warnings by only printing it (a) when
running commands that call "git commit" and (b) only once per command.

Some scaffolding is added to repo_read_config() to allow it to
detect deprecated config settings and warn about them. As both
"core.commentChar" and "core.commentString" set the comment
character we record which one of them is used and tailor the
warning message appropriately.

Note the odd combination of die_message() followed by die(NULL)
is to allow the next commit to insert a call to advise() in the middle.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
builtin/merge.c
builtin/rebase.c
builtin/revert.c
config.c
environment.c
environment.h
repository.c
repository.h
t/t3404-rebase-interactive.sh
t/t7502-commit-porcelain.sh