@@ -830,6 +830,52 @@ inside git back upstream to SVN users. Therefore it is advised that
830
830
users keep history as linear as possible inside git to ease
831
831
compatibility with SVN (see the CAVEATS section below).
832
832
833
+ HANDLING OF SVN BRANCHES
834
+ ------------------------
835
+ If 'git svn' is configured to fetch branches (and --follow-branches
836
+ is in effect), it sometimes creates multiple git branches for one
837
+ SVN branch, where the addtional branches have names of the form
838
+ 'branchname@nnn' (with nnn an SVN revision number). These additional
839
+ branches are created if 'git svn' cannot find a parent commit for the
840
+ first commit in an SVN branch, to connect the branch to the history of
841
+ the other branches.
842
+
843
+ Normally, the first commit in an SVN branch consists
844
+ of a copy operation. 'git svn' will read this commit to get the SVN
845
+ revision the branch was created from. It will then try to find the
846
+ git commit that corresponds to this SVN revision, and use that as the
847
+ parent of the branch. However, it is possible that there is no suitable
848
+ git commit to serve as parent. This will happen, among other reasons,
849
+ if the SVN branch is a copy of a revision that was not fetched by 'git
850
+ svn' (e.g. because it is an old revision that was skipped with
851
+ '--revision'), or if in SVN a directory was copied that is not tracked
852
+ by 'git svn' (such as a branch that is not tracked at all, or a
853
+ subdirectory of a tracked branch). In these cases, 'git svn' will still
854
+ create a git branch, but instead of using an existing git commit as the
855
+ parent of the branch, it will read the SVN history of the directory the
856
+ branch was copied from and create appropriate git commits. This is
857
+ indicated by the message "Initializing parent: <branchname>".
858
+
859
+ Additionally, it will create a special branch named
860
+ '<branchname>@<SVN-Revision>', where <SVN-Revision> is the SVN revision
861
+ number the branch was copied from. This branch will point to the newly
862
+ created parent commit of the branch. If in SVN the branch was deleted
863
+ and later recreated from a different version, there will be multiple
864
+ such branches with an '@'.
865
+
866
+ Note that this may mean that multiple git commits are created for a
867
+ single SVN revision.
868
+
869
+ An example: in an SVN repository with a standard
870
+ trunk/tags/branches layout, a directory trunk/sub is created in r.100.
871
+ In r.200, trunk/sub is branched by copying it to branches/. 'git svn
872
+ clone -s' will then create a branch 'sub'. It will also create new git
873
+ commits for r.100 through r.199 and use these as the history of branch
874
+ 'sub'. Thus there will be two git commits for each revision from r.100
875
+ to r.199 (one containing trunk/, one containing trunk/sub/). Finally,
876
+ it will create a branch 'sub@200' pointing to the new parent commit of
877
+ branch 'sub' (i.e. the commit for r.200 and trunk/sub/).
878
+
833
879
CAVEATS
834
880
-------
835
881
0 commit comments