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