I am pretty sure I don't have to express how important and useful of git-svn again. I started to play with it some weeks ago, and git-svn did a good job on everything except checking into svn repository.


In my work flow, usually, I am working on several different stuff in parallel, and my local git tree carries five to six patches. I only send one of them, which I am comfortable with, for review. Once review is done, I will commit this patch to svn repository. git-svn has dcommit command to commit to svn repository, however, I don't find any option to choose a certain commit. So, my painful process is 1) git format-patches, 2) apply approved patch to svn working dir, 3) svn commit 4) git svn rebase in git tree.

I do believe my process is wrong, or at least inefficient. Today, I find something new to make me more comfortable on committing patches to svn repository in git svn.

Usually, all my work is in branch `work', and branch `master' is clean. When one patch/commit is ready to go to svn repository, I can use `git cherry-pick' to pick up the certain commit I'd like to check in. For example, `git cherry-pick work', which will pick the last commit in `work' tree to `master'. Then, this commit jumps to mater tree. Before commit, as required by GNU project, ChangeLog should be updated as well. When it is done, we should merge these two commits into one, otherwise, there are two commits to svn instead of one. `git rebase -i master~2' will help on this, and I can squash the 2nd patch into the 1st one.

Finally, `git svn dcommit' will commit a single commit to svn repository. By the way, if you are not sure what `git svn dcommit' will do, please use `--dry-run' option, which will doesn't nothing except printing out revisions plan to commit.

Newer Posts Older Posts Home