-
Notifications
You must be signed in to change notification settings - Fork 1
Home
This repository is mirror of Hattrick Organizer svn repository imported to git. The project can be found from (https://sourceforge.net/projects/ho1/). There is trac and forums for developer and user interaction.
There is a few advantages for using DVCS (wiki). I try to quickly sum my view:
-
+Quick and easy access to history data
-
+Bisection to find a commit causing regression
-
+Local branches and commits
-
+Better branch, fork and merge management support
-
+Easier to make small commits that are easy to understand later on
-
-Powerful tool exposes large set of functionality to users making learning a bit harder
-
-Different concepts make it a bit hard to switch
Git is one of DVCS tools out there. There is more of those and probably other can import svn history to local tree too. But I know git better than other because I have used it nearly exclusively as DVCS tool.
Importing svn history to the local git tree takes quite sometime (I have done import that took about 40 hours to do). For HO it is relatively fast taking only about a hour. But it is possible to share the imported repository to save the time required to create a local import.
After I managed to import commits before revision 421 (switch to standard svn directories) I decided to publish my import in github. I have a periodically run update script making sure the github is only a few commits behind svn repository. The script is run on my laptop so timing of update depends on when my laptop is on and connected to Internet.
To use the shared import one needs to do some trickery to get local repository to correct state. Following commands will work in unix shell
LOCAL_DIR=ho1
# Setup local git svn to track ho svn repository
git svn init -s https://ho1.svn.sourceforge.net/svnroot/ho1 $LOCAL_DIR
# Move to the local repository
cd $LOCAL_DIR
# Fetch already converted svn history from github
git fetch git://github.com/suokko/HO_changes.git "refs/heads/*:refs/remotes/*"
# Also fetch manually created git tags that match to svn tags
git fetch git://github.com/suokko/HO_changes.git --tags
# Tell git svn to fetch history from svn, First time it will do some work to create translation database between git commits and svn commits for all local git commits
git svn fetch
# Force fully make local master branch to have svn trunk content
git reset --hard trunk
# Now repository is ready to be used
git-svn repository is used locally exactly same way as git repository cloned from git server. Good learning place is Git - SVN Crash Course. But basic idea with DVCS is to maintain local repository with local commit history. Commits are transfered to server with separate command.
Special part for git-svn user is how to update and commit to svn server. SVN commits can be fetched to local repository using git svn fetch. When locally checked out branch has a few commits ready to be committed to svn repository it is best to make sure commits are on top of the latest remote repository using git rebase trunk. Rebase may hit conflicts that needs to be resolved manually. Then commits can be uploaded with git svn dcommit.
Commiting to svn branch requires creating local git branch that tracks the svn branch. eg.
git checkout -b local-ifa-fix ifa-fix
#Make local changes
git add -p
git commit
#Make some more loosely related changes
git add -p
git commit
#Be happy with resulting changes and publish them
git svn fetch
# If there is remote changes: git rebase ifa-fix
git svn dcommit
# Commits go to remote ifa-fix branch because local branch is tracking the remote branch
For HO build developer needs to configure ant to use git svn info instead of regular svn info. Following Core/AntBuild-Local.properties file works for me.
svn.command=git
svn.infoarg=svn info
- Crash course: (http://git.or.cz/course/svn.html)
- git-svn tutorial: (http://viget.com/extend/effectively-using-git-with-subversion)
- TortoiseGit: (http://code.google.com/p/tortoisegit/)
- Git with Eclipse: (http://www.eclipse.org/egit/)
- List of git repository tools (some aren't developed any more): (https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools)