{"thread":{"id":"21573","subject":"git-svn not fetching all revisions","startedAt":"2009-11-10T18:08:26Z","lastAt":"2009-11-20T04:12:10Z","messageCount":4,"participants":["Marcus Better","Sam Vilain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127261","messageId":"4AF9AC1A.5000100@better.se","threadId":"21573","inReplyTo":null,"subject":"git-svn not fetching all revisions","fromName":"Marcus Better","fromEmail":"marcus@better.se","sentAt":"2009-11-10T18:08:26Z","receivedAt":"2009-11-10T18:08:26Z","isPatch":false,"sender":{"key":"marcus@better.se","avatar":"https://gravatar.com/avatar/f35bd8577ede28717b97271eaaeef0cb8295b72caa678154d672f0ded63c6bdc?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nHi,\n\nI have trouble cloning a SVN repository with a somewhat weird history.\nIts layout has been reorganised, and is currently using a standard\nlayout like this:\n\n  project/\n    trunk/\n    branches/\n    tags/\n  otherproject/\n    ...\n\nThe problem is that the trunk was replaced by a branch at some point.\nWhen I do \"git svn clone -s svn://host/repo/project\" it only fetches the\n\"old\" trunk up to the time of the switch, and then stops. Newer\nrevisions of the \"new\" trunk are not fetched and cannot be seen with\n\"find-rev\".\n\nThe history of the repo is something like this: Initial layout is\n\n  trunk/\n    project/\n    otherstuff/\n  branches/\n\nThen we had the following sequence:\n\n1. commit stuff to trunk/project/...\n2. create \"branches/mybranch\" from trunk/project\n3. some commits on trunk and branches\n4. moved trunk/project to branches/old_trunk\n5. moved trunk/otherstuff to /otherstuff. /trunk is now empty (***)\n6. removed /trunk directory\n7. create /project\n8. move branches/mybranch to project/trunk\n9. commit stuff on project/trunk\n\n(***) last commit seen in clone.\n\nNow step 5 is the last revision that appears in the git svn clone. It\nshows up as the last commit on remotes/trunk.\n\nApparently git svn has failed to follow the move from branches/mybranch\nto trunk. The last commit seen on remotes/mybranch in the clone is from\nbefore the move to trunk (step 3).\n\nI have tried replaying the above steps with some variations in a new svn\nrepository, but apparently I'm missing something because I couldn't\nreproduce the issue. I cannot publish the real svn repo.\n\nI use git and git-svn 1.6.5.2 (Debian amd64 packages).\n\nCheers,\n\nMarcus\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org\n\niEYEARECAAYFAkr5rBkACgkQXjXn6TzcAQnRZQCgrAsQ72wLw/iWx33lHQHi6Di7\nwWkAnioEAxJyM/vr802+vzRXq+ZeWjeA\n=TW7j\n-----END PGP SIGNATURE-----\n"},{"id":"127289","messageId":"4AFA36F0.6070501@vilain.net","threadId":"21573","inReplyTo":"4AF9AC1A.5000100@better.se","subject":"Re: git-svn not fetching all revisions","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-11-11T04:00:48Z","receivedAt":"2009-11-11T04:00:48Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Marcus Better wrote:\n> The problem is that the trunk was replaced by a branch at some point.\n> When I do \"git svn clone -s svn://host/repo/project\" it only fetches the\n> \"old\" trunk up to the time of the switch, and then stops. Newer\n> revisions of the \"new\" trunk are not fetched and cannot be seen with\n> \"find-rev\".\n\nYeah.  Try doing it in parts - fetch the two stages of the history\nexplicitly using the revision range arguments to 'git svn fetch' - and\nthen graft the histories together and fix up with git filter-branch.  A\nbit of a hassle, but unfortunately there's not much other option...\n\nSam\n"},{"id":"127899","messageId":"4B0534FF.5040001@better.se","threadId":"21573","inReplyTo":"4AFA36F0.6070501@vilain.net","subject":"Re: git-svn not fetching all revisions","fromName":"Marcus Better","fromEmail":"marcus@better.se","sentAt":"2009-11-19T12:07:27Z","receivedAt":"2009-11-19T12:07:27Z","isPatch":false,"sender":{"key":"marcus@better.se","avatar":"https://gravatar.com/avatar/f35bd8577ede28717b97271eaaeef0cb8295b72caa678154d672f0ded63c6bdc?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nSam Vilain wrote:\n> Marcus Better wrote:\n>> The problem is that the trunk was replaced by a branch at some point.\n\n> Yeah.  Try doing it in parts - fetch the two stages of the history\n> explicitly using the revision range arguments to 'git svn fetch' - and\n> then graft the histories together and fix up with git filter-branch.\n\nOk, that works, but how can I now sync with the svn repository with git\nsvn rebase/dcommit? I think the filter-branch rewriting confuses git-svn.\n\nCheers,\n\nMarcus\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org\n\niEYEARECAAYFAksFNPsACgkQXjXn6TzcAQkr+QCgxQ1r68v2O1Ux7YFoS5IQS1GT\n/cgAoLoTgRcIK7vMTJWfmN2XAhcy0eOa\n=dnet\n-----END PGP SIGNATURE-----\n"},{"id":"127974","messageId":"4B06171A.10801@vilain.net","threadId":"21573","inReplyTo":"4B0534FF.5040001@better.se","subject":"Re: [spf:guess] Re: git-svn not fetching all revisions","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-11-20T04:12:10Z","receivedAt":"2009-11-20T04:12:10Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Marcus Better wrote:\n> Ok, that works, but how can I now sync with the svn repository with git\n> svn rebase/dcommit? I think the filter-branch rewriting confuses git-svn.\n>\n\nA quick hint: git-svn only relies on the last piece of metadata it can\nsee in 'git log'; so make sure that one looks right and you should be\nfine...\n\nSam\n"}]}