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

Re: [PATCH] var: add GIT_COMMENT_STRING

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 24, 2026, 20:24 UTC
Message-ID
<xmqqh5h6ou4q.fsf@gitster.g>
In-Reply-To
<fa8b80af26481e0dc96fd8f80f3c7ba84f60f9d4.1795516651.git.phillip.wood@dunelm.org.uk>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 17 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> Since commit 9ccf3e9b22 (config: add core.commentString, 2024-03-27) we
> have two separate config keys that set the comment string used by git
> when creating template commit messages etc. As that commit notes, when
> core.commentString is set to a multi-byte string, it can be useful to
> keep core.commentChar set to a single chararcter for compatibilty with
> older versions of git. That makes it awkward for scripts to determine
> what the comment chararcter is because they need to do something like
>
>     {
>         echo ' #'
>         git config --get-regex '^core.comment(char|string)$'
>     } | sed -n '$s/^[^ ] //p'
>
> Add GIT_COMMENT_STRING to "git var" to make it easier for scripts to
> determine the comment character.

It is somewhat unfortunate that we honor last-one-wins across two variables (otherwise it would have been just the matter of using core.commentString, falling back to core.commentChar).

But the motivation is good.
Previous: Kristoffer Haugsbakk
Message 3 of 3 in “var: add GIT_COMMENT_STRING”
  1. var: add GIT_COMMENT_STRINGPhillip Wood, Nov 24, 2026
  2. Kristoffer HaugsbakkNov 24, 2026
  3. Junio C HamanoNov 24, 2026

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.