Difference between revisions of "GitSuperRepoUsersGuide"

From Einstein Toolkit Documentation
Jump to: navigation, search
(Viewing history)
(Viewing history)
Line 64: Line 64:
 
==Viewing history==
 
==Viewing history==
  
Each sub-repository is a separate fully-fledged Git repository, so you can go into each one and type "git status", "git log" etc.  This works for repositories which are SVN upstream, because we use git-svn to convert the repositories to Git on the server.  You can also use the usual graphical tools (we recommend [http://gitx.laullon.com/ GitX] for Mac OS, and git-gui/gitk for Linux) on each subrepository to visualise the log messages and patches, see which files have local changes, and interactively commit parts of files.
+
In addition to the super repository being a git repository, each sub-repository is a separate fully-fledged Git repository, so you can go into each one and type "git status", "git log" etc.  This works for repositories which are SVN upstream, because we use git-svn to convert the repositories to Git on the server.  You can also use the usual graphical tools (we recommend [http://gitx.laullon.com/ GitX] for Mac OS, and git-gui/gitk for Linux) on each subrepository to visualise the log messages and patches, see which files have local changes, and interactively commit parts of files.
  
 
==Viewing local modifications==
 
==Viewing local modifications==

Revision as of 14:09, 27 June 2011


We provide a Git super-repo of the Einstein Toolkit. This page describes how to check it out and work with it. It is currently more of a tutorial than a User Guide.

Checking out

 git clone --recursive cactus@git.einsteintoolkit.org:einsteintoolkit Cactus

This takes about 10 minutes and will create a directory called Cactus containing the entire Einstein Toolkit and all its version history. When it is done, setup the git-module package which provides convenience functionality:

 cd Cactus
 ./bin/git-module setup && source ~/.profile

Updating

Before updating, it is first a good idea to see what would be changed. First enter the top-level super-repo directory and get any available updates:

 git fetch && git submodule foreach git fetch

You can get a list of the changes using

 git log --reverse --oneline -p --submodule master..origin/master $(git submodule|awk '{print $2}')

If this looks OK, you can then update using:

 git pull
 git submodule update

Checking out a specific branch

If you want to use a particular Einstein Toolkit release, perhaps because the current development version is unstable, use

 git checkout ET_2011_06 && git module checkout --all

The tree will be very quickly updated to match the release. All changed files will have updated datestamps, so you should be able to trust the Cactus make system to recompile only what is necessary. However, it might be safer to delete any configurations and build them again.

Committing

For sub-repositories which are upstream (as most are), regardless of which revision control system is used upstream you must first initialise the sub-repository for committing:

 git module init-upstream <submodule-path>

from the root Cactus (super-repo) directory. You can get a list of the available submodules with "git module ls" or by using tab completion if your shell is bash. Once you have completed this process for a submodule, the method of pushing depends on the version control system used upstream.

Git

For thorns whose source repositories are in Git already, you can commit and push as normal in the subrepositories.

 git push upstream ...

SVN

For submodules which use SVN upstream, you can commit directly to the source SVN repository using, from the submodule directory,

 git svn dcommit

assuming you have commit rights in the source SVN repository. This will push any local commits to SVN.

Mercurial

For Mercurial upstream repositories, it is more complicated, as there is no git-hg (equivalent to git-svn). In this case, you make commits locally to your submodule as if it were a regular git repository. Then, when you want to push upstream:

 cd <submodule-path>.hg
 hg pull git # Pull from the git submodule
 hg push # Push to the upstream hg repo

Viewing history

In addition to the super repository being a git repository, each sub-repository is a separate fully-fledged Git repository, so you can go into each one and type "git status", "git log" etc. This works for repositories which are SVN upstream, because we use git-svn to convert the repositories to Git on the server. You can also use the usual graphical tools (we recommend GitX for Mac OS, and git-gui/gitk for Linux) on each subrepository to visualise the log messages and patches, see which files have local changes, and interactively commit parts of files.

Viewing local modifications

You can see at a glance which of the submodules have local changes using

 git status

You can then go into each submodule and see those changes using git status or git diff.