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

git submodule: git sync does the wrong thing if the origin URL is relative

From
Jon Seymour <jon.seymour@gmail.com>
Date
May 18, 2012, 08:44 UTC
Message-ID
<CAH3Anrr6mLVedBPcgfVwy=5KRjUgdp5W8P0DQ3qaX_UjH-npDw@mail.gmail.com>

The following is a test case that demonstrates a problem with the heuristic that git sync uses to update the origin URL of submodules in the case that the origin URL of the super module itself is a relative URL

I think what it should be doing is prefixing the relative path between the submodule and the supermodule to the supermodules origin URL as well as doing what it currently does with the suffix.

Does anyone disagree?
jon.
--

#!/bin/sh mkdir work && cd work && rm -rf public && rm -rf checkout && rm -rf private && mkdir public && mkdir checkout && mkdir -p private/progenitor && cd private/progenitor && git init && mkdir child && pushd child && git init && :> .gitignore && git add .gitignore && git commit -m "initial child" && popd && git submodule add ../progenitor/child ./child && git commit -m "initial progenitor" && git clone --bare . ../../public/progenitor.git && git clone --bare child ../../public/progenitor/child.git && cd ../../checkout && git clone ../public/progenitor.git progenitor && cd progenitor && git submodule init && git submodule update --rebase && git fetch origin && git submodule foreach git fetch origin && git remote set-url origin ../../public/progenitor.git && git submodule sync && git submodule update --rebase && git fetch origin && git submodule foreach git fetch origin

Message 1 of 1 in “git submodule: git sync does the wrong thing if the origin URL is relative”
  1. Jon SeymourMay 18, 2012

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.