From: Junio C Hamano Date: Tue, 24 Nov 2026 20:24:21 GMT Subject: Re: [PATCH] var: add GIT_COMMENT_STRING Message-ID: In-Reply-To: Phillip Wood writes: > From: Phillip Wood > > 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.