{"thread":{"id":"24072","subject":"Question about tracking multiple Subversion repository from the same git repository with git-svn","startedAt":"2010-06-10T14:29:29Z","lastAt":"2010-06-11T21:28:08Z","messageCount":4,"participants":["Daniele Segato","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"143439","messageId":"AANLkTimMOPXecB0lZM3v2MaZgbhJWwtxOUIGgkxr_PGF@mail.gmail.com","threadId":"24072","inReplyTo":null,"subject":"Question about tracking multiple Subversion repository from the same git repository with git-svn","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2010-06-10T14:29:29Z","receivedAt":"2010-06-10T14:29:29Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Hi all,\n\nSay that I have 3 subversion repository\n\nsvn: an online repo which I only have read-only rights.\nabc, xyz: two project in two private repo where I have write rights.\n\n[svn-remote \"svn\"]\n\turl = http://svn.online-repo.com/repos/public\n\tfetch = path/to/trunk:refs/remotes/svn/trunk\n\tbranches = path/to/branches/*:refs/remotes/svn/*\n\ttags = path/to/tags/*:refs/remotes/svn/tags/*\n\n[svn-remote \"abc\"]\n\turl = https://svn.local-repo/repos/public\n\tfetch = path/to/trunk:refs/remotes/abc/trunk\n\tbranches = path/to/branches/*:refs/remotes/abc/*\n\ttags = path/to/tags/*:refs/remotes/abc/tags/*\n\n[svn-remote \"xyz\"]\n\turl = https://svn.local-repo/repos/public\n\tfetch = path/to/trunk:refs/remotes/xyz/trunk\n\tbranches = path/to/branches/*:refs/remotes/xyz/*\n\ttags = path/to/tags/*:refs/remotes/xyz/tags/*\n\nReading the man page of git-svn it seems this is possible and\nspecifically supported.\n\n\nBut I have some doubt.\n\nSuppose I've already created the project \"abc\" starting with trunk\ncopied from a specific commit (tag) of the \"svn\" project.\n\n1. Is there a way to tell git that abc/trunk is a branch of svn/tags/1.2.3 ?\n\n2. can I rename svn-remote \"svn\" to something like \"main\" without side effect?\n\n3. after 2) can I also rename all the names of the remote branches to\nmain/* instead of svn/* ?\n\n4. if project xyz is no more of interest to me can I \"discard\" it and\nremove the remote branches I don't need anymore?\n\n5. when I'll decide to upgrade project abc to main version 2.0.0 I'll do:\ngit merge --squash main/tags/2.0.0\nis this the best way?\n\n6. after point 5) when I'll further upgrade the project abc to main\nversion 2.1.0 can I still do:\ngit merge --squash main/tags/2.1.0\nor this will cause me problem? (the rerere option is set to true, so\nconflicts already solved shouldn't be asked twice).\n\n7. if the merge --squash cause a lot of conflicts is there a way to\nsplit the conflict resolution across different persons?\n\n\nThanks for any help you'll give me.\n\nRegards,\nDaniele Segato\n"},{"id":"143473","messageId":"20100610190417.GA15731@dcvr.yhbt.net","threadId":"24072","inReplyTo":"AANLkTimMOPXecB0lZM3v2MaZgbhJWwtxOUIGgkxr_PGF@mail.gmail.com","subject":"Re: Question about tracking multiple Subversion repository from the same git repository with git-svn","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-06-10T19:04:17Z","receivedAt":"2010-06-10T19:04:17Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Daniele Segato <daniele.bilug@gmail.com> wrote:\n> Hi all,\n> \n> Say that I have 3 subversion repository\n> \n> svn: an online repo which I only have read-only rights.\n> abc, xyz: two project in two private repo where I have write rights.\n> \n> [svn-remote \"svn\"]\n> \turl = http://svn.online-repo.com/repos/public\n> \tfetch = path/to/trunk:refs/remotes/svn/trunk\n> \tbranches = path/to/branches/*:refs/remotes/svn/*\n> \ttags = path/to/tags/*:refs/remotes/svn/tags/*\n> \n> [svn-remote \"abc\"]\n> \turl = https://svn.local-repo/repos/public\n> \tfetch = path/to/trunk:refs/remotes/abc/trunk\n> \tbranches = path/to/branches/*:refs/remotes/abc/*\n> \ttags = path/to/tags/*:refs/remotes/abc/tags/*\n> \n> [svn-remote \"xyz\"]\n> \turl = https://svn.local-repo/repos/public\n> \tfetch = path/to/trunk:refs/remotes/xyz/trunk\n> \tbranches = path/to/branches/*:refs/remotes/xyz/*\n> \ttags = path/to/tags/*:refs/remotes/xyz/tags/*\n> \n> Reading the man page of git-svn it seems this is possible and\n> specifically supported.\n> \n> \n> But I have some doubt.\n> \n> Suppose I've already created the project \"abc\" starting with trunk\n> copied from a specific commit (tag) of the \"svn\" project.\n> \n> 1. Is there a way to tell git that abc/trunk is a branch of svn/tags/1.2.3 ?\n\nYou need to use grafts.\n\n> 2. can I rename svn-remote \"svn\" to something like \"main\" without side effect?\n\nYou should be able to (and use GIT_SVN_ID=main in the env),\nthough I haven't used these features in a while.\n\n> 3. after 2) can I also rename all the names of the remote branches to\n> main/* instead of svn/* ?\n\nIt should be possible...  you need to edit $GIT_DIR/svn/.metadata, too.\n\n> 4. if project xyz is no more of interest to me can I \"discard\" it and\n> remove the remote branches I don't need anymore?\n\nYes.\n\n> 5. when I'll decide to upgrade project abc to main version 2.0.0 I'll do:\n> git merge --squash main/tags/2.0.0\n> is this the best way?\n\nProbably, yes.\n\n> 6. after point 5) when I'll further upgrade the project abc to main\n> version 2.1.0 can I still do:\n> git merge --squash main/tags/2.1.0\n> or this will cause me problem? (the rerere option is set to true, so\n> conflicts already solved shouldn't be asked twice).\n\nmerge --squash should always be safe when dealing with SVN repos.\n\n> 7. if the merge --squash cause a lot of conflicts is there a way to\n> split the conflict resolution across different persons?\n\nI'm not sure what you mean... multiple people working on the same\nworking tree?  On a shared screen session?  I don't see why not.\n\n-- \nEric Wong\n"},{"id":"143488","messageId":"AANLkTim_wx9lQ_IClmajo5etFKay0xPCTz1UrKilGWln@mail.gmail.com","threadId":"24072","inReplyTo":"20100610190417.GA15731@dcvr.yhbt.net","subject":"Re: Question about tracking multiple Subversion repository from the same git repository with git-svn","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2010-06-11T07:18:37Z","receivedAt":"2010-06-11T07:18:37Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"On Thu, Jun 10, 2010 at 9:04 PM, Eric Wong <normalperson@yhbt.net> wrote:\n>> 1. Is there a way to tell git that abc/trunk is a branch of svn/tags/1.2.3 ?\n>\n> You need to use grafts.\n\nthis one?\nhttps://git.wiki.kernel.org/index.php/GraftPoint\n\nseems what I need..\n\nin this case, I had a question:\n\nsince if I use this feature my commit will have different SHA-1. I\nused to write the commit SHA-1 in some of the svn tags. If I do this\nthey will no longer be valid.\nI think with git SVN the \"best\" way to identify a commit is using the\n\"Tree\" object SHA-1, it should be the same for every revision that\ncontains the same content...\nso..\n1b. Can I extract the tree sha-1 from a commit?\n1c. Is there a way to get every commit pointing to to a tree?\n\nIdeally I would do something like\n\ngit contain-tree <sha-1-of-the-tree>\n[list of commit's here]\n\ndoes this make any sense to you?\n\n>> 2. can I rename svn-remote \"svn\" to something like \"main\" without side effect?\n>\n> You should be able to (and use GIT_SVN_ID=main in the env),\n> though I haven't used these features in a while.\n\nRenamed, thanks.\ndo you know if I can set a GIT_SVN_ID (default) per-repository instead\nof using the environment\nvariable?\n(since I use git-new-workdir it would be best if I can use a default\nper workdir)\n\n>> 3. after 2) can I also rename all the names of the remote branches to\n>> main/* instead of svn/* ?\n>\n> It should be possible...  you need to edit $GIT_DIR/svn/.metadata, too.\n\nthanks, did it.\n\n>> 7. if the merge --squash cause a lot of conflicts is there a way to\n>> split the conflict resolution across different persons?\n>\n> I'm not sure what you mean... multiple people working on the same\n> working tree?  On a shared screen session?  I don't see why not.\n\n\nno,\nwhat I had in mind was a \"migration team\" to work on the migration of\nthe customization\nto a product to the new version of the main product.\n\nWhat I have in mind here is some kind of \"selective merge\".\nFor example...\n\nI merge a group of commits, someone else, on another computer with\ngit-svn or subversion merge another part and so on..\n\nlike...\n\ngit merge --squash -- path/to/something\nor something like\n\ngit merge --squash --interactive\n\nthis could give you a way to choose different paths you want to \"merge\".\n\nI know this is not very like a merge but I hope I gave you the idea of\nwhat I meant.\n\nRegards,\nDaniele Segato\n"},{"id":"143532","messageId":"20100611212808.GB7262@dcvr.yhbt.net","threadId":"24072","inReplyTo":"AANLkTim_wx9lQ_IClmajo5etFKay0xPCTz1UrKilGWln@mail.gmail.com","subject":"Re: Question about tracking multiple Subversion repository from the same git repository with git-svn","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-06-11T21:28:08Z","receivedAt":"2010-06-11T21:28:08Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Daniele Segato <daniele.bilug@gmail.com> wrote:\n> On Thu, Jun 10, 2010 at 9:04 PM, Eric Wong <normalperson@yhbt.net> wrote:\n> >> 1. Is there a way to tell git that abc/trunk is a branch of svn/tags/1.2.3 ?\n> >\n> > You need to use grafts.\n> \n> this one?\n> https://git.wiki.kernel.org/index.php/GraftPoint\n> \n> seems what I need..\n\nYes\n\n> in this case, I had a question:\n> \n> since if I use this feature my commit will have different SHA-1. I\n> used to write the commit SHA-1 in some of the svn tags. If I do this\n> they will no longer be valid.\n> I think with git SVN the \"best\" way to identify a commit is using the\n> \"Tree\" object SHA-1, it should be the same for every revision that\n> contains the same content...\n> so..\n> 1b. Can I extract the tree sha-1 from a commit?\n\nYes, \"git cat-file commit $commit\" will show you the tree.\n\n> 1c. Is there a way to get every commit pointing to to a tree?\n> \n> Ideally I would do something like\n> \n> git contain-tree <sha-1-of-the-tree>\n> [list of commit's here]\n> \n> does this make any sense to you?\n\nSort of, yes...\n\nBack in ancient times, there used to be a \"git svn graft-branches\"\ncommand which could automate what you're doing.  It was removed in\ncommit d05d72e07e49869fe988d4d99e6ac60711570db5 because it was largely\nunused.\n\nPerhaps you can resurrect it as a standalone command.  I imagine it\ncould be used for other import utilities, too.\n\n> >> 2. can I rename svn-remote \"svn\" to something like \"main\" without side effect?\n> >\n> > You should be able to (and use GIT_SVN_ID=main in the env),\n> > though I haven't used these features in a while.\n> \n> Renamed, thanks.\n> do you know if I can set a GIT_SVN_ID (default) per-repository instead\n> of using the environment\n> variable?\n\nErr, actually, --svn-remote=main is probably preferred, these days.\nGIT_SVN_ID is --id=foo.  Sorry for the confusion.\n\n> (since I use git-new-workdir it would be best if I can use a default\n> per workdir)\n> \n> >> 3. after 2) can I also rename all the names of the remote branches to\n> >> main/* instead of svn/* ?\n> >\n> > It should be possible...  you need to edit $GIT_DIR/svn/.metadata, too.\n> \n> thanks, did it.\n> \n> >> 7. if the merge --squash cause a lot of conflicts is there a way to\n> >> split the conflict resolution across different persons?\n> >\n> > I'm not sure what you mean... multiple people working on the same\n> > working tree?  On a shared screen session?  I don't see why not.\n> \n> \n> no,\n> what I had in mind was a \"migration team\" to work on the migration of\n> the customization\n> to a product to the new version of the main product.\n> \n> What I have in mind here is some kind of \"selective merge\".\n> For example...\n> \n> I merge a group of commits, someone else, on another computer with\n> git-svn or subversion merge another part and so on..\n> \n> like...\n> \n> git merge --squash -- path/to/something\n> or something like\n> \n> git merge --squash --interactive\n> \n> this could give you a way to choose different paths you want to \"merge\".\n> \n> I know this is not very like a merge but I hope I gave you the idea of\n> what I meant.\n\nI'll wait for others to answer that.  I rarely encounter conflict-heavy\nmerges, partly because my workflows are setup to avoid them.\n\n-- \nEric Wong\n"}]}