Subject: Re: [PATCH v2 3/3] docs: replace git_config to repo_config

From: Junio C Hamano <[email-masked]>
Date: Sat, 17 May 2025 06:39:41 -0700

K Jayatheerth <[email-masked]> writes:

> This change updates the example in cmd_psuh to use repo_config and
> repo_config_get_string_tmp instead of the global git_config functions.
>
> While git_config() accesses global configuration via the_repository,
> using repo_config() makes use of the repo parameter passed to built-in commands.
> This is the preferred pattern in the Git codebase,
> as it respects repository-specific configuration (e.g., .git/config)
> and avoids relying on global state.

Again, do not start with "I did this, I did that".  The reason why
you needed to do such things is a lot more important.

    Since this document was written, the built-in API has been
    updated a few times, but the document was left stale.  Adjust to
    the current best practices by calling repo_config() on the
    repository instance the subcommand implementation receives as a
    parameter, instead of calling git_config() that used to be the
    common practice.

or something like that, perhaps.