When I started hacking on the pytrainer source, I decided that I was going to have to solve the issue of being able to keep track of serious patches without having commit access to the main project's subversion repository. In the past few years, many interesting distributed development tools have emerged and become mature. I'm a practical programmer, so without doing a scientific study of each tool, I decided to stop once I had the tool which annoyed me the least and supported the kind of workflow I am going to be employing.
The basic strategy is this:
- Somehow make a copy of the main SVN repository locally.
- Make changes.
- Commit to my local repository.
- Update my copy of SVN, merging my changes.
- Publish diffs back to the core developers.
- Goto 2.
Since pytrainer uses subversion for the main repository, I figured that the natural choice would be SVK. SVK essentially uses subversion under the hood to let developers work in a distributed environment, make detached commits, etc, etc. This is the kind of thing I wanted, but after trying to use SVK I was very disappointed. I think SVK probably works just fine when it's what everyone on your team uses, but I am playing the role of the rogue patch hacker who is not a core developer but occasionally works like one. To use SVK for my work, I need to make a mirror, sync it, copy that mirror to a local copy, check out that local copy, and only THEN could I start working. This also assumes that I haven't screwed up all of the depotmap naming (which I did). SVK also breaks with traditional source code management (SCM) by requiring you to do something like "svk co -d workingcopy" if you want to get rid of it.
Moving on, I found git-svn. Rather than say much about git other than that I have currently found the tool for me, I will give a sample command-line session to get things running:
git svn init -s http://www.e-oss.net/svn/pytrainer/
git svn fetch
git repack -d
git checkout -b kevins_patches
And then typical workflow:
# Edit some files
git commit -m "Fix crash"
Want to get up-to-date? Rebase:
git stash # Put your changes away
git rebase # Pull down the newest code
git stash apply # Apply your changes
git-svn works for me.