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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



K Jayatheerth <jayatheerthkulkarni2005@xxxxxxxxx> 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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux