git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/2] breaking-changes: deprecate support for core.commentChar=auto

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Jul 9, 2025, 09:38 UTC
Message-ID
<f1fad7f4-209f-47a9-8ad2-5e236c0b0006@gmail.com>
In-Reply-To
<xmqqy0syp30y.fsf@gitster.g>
On 09/07/2025 02:27, Junio C Hamano wrote:
Show 11 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes:
> 
>> This series implements the plan to deprecate and remove support for
>> core.commentChar=auto outlined in [1]. This feature has been the
>> source of a couple of bug reports recently [2,3] and as explained in
>> the first patch the design is tricky to fix.
> 
> FWIW, this fails some tests that expect "# commented lines" by
> treating "auto" too literally.
> 
> https://github.com/git/git/actions/runs/16157263228/job/45602188411#step:10:2970

That's a semantic conflict between this series and seen - the test should be marked !WITH_BREAKING_CHANGES as it is testing core.commentChar=auto

Show 14 quoted lines
> I wonder if our braincycles are better spent to actually perform the
> "tricky"[*] fix than deprecating the feature and then perfecting the
> deprecation process (which does not seem to be without cost either).
> 
>   - We can and should keep the "auto" magic and use '#' when it gets
>     specified, if we really wanted to do this deprecation.  I am not
>     a huge fan of it, though.
> 
>   - Or leave it as a known-broken feature in certain corner cases,
>     which may motivate some future developers to tackle these
>     "tricky" code paths.  If we were to go this route, the first step
>     would be to document what works and what does not as "known
>     limitations".  I am slightly more in favor of this than "we punt,
>     because we cannot fix it", but not by a large margin.

I've thought about fixing it but I don't see a good way for templates and hooks to say "lines that begin with this character are comments" - for a hook the choice of comment char needs to be based on the message so we cannot use a fixed config setting. Unless we have a way of doing that it is never going to work. The cherry-pick/rebase issues could be addressed by writing some state that is then read by "git commit" though goodness knows how we'd make that work with the prepare-commit-msg hook that wants to introduce its own comments. I don't really see the point of just fixing the rebase case if templates and hooks are still broken.

Now that the commentChar can be an arbitrary string rather than just a single byte I think is much easier for users to pick something unique that isn't going to be at the start of a line in their commit messages.

Best Wishes
Phillip
Previous: Ayush ChandekarNext: Phillip Wood
Message 17 of 45 in “breaking-changes: deprecate support for core.commentChar=auto”
  1. 0/2 breaking-changes: deprecate support for core.commentChar=autoPhillip Wood, Jul 8, 2025
  2. 1/2 breaking-changes: deprecate support for core.commentString=autoPhillip Wood, Jul 8, 2025
  3. Ayush ChandekarJul 8, 2025
  4. Phillip WoodJul 9, 2025
  5. 2/2 commit: print advice when core.commentString=autoPhillip Wood, Jul 8, 2025
  6. Junio C HamanoJul 8, 2025
  7. Phillip WoodJul 9, 2025
  8. Junio C HamanoJul 9, 2025
  9. Phillip WoodJul 11, 2025
  10. Junio C HamanoJul 11, 2025
  11. Oswald BuddenhagenJul 12, 2025
  12. Junio C HamanoJul 12, 2025
  13. Junio C HamanoJul 26, 2025
  14. Phillip WoodJul 27, 2025
  15. Junio C HamanoJul 9, 2025
  16. Ayush ChandekarJul 9, 2025
  17. Phillip WoodJul 9, 2025
  18. 0/3 breaking-changes: deprecate support for core.commentChar=autoPhillip Wood, Jul 31, 2025
  19. 1/3 breaking-changes: deprecate support for core.commentString=autoPhillip Wood, Jul 31, 2025
  20. Junio C HamanoJul 31, 2025
  21. 2/3 config: warn on core.commentString=autoPhillip Wood, Jul 31, 2025
  22. Junio C HamanoJul 31, 2025
  23. Phillip WoodAug 1, 2025
  24. Oswald BuddenhagenAug 1, 2025
  25. 3/3 commit: print advice when core.commentString=autoPhillip Wood, Jul 31, 2025
  26. Oswald BuddenhagenAug 1, 2025
  27. Junio C HamanoAug 1, 2025
  28. Phillip WoodAug 26, 2025
  29. Oswald BuddenhagenAug 27, 2025
  30. Junio C HamanoAug 27, 2025
  31. Oswald BuddenhagenAug 27, 2025
  32. Junio C HamanoAug 1, 2025
  33. Phillip WoodAug 1, 2025
  34. Junio C HamanoAug 1, 2025
  35. 0/3 breaking-changes: deprecate support for core.commentChar=autoPhillip Wood, Aug 26, 2025
  36. 1/3 breaking-changes: deprecate support for core.commentString=autoPhillip Wood, Aug 26, 2025
  37. 3/3 commit: print advice when core.commentString=autoPhillip Wood, Aug 26, 2025
  38. 2/3 config: warn on core.commentString=autoPhillip Wood, Aug 26, 2025
  39. Junio C HamanoAug 26, 2025
  40. Phillip WoodAug 27, 2025
  41. Junio C HamanoAug 27, 2025
  42. 0/3 breaking-changes: deprecate support for core.commentChar=autoPhillip Wood, Aug 27, 2025
  43. 1/3 breaking-changes: deprecate support for core.commentString=autoPhillip Wood, Aug 27, 2025
  44. 2/3 config: warn on core.commentString=autoPhillip Wood, Aug 27, 2025
  45. 3/3 commit: print advice when core.commentString=autoPhillip Wood, Aug 27, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.