git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Relative submodule URLs, and forks that haven't forked the submodule
@ 2014-06-11 10:15 Charles Brossollet
  2014-06-12 15:25 ` Fredrik Gustafsson
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Brossollet @ 2014-06-11 10:15 UTC (permalink / raw)
  To: git

Hi,

I'm banging my head on this problem: I have a central repo cloned by SSH, and a fork on the same server. The central remote is origin, and the fork is chbrosso-wip.

$ git remote -v | grep origin
origin  chbrosso@lltech:/git/lightct.git (fetch)
origin  chbrosso@lltech:/git/lightct.git (push)

$ git remote -v | grep chbrosso-wip
chbrosso-wip    chbrosso@lltech:~/prog/git/lightct.git (fetch)
chbrosso-wip    chbrosso@lltech:~/prog/git/lightct.git (push)

On a local working copy, fetched my fork and checked out a remote branch out of it. Its remote-tracking branch is on the fork.

$ git branch -vv | grep \*
* actor                         d98ec24 [chbrosso-wip/actor] (commit msg)

Now, submodules for this repo have relative URLs. And this is where the problem begins, because the submodule isn't forked, but resides only in origin.

But this shouldn't cause any problem, right? The docs says that if relative URL are used, they resolve using the origin URL. First issue, it's not the case:

$ cat .gitmodules
[submodule "motors"]
        path = motors
        url = ../motors.git
        branch = master
$ git submodule init motors
Submodule 'motors' (chbrosso@lltech:~/prog/git/motors.git) registered for path 'motors'

Here the submodule is registered on my fork, which doesn't exist, and it's wrong with what the documentation says.

Fine, I'll edit the .git/config entry to make it point to origin:

$ git config submodule.motors.url chbrosso@lltech:/git/motors.git

$ git config submodule.motors.url
chbrosso@lltech:/git/motors.git

$ ssh chbrosso@lltech "if  [ -d /git/motors.git ]; then echo 'ok'; fi"
Password:
ok

So the submodule's url is changed, and points to a correct path, let's update so that I can work

$ git submodule update motors
Password:
fatal: '~/prog/git/motors.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
Unable to fetch in submodule path 'motors'

That's right, it is still the old url, and I can't have my submodule!
Can someone explain what's going on? And how can I get my submodule in the working copy?

git version 1.9.2.msysgit.0 on Windows 7 SP1 64 bit

Thanks, 
—- 
Charles

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-12 18:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-11 10:15 Relative submodule URLs, and forks that haven't forked the submodule Charles Brossollet
2014-06-12 15:25 ` Fredrik Gustafsson
2014-06-12 16:05   ` Charles Brossollet
2014-06-12 18:05     ` W. Trevor King

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).