{"thread":{"id":"35666","subject":"Problem importing from SVN repository with branches/tags at multiple levels using git-svn","startedAt":"2014-01-15T20:10:42Z","lastAt":"2014-01-22T21:11:57Z","messageCount":3,"participants":["Robert Hancock","Jim Garrison"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"233168","messageId":"52D6EB42.2060509@sedsystems.ca","threadId":"35666","inReplyTo":null,"subject":"Problem importing from SVN repository with branches/tags at multiple levels using git-svn","fromName":"Robert Hancock","fromEmail":"hancock@sedsystems.ca","sentAt":"2014-01-15T20:10:42Z","receivedAt":"2014-01-15T20:10:42Z","isPatch":false,"sender":{"key":"hancock@sedsystems.ca","avatar":null},"body":"We have an SVN repository that has a structure for tags (likewise for\nbranches) like this:\n\ntags/tag1\ntags/tag2\ntags/tag3/\ntags/subdir/tag4\ntags/subdir/tag5\n\nThe idea is that I want to have git-svn import everything inside subdir\nas tags and everything else inside the root tags directory as tags, so I\nend up with tag1-tag5 in Git. I've got tags= entries like this in the\nGit configuration to try to achieve this:\n\ntags = tags/subdir/*:refs/remotes/tags/*\ntags = tags/*:refs/remotes/tags/*\n\nMy expectation was that everything inside subdir would match the first\nline first and everything else would match the second line, so\neverything would work out OK. Unfortunately it seems like for the tags\ninside subdir, it's matching the second line and therefore trying to\nimport everything in there as directories inside one tag called subdir.\nChanging the order of those lines doesn't seem to help either, it seems\ndetermined to try to match to tags/* regardless of what order the lines\nare in.\n\nClearly it would have been better if the repository had not been\nstructured this way. However, rearranging it now won't help since the\npaths are like this in the SVN repository history.\n\nThe only solution I've found that kind of works is to use\ntags/{tag1,tag2,tag3} instead of tags/*. Unfortunately there are a ton\nof tags in that directory and adding in a giant list of tags there seems\nto slow down the import process a great deal. Also, there are\npotentially still tags being created in that root directory, so I would\nhave to keep regenerating and updating this list in the Git\nconfiguration every time one was added. So this is not a good solution.\nIt would be much easier if I could get a wildcard solution to work here.\n\nAny thoughts?\n\n-- \nRobert Hancock\nSystem Analyst\nSED Systems\nEmail: hancock@sedsystems.ca\n"},{"id":"233528","messageId":"52E01601.8090705@sedsystems.ca","threadId":"35666","inReplyTo":"52D6EB42.2060509@sedsystems.ca","subject":"Re: Problem importing from SVN repository with branches/tags at multiple levels using git-svn","fromName":"Robert Hancock","fromEmail":"hancock@sedsystems.ca","sentAt":"2014-01-22T19:03:29Z","receivedAt":"2014-01-22T19:03:29Z","isPatch":false,"sender":{"key":"hancock@sedsystems.ca","avatar":null},"body":"On 01/15/2014 02:10 PM, Robert Hancock wrote:\n> We have an SVN repository that has a structure for tags (likewise for\n> branches) like this:\n> \n> tags/tag1\n> tags/tag2\n> tags/tag3/\n> tags/subdir/tag4\n> tags/subdir/tag5\n> \n> The idea is that I want to have git-svn import everything inside subdir\n> as tags and everything else inside the root tags directory as tags, so I\n> end up with tag1-tag5 in Git. I've got tags= entries like this in the\n> Git configuration to try to achieve this:\n> \n> tags = tags/subdir/*:refs/remotes/tags/*\n> tags = tags/*:refs/remotes/tags/*\n> \n> My expectation was that everything inside subdir would match the first\n> line first and everything else would match the second line, so\n> everything would work out OK. Unfortunately it seems like for the tags\n> inside subdir, it's matching the second line and therefore trying to\n> import everything in there as directories inside one tag called subdir.\n> Changing the order of those lines doesn't seem to help either, it seems\n> determined to try to match to tags/* regardless of what order the lines\n> are in.\n> \n> Clearly it would have been better if the repository had not been\n> structured this way. However, rearranging it now won't help since the\n> paths are like this in the SVN repository history.\n> \n> The only solution I've found that kind of works is to use\n> tags/{tag1,tag2,tag3} instead of tags/*. Unfortunately there are a ton\n> of tags in that directory and adding in a giant list of tags there seems\n> to slow down the import process a great deal. Also, there are\n> potentially still tags being created in that root directory, so I would\n> have to keep regenerating and updating this list in the Git\n> configuration every time one was added. So this is not a good solution.\n> It would be much easier if I could get a wildcard solution to work here.\n> \n> Any thoughts?\n\nJust to respond to my own question, it appears that the ignore-refs\nconfiguration option allows one to deal with this situation. In this\ncase one would add something like:\n\nignore-refs = refs/remotes/tags/subdir$\n\nto prevent git-svn from trying to create a Git ref called subdir.\n\nUnfortunately there seems to be no documentation at all about this\noption other than in the source commit which introduced it, unlike all\nthe other settings for git-svn - that seems like a bit of an oversight..\n\n-- \nRobert Hancock\nSystem Analyst\nSED Systems\nEmail: hancock@sedsystems.ca\n"},{"id":"233546","messageId":"0C723FEB5B4E5642B25B451BA57E273075147566@S1P5DAG3C.EXCHPROD.USA.NET","threadId":"35666","inReplyTo":"52E01601.8090705@sedsystems.ca","subject":"RE: Problem importing from SVN repository with branches/tags at multiple levels using git-svn","fromName":"Jim Garrison","fromEmail":"jim.garrison@nwea.org","sentAt":"2014-01-22T21:11:57Z","receivedAt":"2014-01-22T21:11:57Z","isPatch":false,"sender":{"key":"jim.garrison@nwea.org","avatar":null},"body":"> -----Original Message-----\n> Behalf Of Robert Hancock\n> Sent: Wednesday, January 22, 2014 11:03 AM\n> Subject: Re: Problem importing from SVN repository with branches/tags at\n> multiple levels using git-svn\n> \n> On 01/15/2014 02:10 PM, Robert Hancock wrote:\n> > We have an SVN repository that has a structure for tags (likewise for\n> > branches) like this:\n> >\n> > tags/tag1\n> > tags/tag2\n> > tags/tag3/\n> > tags/subdir/tag4\n> > tags/subdir/tag5\n> >\n[snip]\n\nWe did this recently and decided there is only one way to do it reliably.\n\nCopy all the tags, within subversion itself, into the structure expected by git, then use git svn following the procedures outlined in the manual.\n\nCopying tags is cheap in subversion, and you can always delete them afterwards if you want.\n"}]}