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

Re: core.sshCommand and url.*.insteadOf for submodules

From
Stefan Beller <sbeller@google.com>
Date
Jan 5, 2017, 17:30 UTC
Message-ID
<CAGZ79kYPuqYTAFe9c0kQxrREfEPtuT_OT4ZsFAz-c1UPW3k9yQ@mail.gmail.com>
In-Reply-To
<20170105170214.6fmsbj6ltbmpvcfb@sigill.intra.peff.net>
On Thu, Jan 5, 2017 at 9:02 AM, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> On Thu, Jan 05, 2017 at 05:53:30AM -0800, Stefan Beller wrote:
>
>> > My scenario is as follows: I use 2 SSH keys for GitHub, for private and
>> > work-related repositories. My default key is my private key. So when I
>> > clone a work repository and try getting the submodules, `git submodule
>> > update --init` fails. This is also the case when setting
>> > `core.sshCommand` and `url.*.insteadOf` (useful for substituting
>> > "github.com" by some ~/.ssh/config'ured host).
>>
>> which is why e.g.
>> git config --global url.https://github.com/.insteadOf git://github.com/
>> is not your preferred way here.
>>
>> There was some discussion a couple of weeks ago, which settings
>> should be kept when recursing into submodules, Jacob and Jeff cc'd.
>
> The only discussion I recall was from last May. But that was about "-c"
> config on the command-line, and the end decision was that we pass it all
> down to submodules, per 89044baa8b (submodule: stop sanitizing config
> options, 2016-05-04).
Oh, yeah that was the difference.
>
> I think the problem here is more about propagating options from the
> superproject's repo-level config into the submodules. AFAIK we do not do
> that at all, but I may have missed some patches in that area.
AFAIK there were no such patches yet.
Show 6 quoted lines
>
> Another approach would be conditional config includes based on the repo
> path. With the patches discussed in [1], you could do something like:
>
>   git config --global include./path/to/work/repos.path .gitconfig-work
>   git config -f ~/.gitconfig-work url.foo.insteadOf bar

Or maybe we could specialize these patches to allow includes from specific other repos, i.e. superproject(s) or worktrees.

>
> -Peff
>
> [1] http://public-inbox.org/git/20160626070617.30211-1-pclouds@gmail.com/
Previous: Jeff King
Message 4 of 4 in “core.sshCommand and url.*.insteadOf for submodules”
  1. Stefan SchindlerJan 5, 2017
  2. Stefan BellerJan 5, 2017
  3. Jeff KingJan 5, 2017
  4. Stefan BellerJan 5, 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.