{"thread":{"id":"21773","subject":"Unable to checkout a particular SVN revision","startedAt":"2009-11-28T02:05:11Z","lastAt":"2009-12-01T04:59:25Z","messageCount":5,"participants":["Marc Liyanage","Michael J Gruber","Daniele Segato"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"128612","messageId":"718EEBA2-FA4B-402D-B2FC-A8F14D79F6FF@entropy.ch","threadId":"21773","inReplyTo":null,"subject":"Unable to checkout a particular SVN revision","fromName":"Marc Liyanage","fromEmail":"marc@entropy.ch","sentAt":"2009-11-28T02:05:11Z","receivedAt":"2009-11-28T02:05:11Z","isPatch":false,"sender":{"key":"marc@entropy.ch","avatar":"https://gravatar.com/avatar/4430cb5155d3e301eef962449f782bc8756a6f474b63367250231327afd739d7?d=mp&s=160"},"body":"\nI'm trying to clone a specific SVN revision with git-svn:\n\n    git svn clone -r 12345 https://host/svn/foo/branches/bar xyz\n\nbut it doesn't check out any files, I see just this:\n\n    Initialized empty Git repository in /Users/liyanage/Desktop/xyz/.git\n\nIf I try the same thing with SVN like this:\n\n    svn co -r 12345 https://host/svn/foo/branches/bar xyz\n    \nthen I get what I expect, it checks out all the files and \"svn info\" gives me this revision.\n\n\nI think it's because this particular revision wasn't committed on this branch, i.e. it doesn't show up in \"svn log\". If I try a revision that is listed in the log, it works as expected.\n\n\nIs there a way to make this work?\n    \n"},{"id":"128629","messageId":"4B113BAD.8090604@drmicha.warpmail.net","threadId":"21773","inReplyTo":"718EEBA2-FA4B-402D-B2FC-A8F14D79F6FF@entropy.ch","subject":"Re: Unable to checkout a particular SVN revision","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-11-28T15:03:09Z","receivedAt":"2009-11-28T15:03:09Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Marc Liyanage venit, vidit, dixit 28.11.2009 03:05:\n> \n> I'm trying to clone a specific SVN revision with git-svn:\n> \n>     git svn clone -r 12345 https://host/svn/foo/branches/bar xyz\n> \n> but it doesn't check out any files, I see just this:\n> \n>     Initialized empty Git repository in /Users/liyanage/Desktop/xyz/.git\n> \n> If I try the same thing with SVN like this:\n> \n>     svn co -r 12345 https://host/svn/foo/branches/bar xyz\n>     \n> then I get what I expect, it checks out all the files and \"svn info\" gives me this revision.\n> \n> \n> I think it's because this particular revision wasn't committed on this branch, i.e. it doesn't show up in \"svn log\". If I try a revision that is listed in the log, it works as expected.\n> \n> \n> Is there a way to make this work?\n\nNo. Because \"this\" is different in the two cases above: \"git svn clone\"\nclones the history of an svn repo, and the command above clearly gives\nyou the history of that branch in the specified revision range\n(consisting of 1 revision). It is empty.\n\n\"svn co\" checks out a specific revision.\n\nYou cannot \"clone\" a revision.\n\nIf all you want is a git repository with no history, but with the files\nof a specific svn revision, you can\nsvn co -r 12345 https://host/svn/foo/branches/bar xyz\ncd xyz\ngit init\nfind . -name .svn -print0 | xargs -0 rm -Rf\ngit add .\ngit commit -m \"r12345 of branch bar\"\n\nMichael\n"},{"id":"128663","messageId":"C190685B-C096-46A3-B03C-3219C481107C@entropy.ch","threadId":"21773","inReplyTo":"4B113BAD.8090604@drmicha.warpmail.net","subject":"Re: Unable to checkout a particular SVN revision","fromName":"Marc Liyanage","fromEmail":"marc@entropy.ch","sentAt":"2009-11-29T06:41:36Z","receivedAt":"2009-11-29T06:41:36Z","isPatch":false,"sender":{"key":"marc@entropy.ch","avatar":"https://gravatar.com/avatar/4430cb5155d3e301eef962449f782bc8756a6f474b63367250231327afd739d7?d=mp&s=160"},"body":"\nThanks for the explanation so far.\n\nOn 28.11.2009, at 07:03, Michael J Gruber wrote:\n\n> No. Because \"this\" is different in the two cases above: \"git svn clone\"\n> clones the history of an svn repo, and the command above clearly gives\n> you the history of that branch in the specified revision range\n> (consisting of 1 revision). It is empty.\n\nI still don't quite understand why it couldn't do the same thing as the SVN checkout. That does exactly what I expect, it reflects the state of that part of the repository at the time of that revision. Would this be possible, but it's simply not (yet) implemented?\n\nThe problem I'm dealing with are svn:externals definitions that are pegged to such revisions. SVN checks them out fine, but git svn doesn't, so I have to hunt down the appropriate revision manually.\n\n\n\n\n______________________________\nMarc Liyanage\nwww.entropy.ch\n\nskype mliyanage\niChat liyanage@mac.com\n"},{"id":"128692","messageId":"1259513411.32532.22.camel@localhost","threadId":"21773","inReplyTo":"718EEBA2-FA4B-402D-B2FC-A8F14D79F6FF@entropy.ch","subject":"Re: Unable to checkout a particular SVN revision","fromName":"Daniele Segato","fromEmail":"daniele.bilug@gmail.com","sentAt":"2009-11-29T16:50:11Z","receivedAt":"2009-11-29T16:50:11Z","isPatch":false,"sender":{"key":"daniele.bilug@gmail.com","avatar":null},"body":"Il giorno ven, 27/11/2009 alle 18.05 -0800, Marc Liyanage ha scritto:\n> I'm trying to clone a specific SVN revision with git-svn:\n> \n>     git svn clone -r 12345 https://host/svn/foo/branches/bar xyz\n> \n> but it doesn't check out any files, I see just this:\n> \n>     Initialized empty Git repository in /Users/liyanage/Desktop/xyz/.git\n> \n> If I try the same thing with SVN like this:\n> \n>     svn co -r 12345 https://host/svn/foo/branches/bar xyz\n>     \n> then I get what I expect, it checks out all the files and \"svn info\" gives me this revision.\n> \n> \n> I think it's because this particular revision wasn't committed on this branch, i.e. it doesn't show up in \"svn log\". If I try a revision that is listed in the log, it works as expected.\n> \n> \n> Is there a way to make this work?\n\n\nYou had to understand the difference between a distributed version\ncontrol system (git) and a centralized version control system (svn).\n\n\nOn SVN there is a central repository and all user checkout a SINGLE\nrevision at a time, if they want to switch to another revision/branch\nthey had to update the local files communicating with the central\nrepository (can't work offline)\n\n\nOn Git you clone the ENTIRE history of a repository and you keep it\n(all) locally. If you want to switch to another \"revision\" or branch you\ncan do it locally without interacting over network with a remote\nrepository, if you want to commit you can do it locally and the first\ntime you got connected to the network you can push your change to the\nremote repository and pull others changes.\n\nGit-SVN is a tool that allow you to interact with an SVN repository\nusing Git as client: the cool thing is that you get a lot of the\nfeatures of a distributed repository even if you are interacting with a\ncentralized one.\nThe bad news is that cloning the first time is really really slow: this\nis because SVN has not been wrote to support distributed repository and\nis not optimized to allow cloning of all the history.\n\n\nto made thinks clearer:\n\nSVN:\n\nsvn checkout -r <revision> <url> # this connect to <url> and download\nthat revision locally\n\n\nGIT:\n\ngit svn clone <url> -T trunk -t tags -b branches # this connect to <url>\nand start from revision 1 to the last cloning all the repository\n(supposing you have a standard SVN structure with trunk/tags/branches)\n\nthis could keep a lot of time if it is a big repository (even days)\n\nbut when it is done you can checkout any revision:\n\ngit checkout <your-revision-commit>\n\ngit doesn't store the history as SVN do, revision numbers does NOT make\nsense in a distributed environment... it just keep revision numbars\ninside commits comments.. so you'll first had to search your revision\nnumber into the git log history and then checkout the corresponding\ncommit.\n\n\nGit is NOT another SVN client, is a completely different way of doing\nversioning and you had to understand this and stop trying to use git as\nyou use svn until now\n"},{"id":"128832","messageId":"F558F791-E9C4-4340-BE3D-A46464F6033B@entropy.ch","threadId":"21773","inReplyTo":"1259513411.32532.22.camel@localhost","subject":"Re: Unable to checkout a particular SVN revision","fromName":"Marc Liyanage","fromEmail":"marc@entropy.ch","sentAt":"2009-12-01T04:59:25Z","receivedAt":"2009-12-01T04:59:25Z","isPatch":false,"sender":{"key":"marc@entropy.ch","avatar":"https://gravatar.com/avatar/4430cb5155d3e301eef962449f782bc8756a6f474b63367250231327afd739d7?d=mp&s=160"},"body":"\nOn 29.11.2009, at 08:50, Daniele Segato wrote:\n\n> You had to understand the difference between a distributed version\n> control system (git) and a centralized version control system (svn).\n\nI understand that, I use (pure) git for all my personal projects, and it works great.\n\nAnd even as a front end for SVN, I am *very* happy with what I got from git-svn so far, I think it is an excellent tool, even better than the actual SVN client. I track an SVN repository in my local git master branch, then branch off locally for development, send patches for review, reorder/consolidate/squash commits back onto my master branch and then dcommit that back to SVN. All that is great.\n\n\nI would like to understand why \n\n   git svn clone -r n <url>\n\ndoes not work as expected while\n\n   git svn clone -r m <url>\n\ndoes work perfectly fine, if that m revision number happens to have been committed on the particular SVN branch I cloned (you left off that -r in your git svn clone examples). As it is, I have to hunt for the next lower or higher revision number that happens to be on that branch.\n\nI might be doing a poor job explaining what my question is... Basically, what prevents that operation from doing the same thing that SVN does? Lack of information, i.e. should I just clone higher up in the tree?\n\n\n\n______________________________\nMarc Liyanage\nwww.entropy.ch\n\nskype mliyanage\niChat liyanage@mac.com\n"}]}