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

Re: 'git submodules update' ignores credential.helper config of the parent repository

From
Stefan Beller <sbeller@google.com>
Date
Feb 27, 2017, 19:09 UTC
Message-ID
<CAGZ79ka8saQMKeutE415WxOQ71MnEw1A4uV3b0Pa4gcehx8pdw@mail.gmail.com>
In-Reply-To
<CAC+L6n0YeX_n_AysCLtBWkA+jPHwg7HmOWq2PLj75byxOZE=qQ@mail.gmail.com>

On Mon, Feb 27, 2017 at 5:33 AM, Dmitry Neverov <dmitry.neverov@gmail.com> wrote:>

>   git -c credential.helper= submodule update
>
> Is it by design?

A similar question came up w.r.t. submodule configuration recently. It is about url.<URLISH>.insteadOf[1] that is set in the super project and is expected to work in the submodules. More reading on some background there, as it is the very same problem: Which configuration should propagate to the submodules, how do we tell the users and can the user influence if some articular settings are propagated?

For both these settings (url...insteadOf and the credentialHelper) one might think that they absolutely should be propagated to the submodules, but that may not be true; e.g. a submodule might be hosted at a different hosting provider, needing a different credentials setup. (The submodule might be an open source library that you use, which may even require no credentials at all)

So I think we have to come up with a generic solution to respect certain settings of the superproject instead of e.g. hard coding credential.helper to be looked up in the superproject.

So the current proposal (in that mentioned thread) is
to borrow the idea from worktrees that have a similar problem:
split up the config into multiple files and each file applies to
a different worktree or in our case we would have
(A) a config file that applies to the superproject;
(B) a config file that applies to both superproject
     and all submodules
(C) and each submodule has its own config file as well.

--- For worktrees these multiple config files sounded like the obvious solution, but I wonder if there was also some bike shedding about other solutions?

I could imagine that we would want to have attributes for specific configuration, e.g.:

--8<--
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = git://github.com/gitster/git
    fetch = +refs/heads/*:refs/remotes/origin/*
[attribute "submodules"]
    read = true
# this will be read and respected by submodules as well:
[url."internal-git-miror"]
    insteadOf = github.com
[attribute "submodules"]
    read = false
# This (and the beginning of this file) will not be respected
# by submodules
[credential]
    helper =
-->8--

This would change the semantics of a config file as the attribute for each setting depends on the location (was attribute.FOO.read = {true, false} read before).

This would be read-compatible with older versions of Git, and it seems as if it were write compatible as well. Just writing a new value with a specifc attribute would be interesting to implement.

Thanks, Stefan

[1] https://public-inbox.org/git/84fcb0bd-85dc-0142-dd58-47a04eaa7c2b@durchholz.org/
Previous: Dmitry NeverovNext: Jeff King
Message 2 of 7 in “'git submodules update' ignores credential.helper config of the parent repository”
  1. Dmitry NeverovFeb 27, 2017
  2. Stefan BellerFeb 27, 2017
  3. Jeff KingFeb 28, 2017
  4. Stefan BellerFeb 28, 2017
  5. Jeff KingFeb 28, 2017
  6. Stefan BellerFeb 28, 2017
  7. Jeff KingFeb 28, 2017

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.