git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-remote: load config whenever create_symref() might be called

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 27, 2020, 00:34 UTC
Message-ID
<CAPig+cQqObQj6djn_EvfurbwsEKuU2fB+GZ8EE1HA-Hn1hUkuQ@mail.gmail.com>
In-Reply-To
<X+e48UEE4wf3fMNI@pica>
On Sat, Dec 26, 2020 at 5:31 PM Jérémie Detrey <Jeremie.Detrey@altu.fr> wrote:
Show 11 quoted lines
> Junio C Hamano:
> > My gut feeling says that the best place to call git_config() on
> > git_default_config would actually be in cmd_remote(), immediately
> > before we call parse_options() to parse the main options shared by
> > all subcommands of "git remote".  Is there a reason why codepaths
> > other than the three you singled out should *not* be affected by the
> > basic set of configuration variables?
>
> No, none that I can think of. I'll leave more knowledgeable people
> than me confirm this, but if that's the way to go, I'll be happy to
> submit a revised patch following your suggestion :)

I took a quick look at builtin/remote.c. It appears that several of the subcommands already make their own calls to git_config(), each with its own special-purpose `config_fn_t` as argument. Jérémie's patch, which invokes git_config() for specific cases, therefore, is consistent with existing practice in that file. Taking the approach of calling git_config() once before parse_options() should be possible but would require more surgery. The end result after surgery likely would be more maintainable going forward, but the localized fixes his patch makes might be reasonable in the short term. (But I'm not an area expert, so don't take my word for it.)

Previous: Jérémie DetreyNext: Junio C Hamano
Message 4 of 5 in “git-remote: load config whenever create_symref() might be called”
  1. git-remote: load config whenever create_symref() might be calledJérémie Detrey, Dec 26, 2020
  2. Junio C HamanoDec 26, 2020
  3. Jérémie DetreyDec 26, 2020
  4. Eric SunshineDec 27, 2020
  5. Junio C HamanoDec 27, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.