On 09/07/2025 17:20, Junio C Hamano wrote:
Phillip Wood <phillip.wood123@xxxxxxxxx> writes:
With hindsight I should have been clearer here that the advice given
is based on the user's config settings.
Ahh, OK. If the "hint" advice message gets generated with custom
sequence of commands, that explains why the sample looked so uneven.
Disregard what I said about clearing every variant from every scope.
The advice will recommend a command that updates commentChar in the
scope where it is currently set so if it is set globally it will not
prompt you to set it locally in each repository and if it is set
locally it will prompt you to update it there.
Again, I misunderstood the set-up that would lead to the sample
output. If the user has "auto" in ~/.gitconfig, replacing it at the
same place may make sense.
If the "auto" comes from /etc/gitconfig then we'd recommend
changing it there, instead of overriding it per-user in ~/.gitconfig?
Yes, though I'm on the fence about that. I wonder if we should recommend
~/.gitconfig instead if the user account that git is running under does
not have write access to /etc/gitconfig. That also raises the question
of what advice we should give about clearing settings in the system
config file if the user does not have write access to it. It is possible
the human user has write access to the system config even if the user
account that git is running under does not but we have no way of finding
that out.
It would be necessary to special case "auto" after 3.0 boundary
anyway, whether we (1) die when we notice the value is set to
"auto", and refuse to work until the user chooses a comment char, or
(2) use "#" or something hardcoded. Either would be better than
using literal string "auto" as comment char.
I'm leaning towards dying to avoid any nasty surprises when the commit
message contains lines beginning with '#'.
I'll try and re-roll next week
Thanks
Phillip