Herbert Valerio Riedel hvriedel at
Thu Oct 2 08:20:38 UTC 2014

On 2014-10-02 at 09:49:11 +0200, Simon Peyton Jones wrote:
> Herbert says (in bold font) "do not ever use sync-all", in this post
> If that's really true, we should either nuke it altogether, or change
> it to do something correct.  The idea that it might "set up your tree
> in subtly different ways" is alarming.

To clarify what I mean by that:

For users just wanting to clone ghc.git now and just wanting to keep
their tree updated, I'd recommend doing the following one-shot
convenience configuration setup (see [1] for more details):

  git config --global alias.pullall '!f(){ git pull "$@" && git submodule update --init --recursive; }; f'
And then clone simply via

  git clone --recursive

(or use https:// or git:// or whatever) and to keep the tree simply use

  git pullall --rebase

(`pullall` just saves you from having to call
`git pull`+`git submodule update --init` yourself)

In contrast, `sync-all` is a multi-step process:

 1.) you need to clone ghc.git, 

 2.) then you have a sync-all, which when called
     will `git submodule init` (which doesn't yet download the

 3.) rewrites the fetch-urls in each initialised submodule

 4.) finally calls `git submodule update` to fetch the submodule and
     checkout the commits registered in ghc.git

The difference become apparent when wanting to use github instead; my
recommended approach is to use the URL rewriting feature of GitHub which
even allows you to easily switch between and
with a single command, or in its simpler form (as described on [2]):

Only needed once, and idempotent setup step:

  git config --global url."git://".insteadOf  git:// 

And then just as before:

  git clone --recursive git://

So long story short; I've mostly got a bad gut feeling recommending to
use a 1000-line Perl script

to accomplish what the 2 `git config` commands and the the day-to-day
`git` commands I mentioned in this email can do in a more Git-idiomatic

So I'm not saying `sync-all` is doing something wrong, but rather that's
overly complex for the task at hand, and we've had support issues with
`sync-all` due to subtle bugs in it (just check the git history for
sync-all to see the tweaks we needed). Moreover, IMHO, if someone's
already proficient with Git, telling them to use `sync-all` will rather
confuse than help as it's not that transparent what it really does.



More information about the ghc-devs mailing list