[Unison-hackers] Using git to hack Unison
Alan Schmitt
alan.schmitt at polytechnique.org
Thu Mar 14 12:18:19 EDT 2013
Hi,
As it was the first time I used the git clone of the svn repository to
hack Unison, I thought I would report with how it went. To summarize: it
went pretty well, with one exception.
Let's start with the exception (which is the first thing that bit me): I
first tried to build Unison, to make sure my recent upgrades would not
prevent me to, and it failed, because of the REV keyword. To solve this
I created the Makefile.ProjectInfo file from a svn checkout and copied
it to my local repository. I searched how to get rid of this dependency,
but could not find how (except maybe by adding some hooks on the svn
server to update a file containing the revision before serving it).
I then started coding, and realized I'd better make a branch with my
current changes. This was simply a:
git checkout -b new_branch_name
I then worked on the code, regularly doing commits. Before pushing
everything, I cleaned up and reordered the commits to make them nicer in
the history. I then put everything in the master branch. To avoid
confusing svn, one needs to do:
git checkout master
git svn rebase # to fetch any svn commit that may have happened
git checkout new_branch_name
git rebase master # to merge them with the work
then:
git checkout master
git merge new_branch_name --ff-only
to append the commits at the end of the history (the --ff-only
guarantees the commits can be applied without doing a merge).
I then edit the logmsg, and do a
make git_checkin
which push everything back to svn.
I found this worked nicely, as it lets me have experimental branches in
my local repository, under version control, without polluting the main
svn repository.
Alan
More information about the Unison-hackers
mailing list