summaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2025-08-26 14:35:27 +0100
committerJunio C Hamano <gitster@pobox.com>2025-08-26 08:52:44 -0700
commita0e6aaea7da5134bdc784c6d68d4cc2125865330 (patch)
treebeb4c0512ab49f0e84a619372b1bf425b8d8140d /builtin/merge.c
parentfdae4114a696014b6bf28ad9b1bc076bd8d7eec8 (diff)
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>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index dc4cb8fb14..794cb7bb26 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1378,6 +1378,9 @@ int cmd_merge(int argc,
show_usage_with_options_if_asked(argc, argv,
builtin_merge_usage, builtin_merge_options);
+#ifndef WITH_BREAKING_CHANGES
+ warn_on_auto_comment_char = true;
+#endif /* !WITH_BREAKING_CHANGES */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;