You will not get pre-copy-to-parent-proj history for b
or c
if you git svn clone http://svnhost/parent-proj
. git svn
interprets your supplied base-path as the shallowest-point you are interested in ingesting the SVN commits for, making Git commits for the same. As the historical commits under b
and c
are outside of this path, git svn
won't mirror them, so you won't have that history.
Take a look at the documentation for the git svn init --no-minimize-url
option:
When tracking multiple directories (using --stdlayout, --branches, or --tags options), git svn will attempt to connect to the root (or highest allowed level) of the Subversion repository. This default allows better tracking of history if entire projects are moved within a repository, but may cause issues on repositories where read access restrictions are in place. Passing --no-minimize-url will allow git svn to accept URLs as-is without attempting to connect to a higher level directory. This option is off by default when only one URL/branch is tracked (it would do little good).
Since your clone
command does not specify multiple branches (perhaps because you have a complex, multi-project or non-standard layout), git svn
just clones commits involving that path and downwards. Shadow Creeper in comments used the -s
or --stdlayout
option, which can explain why some history was preserved for them.
If this is a one-off conversion (one-way move from SVN to Git), then you should probably clone the entire repository, then you have good options for moving things around in Git to look the way you want them to, including the establishment of historical branches and tags. If the motivation to run filter-branch
is to save repository space, make sure that this is going to actually save you something, and that it is worth the bother. Git is very efficient with storage.
One final word of caution on expections of history-searching in the Git clone. Look for history on a file using git log -C --follow <file-path>
and Git will typically do a good job of locating and providing you with a history incorporating renames and copies. Don't expect the same for directories, e.g. parent-proj/b
. Git tracks blobs (files), trees (of blobs), commits and parent commits, but does not handle directories or directory-copies in the same way as SVN.