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

[PATCH 0/5] Fix 'url.*.insteadOf' for submodule URLs

From
Johan Herland <johan@herland.net>
Date
Aug 3, 2008, 22:57 UTC
Message-ID
<200808040057.00221.johan@herland.net>

As suggested in a thread some time ago, one could redefine the URL used to fetch submodules by adding a 'url.*.insteadOf' rule prior to the first invocation of 'git submodule update'.

However, this does not work with current Git, because the super-repo config (which is home to the 'url.*.insteadOf' rule) is not consulted by the 'git clone' that is invoked by 'git submodule update'.

These patches fix this issue by making 'git submodule' explicitly rewrite the submodule URL according to the super-repo config, prior to calling 'git clone'.

In order for the 'git submodule' shell script to properly rewrite URLs, it must gain access to the URL rewriting functionality in remote.c. To expose the URL rewriting functionality to 'git submodule' (and others, if needed), a new option ('rewrite-url') has been added to 'git config'.

The patch series is based on master. Whether or not this should be considered for v1.6.0 is to be decided by Junio. (My personal opinion is that although we're late in the release cycle, the patches are fairly straightforward, and should not pose a great risk of regressions.)

Johan Herland (5):
  Add testcase for 'git submodule' with url.*.insteadOf set in the
    super-repo
  Teach 'git config' to rewrite URLs according to current
    url.*.insteadOf rules
  Add selftest for new option '--rewrite-url' to 'git config'
  Add documentation on the new --rewrite-url option to 'git config'
  Teach 'git submodule' to rewrite submodule URLs according to
    super-repo's rules
 Documentation/git-config.txt |   10 ++++++++++
 builtin-config.c             |   23 ++++++++++++++++++++++-
 git-submodule.sh             |    6 ++++++
 t/t1300-repo-config.sh       |   14 ++++++++++++++
 t/t7400-submodule-basic.sh   |   11 +++++++++++
 5 files changed, 63 insertions(+), 1 deletions(-)
Have fun!
...Johan
Next: Johan Herland
Message 1 of 12 in “Fix 'url.*.insteadOf' for submodule URLs”
  1. 0/5 Fix 'url.*.insteadOf' for submodule URLsJohan Herland, Aug 3, 2008
  2. 1/5 Add testcase for 'git submodule' with url.*.insteadOf set in the super-repoJohan Herland, Aug 3, 2008
  3. 1/5 Add testcase for 'git submodule' with url.*.insteadOf set in the super-repoJohan Herland, Aug 3, 2008
  4. 2/5 Teach 'git config' to rewrite URLs according to current url.*.insteadOf rulesJohan Herland, Aug 3, 2008
  5. 3/5 Add selftest for new option '--rewrite-url' to 'git config'Johan Herland, Aug 3, 2008
  6. 4/5 Add documentation on the new --rewrite-url option to 'git config'Johan Herland, Aug 3, 2008
  7. 5/5 Teach 'git submodule' to rewrite submodule URLs according to super-repo's rulesJohan Herland, Aug 3, 2008
  8. Johannes SchindelinAug 3, 2008
  9. Johan HerlandAug 3, 2008
  10. Junio C HamanoAug 4, 2008
  11. Johan HerlandAug 4, 2008
  12. Junio C HamanoAug 3, 2008

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.