Re: [PATCH] repo-settings: move warn_on_object_refname_ambiguity to repo_settings
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 27, 2026, 22:37 UTC
- Message-ID
- <xmqqtsv1ols3.fsf@gitster.g>
- In-Reply-To
- <20260227125654.249676-1-dronarajgyawali@gmail.com>
drona <dronarajgyawali@gmail.com> writes:
Show 6 quoted lines
> From: Dorna Raj Gyawali <dronarajgyawali@gmail.com> > > This flag (default: true) controls whether warnings are printed when > disambiguating object names that match multiple refname prefixes. > Move it from a global variable in environment.c to struct repo_settings > to reduce global state.
I am not sure why this needs to be per-repository, though. It is very understandable if this were a per-user preference coming from the ~/.gitconfig file, and then it makes a lot more sense to keep it a process-wide global.
Show 10 quoted lines
> builtin/cat-file.c | 6 +++--- > builtin/pack-objects.c | 6 +++--- > environment.c | 1 - > environment.h | 1 - > object-name.c | 2 +- > repo-settings.c | 10 ++++++++++ > repo-settings.h | 7 ++++++- > revision.c | 6 +++--- > submodule.c | 6 +++--- > 9 files changed, 29 insertions(+), 16 deletions(-)
Even in a distant future where these files are used to implement a long running multi-user multi-repository "git server", we would probably want to create a per-user structure that holds personal preference items and throw this variable in there, not in the per-repository repo_settings struct.
So,... I dunno.