Subject: Re: [PATCH] repo-settings: move warn_on_object_refname_ambiguity to repo_settings

From: Junio C Hamano <[email-masked]>
Date: Fri, 27 Feb 2026 14:37:48 -0800

drona <[email-masked]> writes:

> From: Dorna Raj Gyawali <[email-masked]>
>
> 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.

>  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.