threads / discuss / 30552

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

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

## tl;dr

One message between May 18, 2012 and May 18, 2012.

replies: 0people: 1as markdown or json

Jon Seymour· May 18, 2012, 08:44 UTC · lore

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

← back to recent threads