{"thread":{"id":"11713","subject":"Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","startedAt":"2008-01-23T21:00:32Z","lastAt":"2008-01-25T20:03:28Z","messageCount":7,"participants":["JM Ibanez","Sam Vilain","Pascal Obry"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66427","messageId":"877ii0p89b.fsf@adler.orangeandbronze.com","threadId":"11713","inReplyTo":null,"subject":"Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"JM Ibanez","fromEmail":"jm@orangeandbronze.com","sentAt":"2008-01-23T21:00:32Z","receivedAt":"2008-01-23T21:00:32Z","isPatch":false,"sender":{"key":"jm@orangeandbronze.com","avatar":null},"body":"\nHi,\n\nI've been trying to convert an existing git-svn clone to noMetadata\n(i.e. get rid of git-svn-id in the commit messages), primarily because\nI've been using it to track two SVN repos which were originally just a\nsingle repo-- they have the same UUID but are located on different\nmachines, and have branched significantly, so content-wise are no longer\nthe same repo.\n\nBecause the two repos have a single line of commits which they share, it\nwould be best if I could store that history in my git repo (as I need to\nuse it for merging between the two trees). Graphically, my current\nhistory looks something like this:\n\n\n    A -- B -- C -- D -- E -- a -- b -- c\n\n    A'-- B'-- C'-- D'-- E'-- x -- y -- z\n\nwhere, in reality, this should be represented as:\n\n    A -- B -- C -- D -- E -- a -- b -- c\n                         \\\n                          +- x -- y -- z\n\nBecause the ancestor revisions (A..E) have different commit messages\n(because of the git-svn-id), they have differing SHA1 ids.  Which means\nI have a hard time trying to track both branches using gitk.\n\nI used git-filter-branch to strip off the git-svn-id lines, as follows:\n\n $ git filter-branch --msg-filter 'sed -e \"s/^git-svn-id.*$//\"' \\\n       --commit-filter 'NEW_SHA1=`git commit-tree \"$@\"`; \\\n         echo \"s/$GIT_COMMIT/$NEW_SHA1/\" >> $REMAP_FILE; \\\n         echo $NEW_SHA1' HEAD\n\nThe mappings between the old commit SHA1s and the new commit SHA1s I\nstore in $REMAP_FILE (somewhere), which I then execute as a sed script\nagainst all my .rev_db files:\n\n $ find .git/svn/ -name '.rev_db' | xargs sed -f $REMAP_FILE -i.bak\n\nNow, my problems is I've apparently confused git-svn. I can't seem to do\na git-svn rebase on this particular repo. For the record, I've changed\n.git/config and set svn.noMetadata on this repo.\n\nIn particular, it seems that git-svn can't find the SVN metadata (even\nif .rev_db exists). Exact error is \"Unable to determine upstream SVN\ninformation from working tree history\".\n\nThe reason why I can't do a fresh git-svn clone of the two SVN repos is\nthe repo is already at ~7700 revisions, with large files. I don't have\nthe time to do a proper clone at the moment, and I tried this as an\nalternative.\n\nAnd yes, I did all of this on a copy of an existing repo, not the\noriginal repo itself.\n\n-- \nJM Ibanez\nSoftware Architect\nOrange & Bronze Software Labs, Ltd. Co.\n\njm@orangeandbronze.com\nhttp://software.orangeandbronze.com/\n"},{"id":"66435","messageId":"4797D6C6.207@vilain.net","threadId":"11713","inReplyTo":"877ii0p89b.fsf@adler.orangeandbronze.com","subject":"Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-24T00:07:34Z","receivedAt":"2008-01-24T00:07:34Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"JM Ibanez wrote:\n> Hi,\n> \n> I've been trying to convert an existing git-svn clone to noMetadata\n> (i.e. get rid of git-svn-id in the commit messages), primarily because\n> I've been using it to track two SVN repos which were originally just a\n> single repo-- they have the same UUID but are located on different\n> machines, and have branched significantly, so content-wise are no longer\n> the same repo.\n> \n> Because the two repos have a single line of commits which they share, it\n> would be best if I could store that history in my git repo (as I need to\n> use it for merging between the two trees). Graphically, my current\n> history looks something like this:\n> \n> \n>     A -- B -- C -- D -- E -- a -- b -- c\n> \n>     A'-- B'-- C'-- D'-- E'-- x -- y -- z\n> \n> where, in reality, this should be represented as:\n> \n>     A -- B -- C -- D -- E -- a -- b -- c\n>                          \\\n>                           +- x -- y -- z\n\nStop.\n\nUse a graft.  in .git/info/grafts, put (expanding to the full SHA1s):\n\nx E\n\nThen just run something like 'git filter-branch E..z'\n\nThat will at least stitch them together.\n\nTo figure out what git-svn is expecting, make a new repository, use\ngit-svn init, and then git-svn fetch -rNNN (where NNN is a revision near\nthe most recent).  That will at least show you what git-svn expects the\nmetadata to look like, if you really want to go down the path you are\ngoing down...\n\nSam.\n"},{"id":"66465","messageId":"87wspzobnq.fsf@adler.orangeandbronze.com","threadId":"11713","inReplyTo":"4797D6C6.207@vilain.net","subject":"Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"JM Ibanez","fromEmail":"jm@orangeandbronze.com","sentAt":"2008-01-24T08:44:41Z","receivedAt":"2008-01-24T08:44:41Z","isPatch":false,"sender":{"key":"jm@orangeandbronze.com","avatar":null},"body":"Sam Vilain <sam@vilain.net> writes:\n\n> JM Ibanez wrote:\n>> Hi,\n>> \n>> I've been trying to convert an existing git-svn clone to noMetadata\n>> (i.e. get rid of git-svn-id in the commit messages), primarily because\n>> I've been using it to track two SVN repos which were originally just a\n>> single repo-- they have the same UUID but are located on different\n>> machines, and have branched significantly, so content-wise are no longer\n>> the same repo.\n>> \n>> Because the two repos have a single line of commits which they share, it\n>> would be best if I could store that history in my git repo (as I need to\n>> use it for merging between the two trees). Graphically, my current\n>> history looks something like this:\n>> \n>> \n>>     A -- B -- C -- D -- E -- a -- b -- c\n>> \n>>     A'-- B'-- C'-- D'-- E'-- x -- y -- z\n>> \n>> where, in reality, this should be represented as:\n>> \n>>     A -- B -- C -- D -- E -- a -- b -- c\n>>                          \\\n>>                           +- x -- y -- z\n>\n> Stop.\n>\n> Use a graft.  in .git/info/grafts, put (expanding to the full SHA1s):\n\nActually, I forgot to mention that I already have grafts between the two\nto track merges I performed previously. So, in fact, the history looks\nlike something this:\n\n     A -- B -- C -- D -- E -- a -- b -- c -- d -- e -- f -- m3\n                         \\         \\          \\             /\n                          \\         \\          \\   /-------+\n     A'-- B'-- C'-- D'-- E'-- x -- y -- m1-- z -- m2\n\n\nwhere x, m1, m2, and m3 are squashed merge commits + grafts.\n\nAfter git filter-branch with a graft of x to E, I get x having two\nparents as what is needed *but* because the parent IDs are part of the\ncommit object, I now get x' y', etc, something like this:\n\n\n\n     A -- B -- C -- D -- E -- a -- b -- c -- ...\n                         |         |\n                         |         |\n                         |         +--- m1'- z'-- m2' -- ...\n                         \\         \\\n                          \\         \\\n                           -- x -- y -- m1-- z -- ...\n\n\nsort of. In any case, I get duplicate commits of m1, z, etc. after the\nprimary graft point. Is this expected?\n\n-- \nJM Ibanez\nSoftware Architect\nOrange & Bronze Software Labs, Ltd. Co.\n\njm@orangeandbronze.com\nhttp://software.orangeandbronze.com/\n"},{"id":"66493","messageId":"4798CC88.505@obry.net","threadId":"11713","inReplyTo":"4797D6C6.207@vilain.net","subject":"Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2008-01-24T17:36:08Z","receivedAt":"2008-01-24T17:36:08Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Sam Vilain a écrit :\n> Use a graft.  in .git/info/grafts, put (expanding to the full SHA1s):\n\nIt is not the first time I see somebody talking about graft... I still \ndon't know exactly what it is. Any pointers to literature about this?\n\nThanks,\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"66520","messageId":"4798FFA9.7010601@vilain.net","threadId":"11713","inReplyTo":"87wspzobnq.fsf@adler.orangeandbronze.com","subject":"Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-24T21:14:17Z","receivedAt":"2008-01-24T21:14:17Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"JM Ibanez wrote:\n> Actually, I forgot to mention that I already have grafts between the two\n> to track merges I performed previously. So, in fact, the history looks\n> like something this:\n> \n>      A -- B -- C -- D -- E -- a -- b -- c -- d -- e -- f -- m3\n>                          \\         \\          \\             /\n>                           \\         \\          \\   /-------+\n>      A'-- B'-- C'-- D'-- E'-- x -- y -- m1-- z -- m2\n> \n> \n> where x, m1, m2, and m3 are squashed merge commits + grafts.\n> \n> After git filter-branch with a graft of x to E, I get x having two\n> parents as what is needed *but* because the parent IDs are part of the\n> commit object, I now get x' y', etc, something like this:\n> \n> \n> \n>      A -- B -- C -- D -- E -- a -- b -- c -- ...\n>                          |         |\n>                          |         |\n>                          |         +--- m1'- z'-- m2' -- ...\n>                          \\         \\\n>                           \\         \\\n>                            -- x -- y -- m1-- z -- ...\n> \n> \n> sort of. In any case, I get duplicate commits of m1, z, etc. after the\n> primary graft point. Is this expected?\n\nI think you need to use a parent filter that looks up the old commit ID\nin the grafts, and adjusts the parents accordingly.  I don't think I'd\nbe able to nail it down any further than that without actually trying.\n\nI think the intent of git filter-branch's grafting support is that this\nshouldn't happen, so if you can produce a test case then the bug can\nlikely be fixed.\n\nSam.\n"},{"id":"66523","messageId":"479900DF.9010904@vilain.net","threadId":"11713","inReplyTo":"4798CC88.505@obry.net","subject":"Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-24T21:19:27Z","receivedAt":"2008-01-24T21:19:27Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Pascal Obry wrote:\n> Sam Vilain a écrit :\n>> Use a graft.  in .git/info/grafts, put (expanding to the full SHA1s):\n> \n> It is not the first time I see somebody talking about graft... I still \n> don't know exactly what it is. Any pointers to literature about this?\n\nDocumentation/repository-layout.txt in the distribution\n\nDebian for one installs this to\n/usr/share/doc/git-doc/repository-layout.html\n\nSam.\n"},{"id":"66591","messageId":"479A4090.4090708@obry.net","threadId":"11713","inReplyTo":"479900DF.9010904@vilain.net","subject":"Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2008-01-25T20:03:28Z","receivedAt":"2008-01-25T20:03:28Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Sam,\n\n> Debian for one installs this to\n> /usr/share/doc/git-doc/repository-layout.html\n\nThanks, will have a look.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"}]}