Amber Blog

Amber Smalltalk and more

Cloning All Amber Repositories

Let’s say you are a developer working on Amber itself and you need to switch to a new development computer. You’ll then find yourself in the need of cloning all Amber related repositories.

As of now you will most probably go through the repository list from https://github.com/amber-smalltalk, select the Git URL and issue a git clone. It is a bit of work, yes, but currently there are only 3 to 4 repositories.

Now imagine that a new release is pending and all repositories need to be brought up to date to test the latest features. So you will go to each directory and do a git pull. Yeah, not much you say.

So let’s take a look into the future of Amber where the amount of different repositories will have increased. If the amount of repositories exceeds 4 to 5 the synchronisation of all of them gets quite boring and is a lot of manual work.

Exactly this situation was encountered by Google during the development of Android. As a solution they created the repo tool which is built on top of Git to manage multiple repositories. However, using repo is not limited to Android itself.

Starting from today a repo configuration for Amber repositories is available at https://github.com/mkroehnert/amber-repo-config.git. How to install repo and how to clone the Amber projects is explained in more detail in the README file of the repository. But basically it boils down to the following commands:

bash
1
2
3
4
5
6
7
8
9
> mkdir amber-smalltalk

> cd amber-smalltalk

> repo init -u https://github.com/mkroehnert/amber-repo-config.git

> repo sync

> repo start master --all # can be omitted once an initial checkout has been done

Afterwards, it will be as easy to update all repositories at once by running repo sync inside the amber directory. But be aware that repo sync will do a rebase of the current branch onto origin/master. Therefore, I’d advise you to do a checkout of the master branch in all repositories with repo forall -c "git checkout master" before actually doing a sync.

One last note for Mac users: the directory which is used for synchronisation /MUST/ be located on a case sensitive file system (the harddrive is usually formatted as case preserving). If you don’t want to reformat your whole computer it is possible to use disk images (DMG’s) which are formated with a case sensitive HFS+ file system.

Since repo is a tool of its own built on top of Git it has a learning curve for itself. So use it at your own risk ;–). But if you are already very familiar with Git you might find repo very handy once you got to know how it works.