Merge branch 'pw/3.0-commentchar-auto-deprecation'

"core.commentChar=auto" that attempts to dynamically pick a
suitable comment character is non-workable, as it is too much
trouble to support for little benefit, and is marked as deprecated.

* pw/3.0-commentchar-auto-deprecation:
  commit: print advice when core.commentString=auto
  config: warn on core.commentString=auto
  breaking-changes: deprecate support for core.commentString=auto
This commit is contained in:
Junio C Hamano
2025-09-18 10:07:00 -07:00
14 changed files with 423 additions and 12 deletions

View File

@@ -239,6 +239,11 @@ These features will be removed.
+
The command will be removed.
* Support for `core.commentString=auto` has been deprecated and will
be removed in Git 3.0.
+
cf. <xmqqa59i45wc.fsf@gitster.g>
== Superseded features that will not be deprecated
Some features have gained newer replacements that aim to improve the design in

View File

@@ -531,9 +531,25 @@ core.commentString::
commented, and removes them after the editor returns
(default '#').
+
If set to "auto", `git-commit` would select a character that is not
ifndef::with-breaking-changes[]
If set to "auto", `git-commit` will select a character that is not
the beginning character of any line in existing commit messages.
Support for this value is deprecated and will be removed in Git 3.0
due to the following limitations:
+
--
* It is incompatible with adding comments in a commit message
template. This includes the conflicts comments added to
the commit message by `cherry-pick`, `merge`, `rebase` and
`revert`.
* It is incompatible with adding comments to the commit message
in the `prepare-commit-msg` hook.
* It is incompatible with the `fixup` and `squash` commands when
rebasing,
* It is not respected by `git notes`
--
+
endif::with-breaking-changes[]
Note that these two variables are aliases of each other, and in modern
versions of Git you are free to use a string (e.g., `//` or `⁑⁕⁑`) with
`commentChar`. Versions of Git prior to v2.45.0 will ignore