git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Toolforger <toolforger@durchholz.org>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: url.<base>.insteadOf vs. submodules
Date: Mon, 20 Feb 2017 21:31:40 +0100	[thread overview]
Message-ID: <404d109f-e5a7-85a3-e64c-ab1b21c3045d@durchholz.org> (raw)
In-Reply-To: <20170220090115.6kfzwl62opj4q7k7@sigill.intra.peff.net>

On 20.02.2017 10:01, Jeff King wrote:
> On Sun, Feb 19, 2017 at 10:12:28PM +0100, Toolforger wrote:
>
>> I am trying to make url.<base>.insteadOf work on the URLs inside
>> .gitmodules, but it won't work (applying it to the repo itself works fine,
>> to the config setting seems to be fine).
>
> The submodule operations happen in their own processes, and do not look
> at the config of the parent repo.

Ah, then we have a docbug.
git help config has this to say:

url.<base>.insteadOf
     Any URL that starts with this value will be rewritten to start,
     instead, with <base>.

The "Any" here is wrong, it would be "any except submodule" (possibly 
other exceptions).

 > Are you setting the config in
> .git/config of the super-project?

Exactly.
My thinking was that since the submodule URLs are specified in the super 
project's .gitmodules, that setting should apply.

> I don't know if there plans to make that work,

It would certainly help me out, though I guess it's going to be too late 
for my current project :-)

 > but one workaround is to set the config in ~/.gitconfig.

No can do - that's under version control.
My personal setup does not belong there I think ;-)

I am currently trying to write a shell script that
- does git submodule init
- pulls submodule configuration out of git config -l
- configures each submodule with insteadOf
It fits with my workflow because setting up the repositories is going to 
be done via script anyway.
I'm neither a shell nor a git expert, so any advice still appreciated.

Regards,
Jo

  reply	other threads:[~2017-02-20 20:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19 21:12 url.<base>.insteadOf vs. submodules Toolforger
2017-02-20  9:01 ` Jeff King
2017-02-20 20:31   ` Toolforger [this message]
2017-02-20 20:52     ` Jeff King
2017-02-21  5:11       ` Toolforger
2017-02-21  7:06         ` Jeff King
2017-02-21 18:19           ` Stefan Beller
2017-02-21 23:00             ` Jeff King
2017-02-21 23:16               ` Stefan Beller
2017-02-21 23:37                 ` Junio C Hamano
2017-02-21 23:59                   ` Junio C Hamano
2017-02-22  0:07                   ` Stefan Beller
2017-02-22  2:59                     ` Junio C Hamano
2017-02-22 14:00                       ` Jon Loeliger
2017-02-22 17:36                         ` Junio C Hamano
2017-02-22 18:57                           ` Jeff King
2017-02-22 19:11                             ` Stefan Beller
2017-02-21 23:40                 ` Jeff King
2017-02-22  0:10                   ` Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=404d109f-e5a7-85a3-e64c-ab1b21c3045d@durchholz.org \
    --to=toolforger@durchholz.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).