Re: ./sync-all get & git submodule URL dissonance (was: It's one of those days...)

2013-08-22 Thread Ian Lynagh
On Thu, Aug 22, 2013 at 05:01:45PM +0200, Herbert Valerio Riedel wrote:
> 
> Btw, the implementation in sync-all at
> 
>  https://github.com/ghc/ghc/blob/master/sync-all#L897-L912
> 
> seems a bit confusing; the "submodule init" in the "if ($command eq
> "get" or $command eq "pull")" branch is probably never invoked.

I probably forgot to remove the old block in
https://github.com/ghc/ghc/commit/c3db2b2c449e21d0358f1ed4b7a5dd447477ac28


Thanks
Ian


___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs


./sync-all get & git submodule URL dissonance (was: It's one of those days...)

2013-08-22 Thread Herbert Valerio Riedel
On 2013-08-22 at 15:35:29 +0200, Ben Lippmeier wrote:

[...]

> I was confused because the ./sync-all script gets most of the repos
> with git:// style URLs, but then switches to http:// style URLs for
> sub modules.

well, that's because the 'sync-all' script is not clever enough to
rewrite the urls between the 'git submodule init' and the 'git submodule
update' invocations during an initial "sync-all get" operation.

Specifically, the proper way to do this (for an initial 'sync-all get';
it gets more complicated for non-initial 'sync-all get's) is:

 - before invoking 'git submodule update', iterate over the entries in
   "git config --get-regexp ^submodule" and

 - rewrite the repo URLs (by using 'git config' again), assuming that
   'http://git.haskell.org/' is the original repo-base/prefix which is
   to be replaced by the current $repo_base

 - proceed with 'git submodule update'


Btw, the implementation in sync-all at

 https://github.com/ghc/ghc/blob/master/sync-all#L897-L912

seems a bit confusing; the "submodule init" in the "if ($command eq
"get" or $command eq "pull")" branch is probably never invoked.


cheers,
hvr

___
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs