{"thread":{"id":"16399","subject":"New converstion tool: svn2git.py","startedAt":"2008-11-19T19:13:21Z","lastAt":"2008-11-20T18:49:34Z","messageCount":4,"participants":["Neil Schemenauer","Kevin Menard","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96182","messageId":"20081119191320.GA20870@arctrix.com","threadId":"16399","inReplyTo":null,"subject":"New converstion tool: svn2git.py","fromName":"Neil Schemenauer","fromEmail":"nas@arctrix.com","sentAt":"2008-11-19T19:13:21Z","receivedAt":"2008-11-19T19:13:21Z","isPatch":false,"sender":{"key":"nas@arctrix.com","avatar":null},"body":"Hi,\n\nI'm working on a tool to do conversions from SVN to git using a SVN\ndump.  It's in early development but perhaps some people would be\ninterested in it:\n\n    http://python.ca/nas/python/svn2git.py\n\nI would like to improve it so that it intelligently converts SVN\nbranches and tags into git branches (when possible).  The basic idea\nis to map SVN paths into git branches, e.g. trunk -> master,\nbranches/foo -> branch-foo, tags/bar -> tags-bar.  Next, specific\nSVN dump actions like:\n\n    Node-path: branches/foo\n    Node-kind: dir\n    Node-action: add\n    Node-copyfrom-rev: 3\n    Node-copyfrom-path: trunk\n\nneed to be detected and the commit needs to performed with the\ncorrect parent.  One complication is that SVN can create a branch or\ntag from anywhere, for example, the action\n\n    Node-path: tags/bar\n    Node-kind: dir\n    Node-action: add\n    Node-copyfrom-rev: 3\n    Node-copyfrom-path: trunk/subdir\n\nwould create tags/bar based on revision 3 of trunk/subdir.  There\ndoesn't seem to be a good way to convert that into git.  I was\nthinking that the tags-bar branch in that case would have no parent.\nWould git still efficently pack that or would you end up with extra\nblobs?\n\n  Neil\n"},{"id":"96183","messageId":"7e3605160811191139t34c5de7q1912475f778386e8@mail.gmail.com","threadId":"16399","inReplyTo":"20081119191320.GA20870@arctrix.com","subject":"Re: New converstion tool: svn2git.py","fromName":"Kevin Menard","fromEmail":"nirvdrum@gmail.com","sentAt":"2008-11-19T19:39:26Z","receivedAt":"2008-11-19T19:39:26Z","isPatch":false,"sender":{"key":"nirvdrum@gmail.com","avatar":"https://gravatar.com/avatar/96621fc3018e7b95ed0e4fc67d2898f3ab35c4805a69d48f023d80e2e6151f90?d=mp&s=160"},"body":"Hi Neil,\n\nYou may want to look at this Ruby implementation for more ideas:\n\nhttp://github.com/nirvdrum/svn2git/\n\nI forked it from a project originally by James Coglan, but should be\nable to answer most questions about it.\n-- \nKevin\n\n\n\nOn Wed, Nov 19, 2008 at 2:13 PM, Neil Schemenauer <nas@arctrix.com> wrote:\n> Hi,\n>\n> I'm working on a tool to do conversions from SVN to git using a SVN\n> dump.  It's in early development but perhaps some people would be\n> interested in it:\n>\n>    http://python.ca/nas/python/svn2git.py\n>\n> I would like to improve it so that it intelligently converts SVN\n> branches and tags into git branches (when possible).  The basic idea\n> is to map SVN paths into git branches, e.g. trunk -> master,\n> branches/foo -> branch-foo, tags/bar -> tags-bar.  Next, specific\n> SVN dump actions like:\n>\n>    Node-path: branches/foo\n>    Node-kind: dir\n>    Node-action: add\n>    Node-copyfrom-rev: 3\n>    Node-copyfrom-path: trunk\n>\n> need to be detected and the commit needs to performed with the\n> correct parent.  One complication is that SVN can create a branch or\n> tag from anywhere, for example, the action\n>\n>    Node-path: tags/bar\n>    Node-kind: dir\n>    Node-action: add\n>    Node-copyfrom-rev: 3\n>    Node-copyfrom-path: trunk/subdir\n>\n> would create tags/bar based on revision 3 of trunk/subdir.  There\n> doesn't seem to be a good way to convert that into git.  I was\n> thinking that the tags-bar branch in that case would have no parent.\n> Would git still efficently pack that or would you end up with extra\n> blobs?\n>\n>  Neil\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"96186","messageId":"20081119204032.GA21441@arctrix.com","threadId":"16399","inReplyTo":"7e3605160811191139t34c5de7q1912475f778386e8@mail.gmail.com","subject":"Re: New converstion tool: svn2git.py","fromName":"Neil Schemenauer","fromEmail":"nas@arctrix.com","sentAt":"2008-11-19T20:40:33Z","receivedAt":"2008-11-19T20:40:33Z","isPatch":false,"sender":{"key":"nas@arctrix.com","avatar":null},"body":"On Wed, Nov 19, 2008 at 02:39:26PM -0500, Kevin Menard wrote:\n> You may want to look at this Ruby implementation for more ideas:\n> \n> http://github.com/nirvdrum/svn2git/\n> \n\nHi Kevin,\n\nThanks for the link.   I see that git-svn does most of the heavy\nlifting and now I see that it does try to intelligently handle\nbranches and tags by looking for a suitable parent commit.  I will\nhave to look closer at what it's doing.  Maybe it is sufficient for\nmy task.\n\nRegards,\n\n  Neil\n"},{"id":"96279","messageId":"alpine.LNX.1.00.0811201329460.19665@iabervon.org","threadId":"16399","inReplyTo":"20081119191320.GA20870@arctrix.com","subject":"Re: New converstion tool: svn2git.py","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-11-20T18:49:34Z","receivedAt":"2008-11-20T18:49:34Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 19 Nov 2008, Neil Schemenauer wrote:\n\n> Hi,\n> \n> I'm working on a tool to do conversions from SVN to git using a SVN\n> dump.  It's in early development but perhaps some people would be\n> interested in it:\n> \n>     http://python.ca/nas/python/svn2git.py\n> \n> I would like to improve it so that it intelligently converts SVN\n> branches and tags into git branches (when possible).  The basic idea\n> is to map SVN paths into git branches, e.g. trunk -> master,\n> branches/foo -> branch-foo, tags/bar -> tags-bar.  Next, specific\n> SVN dump actions like:\n> \n>     Node-path: branches/foo\n>     Node-kind: dir\n>     Node-action: add\n>     Node-copyfrom-rev: 3\n>     Node-copyfrom-path: trunk\n> \n> need to be detected and the commit needs to performed with the\n> correct parent.  One complication is that SVN can create a branch or\n> tag from anywhere, for example, the action\n> \n>     Node-path: tags/bar\n>     Node-kind: dir\n>     Node-action: add\n>     Node-copyfrom-rev: 3\n>     Node-copyfrom-path: trunk/subdir\n> \n> would create tags/bar based on revision 3 of trunk/subdir.  There\n> doesn't seem to be a good way to convert that into git.  I was\n> thinking that the tags-bar branch in that case would have no parent.\n\nProbably the best thing in git would be to have the parent of the initial \ncommit on that branch be revision 3 of trunk; it will look like a big \nrename of everything from subdir/* into the project root directory, which \nis essentially what happened.\n\n> Would git still efficently pack that or would you end up with extra\n> blobs?\n\ngit will only ever store a single copy of identical file contents, \nregardless of anything at all. Furthermore, when making a pack, git \ncompresses everything in the pack against everything else in the pack. Its \nheuristics also ignore the leading directory names in guessing which blobs \nare likely to help in compression (because there's a good chance that \nanything named \"Makefile\" anywhere is useful in compressing anything else \nnamed \"Makefile\").\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}