{"thread":{"id":"30552","subject":"git submodule: git sync does the wrong thing if the origin URL is relative","startedAt":"2012-05-18T08:44:28Z","lastAt":"2012-05-18T08:44:28Z","messageCount":1,"participants":["Jon Seymour"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"191650","messageId":"CAH3Anrr6mLVedBPcgfVwy=5KRjUgdp5W8P0DQ3qaX_UjH-npDw@mail.gmail.com","threadId":"30552","inReplyTo":null,"subject":"git submodule: git sync does the wrong thing if the origin URL is relative","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-18T08:44:28Z","receivedAt":"2012-05-18T08:44:28Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"The following is a test case that demonstrates a problem with the\nheuristic that git sync uses to update the origin URL of submodules in\nthe case that the origin URL of the super module itself is a relative\nURL\n\nI think what it should be doing is prefixing the relative path between\nthe submodule and the supermodule to the supermodules origin URL as\nwell as doing what it currently does with the suffix.\n\nDoes anyone disagree?\n\njon.\n\n--\n\n#!/bin/sh\nmkdir work &&\ncd work &&\nrm -rf public &&\nrm -rf checkout &&\nrm -rf private &&\nmkdir public &&\nmkdir checkout &&\nmkdir -p private/progenitor &&\ncd private/progenitor &&\ngit init &&\nmkdir child &&\npushd child &&\ngit init &&\n:> .gitignore &&\ngit add .gitignore &&\ngit commit -m \"initial child\" &&\npopd &&\ngit submodule add ../progenitor/child ./child &&\ngit commit -m \"initial progenitor\" &&\ngit clone --bare . ../../public/progenitor.git &&\ngit clone --bare child ../../public/progenitor/child.git &&\ncd ../../checkout &&\ngit clone ../public/progenitor.git progenitor &&\ncd progenitor &&\ngit submodule init &&\ngit submodule update --rebase &&\ngit fetch origin &&\ngit submodule foreach git fetch origin &&\ngit remote set-url origin ../../public/progenitor.git &&\ngit submodule sync &&\ngit submodule update --rebase &&\ngit fetch origin &&\ngit submodule foreach git fetch origin\n"}]}