CRUX : Home

Home :: Documentation :: Download :: Development :: Community :: Wiki :: Ports :: Bugs :: Links :: About

Working with the contrib repository

Note: this is a practical description intended for contrib maintainers; for information on how to join the project see the HowToContribute and ContribRules pages.

Generic git documentation

Some familiarity with git is recommended: Here you can find the manual pages and some nice tutorial.

The contrib-test repository

There's a repository called contrib-test.git that you can use for your very first steps with git. It's not connected to the real contrib.git repository, so you cannot break anything when working with it.

Before starting

To tell git who you are and to define some useful defaults, set up ~/.gitconfig like this:

    email =
    name = Your RealName
    default = current

Now configure ssh for access at edit ~/.ssh/config and add:

    Port 2222

Getting the repository

$ git clone ssh:// contrib

Configuring branches

The previous command should clone the latest available contrib repository into a "contrib" directory. Now run the following commands to configure branches:

$ git branch 3.3 origin/3.3
$ git branch 3.4 origin/3.4

This tells git to grab the necessary branches.
Note that the new contrib repository has one branch for each CRUX version, thus giving the possibility to work on a future release and backport updates to a previous one, much like the core and opt collections.
When development for a new CRUX version has started, you can simply add this new branch to your local repository, i.e.:

$ git branch 3.4 origin/3.4

Checking out a branch

After cloning and initial configuration, select the branch you want to work on, ie:

$ git checkout 3.3

You can list the available branches and display the active one with

$ git branch

Adding a port

$ cp -r $PATH/myport .
$ git add myport
$ git commit -m "myport: initial commit"
$ git push

Removing a port

$ git rm -r someport
$ git commit -m "someport: removed from repository"
$ git push

Modifying a port

$ cd PATH/TO/WORKING/COPY/someport
(edit files, ie Pkgfile and .md5sum)
    $ git add Pkgfile .md5sum [...]
    $ git commit -m "someport: updated to 3.22"
or directly:
    $ git commit -m "someport: updated to 3.22" Pkgfile .md5sum [...]
$ git push

If you run in trouble with the last command, because someone else has modified the repository in the meantime, run the following commands (ie to "fix" branch 3.3):

$ git fetch
$ git rebase origin/3.3
$ git log
$ git push

Merging branches

Let's say that you have two branches, 3.3 and 3.4. If you now modify one or more ports in branch 3.3, it's possible to merge these changes easily into another branch, ie 3.4:

$ git checkout 3.4
$ git pull . 3.3

But use this option with care as it will merge all changes (since the last merge) into branch 3.3

Updating your working copy

$ git fetch
updating branch 3.4:
    $ git checkout 3.4
    $ git rebase origin/3.4
updating branch 3.3:
    $ git checkout 3.3
    $ git rebase origin/3.3