|Version 16 (modified by 7 months ago) ( diff ),|
In addition to the official TracRepositories targeted for distributing the code to users, we have several local "devs" repositories for staging the work in progress and preparing the various proposals.
Use a branch in a git repository or a branch or a bookmark in a Mercurial repository as an alternative to a patch, at your convenience.
It's also possible to create such repositories at Github by cloning the official mirror, but the extra advantage offered to TracTeam members of using a local repository is to have closer integration with this Trac, browsing the repositories, referring to the commits and seeing them in the timeline.
See the list in https://hg.edgewall.org/trac.
We currently have git repositories ready to use for the following people:
cboos jomae jonas osimons psuter rblank rjollos
When they're becoming "active", we make them browsable here:
In the following instructions, replace
$user with your actual user account on
There are various ways to organize your working repositories, so the following is only an example setup.
Your repository as the
origin, the Subversion mirror as
First you need to clone your repository (let's call the local repository
$user as well):
$ git clone https://svn.edgewall.org/git/trac/devs/$user $user $ cd $user
After the clone, you'll see the following branches (you may have fewer branches depending on when your repository was created):
$ git branch --all * trunk remotes/origin/0.12-stable remotes/origin/1.0-stable remotes/origin/1.2-stable remotes/origin/HEAD -> origin/trunk remotes/origin/trunk
Note that the lack of a
master branch serves as a reminder that we're not working in a "primary" repository, but only in a mirror of a Subversion repository.
Speaking of which, we need to make it easy to retrieve the changes coming from upstream. For that, we add a remote that we will call
$ git remote add mirror https://svn.edgewall.org/git/trac/mirror $ git fetch mirror
(use that URL directly from e.o, or use one of the github ones)
We would like to fetch from
mirror instead of the
origin for the local branch
trunk, so we need to replace
$ git branch --set-upstream-to=mirror/trunk trunk Branch trunk set up to track remote branch trunk from mirror.
If you'd like to get a
1.2-stable branch for tracking
mirror/1.2-stable, simply do:
$ git branch 1.2-stable mirror/1.2-stable Branch 1.2-stable set up to track remote branch 1.2-stable from mirror.
Repeat for other branches that you'd like to track locally.
Disable pushing to the mirror, just to be safe:
$ git remote set-url --push mirror no_push
If you'd like to get tags from the mirror:
$ git fetch mirror 'refs/remotes/tags/*:refs/tags/*'
Once this is done, for either of these, getting the changes from svn is a simple matter of going back to the branch in question and doing a pull, e.g.
$ git checkout trunk $ git pull --ff-only
Of course, you should not directly work on such a
trunk branch, but rather use it as the base for creating topic branches (IOW,
git pull --ff-only should always succeed).
$ git checkout -b ticketXYZ/short-summary trunk
Whenever you want to publish such a topic branch, you push it to your repository. The push URL must use
https, so be sure to do this once:
$ git remote set-url origin --push https://$firstname.lastname@example.org/git/trac/devs/$user
Note that you can add the repositories from other developers in as many remotes as needed, e.g.
$ git remote add cboos https://svn.edgewall.org/git/trac/devs/cboos $ git remote add jomae https://svn.edgewall.org/git/trac/devs/jomae $ git remote add rjollos https://svn.edgewall.org/git/trac/devs/rjollos $ git remote add psuter https://svn.edgewall.org/git/trac/devs/psuter
This makes it very easy to fetch topic branches from other people and to continue where they left or propose changes.
In the end, a
.git/config for such a repository where
user=jonas will look like the following:
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hideDotFiles = dotGitOnly [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = https://svn.edgewall.org/git/trac/devs/jonas pushurl = https://email@example.com/git/trac/devs/jonas [branch "trunk"] remote = mirror merge = refs/heads/trunk [remote "mirror"] url = https://svn.edgewall.org/git/trac/mirror fetch = +refs/heads/*:refs/remotes/mirror/* [branch "0.12-stable"] remote = mirror merge = refs/heads/0.12-stable [remote "cboos"] url = https://svn.edgewall.org/git/trac/devs/cboos fetch = +refs/heads/*:refs/remotes/cboos/* [remote "jomae"] url = https://svn.edgewall.org/git/trac/devs/jomae fetch = +refs/heads/*:refs/remotes/jomae/* [remote "rjollos"] url = https://svn.edgewall.org/git/trac/devs/rjollos fetch = +refs/heads/*:refs/remotes/rjollos/* [remote "psuter"] url = https://svn.edgewall.org/git/trac/devs/psuter fetch = +refs/heads/*:refs/remotes/psuter/*