{"thread":{"id":"7337","subject":"git-svnimport","startedAt":"2007-03-20T18:00:11Z","lastAt":"2007-03-20T18:00:11Z","messageCount":1,"participants":["Christian Wiese"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"37634","messageId":"20070320200011.444bd942@athlon","threadId":"7337","inReplyTo":null,"subject":"git-svnimport","fromName":"Christian Wiese","fromEmail":"morfoh@opensde.org","sentAt":"2007-03-20T18:00:11Z","receivedAt":"2007-03-20T18:00:11Z","isPatch":false,"sender":{"key":"morfoh@opensde.org","avatar":null},"body":"Hello folks,\n\nI'd like to use git-svnimport to mirror the subprojects within our svn\nrepository, but I encountered some pitfalls while testing.\n\nOur Layout is like this:\n\n<SVN_Repository_Root>/{subproject-a,subproject-b}/{trunk,branches,tags}\n\nFrom the documentation of git-svnimport I assumed that I can use:\n------------------------------------------------------\n$ git-svnimport -v <SVN_Repository_Root>/subproject-a\n------------------------------------------------------\nto just fetch subproject-a, but the import fails with an error like\nthis:\n-------snip--------------------------------------------------------------\n40: Unrecognized path: /subproject-b/tags\n40: Unrecognized path: /subproject-b/trunk\n41: Unrecognized path: /subproject-a/trunk/foo/bar.txt\n42: Unrecognized path: /subproject-a/trunk/foo/bar.txt\n43: Unrecognized path: /subproject-a/trunk/foo/bar.txt\nGenerating pack...\nDone counting 0 objects.\nNothing new to pack.\nRemoving unused objects 100%...\nDone.\nDONE; creating master branch\ncp: cannot stat `/repos/test/tmp/.git/refs/heads/origin':\nNo such file or directory\nfatal: master: not a valid SHA1\n-------snip--------------------------------------------------------------\n\nWhat am I doing wrong ?\n\nWhen I am using:\n--------------------------------------------------------\n$ git-svnimport -v -T subproject-a <SVN_Repository_Root>\n--------------------------------------------------------\nit gets happily imported.\n\nSo I have the impression that the described <SVN_repository_URL> in\nthe documentation of git-svnimport is in fact the Repository Root of the\nsvn repo.\n\nFor me it looks like git-svnimport makes the assumption that most svn\nrepos are organized in the following way:\n\n<SVN_repository_URL>/{trunk,branches,tags}/{subproject-a,subproject-b}\n\nI have never seen svn repos organized that way if there are more than\none project inside a repo, and it is even not recommended by the svn\npeople as we can see here:\nhttp://svnbook.red-bean.com/nightly/en/svn-book.html#svn.branchmerge.maint.layout\n\nSo the assumption of git-svnimport, that trunk, branches and tags are\nalways top-level directories is unlikely the case in most svn\ndeployments. Most subprojects hosted in a svn repo have their own\ntrunk, branches and tags directories.\n\nI think the '-P' option of git-svnimport should rather define the\nrelative path of the subproject from the svn repository root than from\na trunk toplevel directory, which is not existing in most cases.\n\nIt might be even useful to rename <SVN_repository_URL> to\n<SVN_Repository_Root>\n\n-P <Path_from_SVN_Repository_Root>\n\tBy default, the whole  repository is imported.\n\t-P my/proj will import starting only from my/proj.\n\tThis option is useful when you want to import one project from\n\ta svn repo which hosts multiple projects, that have their own\n\ttrunk, branches and tags directory structure.\n\n\n<SVN_Repository_Root>/<Path_from_SVN_Repository_Root>/{trunk,branches,tags}\n\nAs far as I can see now that would ease the use of git-svnimport a lot\nand would help people to migrate from svn to git as well.\n\nAny suggestions are highly welcome!\n\nThanks in advance.\nCheers\n--Chris\n"}]}