{"thread":{"id":"6521","subject":"cvsimport/cvsps: wrong revisions in branch","startedAt":"2007-01-25T14:22:42Z","lastAt":"2007-01-26T23:12:49Z","messageCount":10,"participants":["Gerrit Pape","Simon 'corecode' Schubert","Uwe Kleine-König","Shawn O. Pearce","Martin Langhoff","Jakub Narebski","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32605","messageId":"20070125142242.1402.qmail@b4b5deb4d44aa3.315fe32.mid.smarden.org","threadId":"6521","inReplyTo":null,"subject":"cvsimport/cvsps: wrong revisions in branch","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-01-25T14:22:42Z","receivedAt":"2007-01-25T14:22:42Z","isPatch":false,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"Hi, I struggle with importing a CVS repository into git to switch over\ndevelopment.  In some branches there're differences in the source code\nafter importing into git.  We tracked this down to tags and branches\nthat where tagged partially in CVS, first a tag was set on one\nsubdirectory tree (sources), later on another subdirectory tree (docs).\nThis confuses cvsimport or cvsps, the tag in git after import doesn't\nmatch the tag in CVS.\n\nI use cvsps from http://ydirson.free.fr/soft/git/cvsps.git, here's how\nto reproduce:\n\n$ cvs -d /tmp/cvs init\n$ mkdir repo && cd repo/\n$ cvs -d /tmp/cvs import -m initial repo vendor-tag release-tag\n\nNo conflicts created by this import\n\n$ cd .. && rmdir repo \n$ cvs -d /tmp/cvs co repo  \ncvs checkout: Updating repo\n$ cd repo/\n$ mkdir a && echo foo >a/a\n$ cvs add a a/a\nDirectory /tmp/cvs/repo/a added to the repository\ncvs add: scheduling file `a/a' for addition\ncvs add: use `cvs commit' to add this file permanently\n$ cvs ci -m foo\ncvs commit: Examining .\ncvs commit: Examining a\n/tmp/cvs/repo/a/a,v  <--  a/a\ninitial revision: 1.1\n$ cvs tag TAG0 a/\ncvs tag: Tagging a\nT a/a\n$ echo 'not in TAG0' >a/a \n$ cvs ci -m 'not in TAG0'\ncvs commit: Examining .\ncvs commit: Examining a\n/tmp/cvs/repo/a/a,v  <--  a/a\nnew revision: 1.2; previous revision: 1.1\n$ mkdir b && echo bar >b/b\n$ cvs add b b/b\nDirectory /tmp/cvs/repo/b added to the repository\ncvs add: scheduling file `b/b' for addition\ncvs add: use `cvs commit' to add this file permanently\n$ cvs ci -m 'add b/b'\ncvs commit: Examining .\ncvs commit: Examining a\ncvs commit: Examining b\n/tmp/cvs/repo/b/b,v  <--  b/b\ninitial revision: 1.1\n$ cvs tag TAG0 b/\ncvs tag: Tagging b\nT b/b\n$ git-cvsimport -C git\nCommitting initial tree d59780674121a7f49784509ee85079a36c9954a3\n$ cd git/\n$ git checkout -f master\n$ git checkout -b tmp TAG0\n$ cat a/a \nnot in TAG0\n$ \n\nThanks, Gerrit.\n"},{"id":"32606","messageId":"45B8C032.7020004@fs.ei.tum.de","threadId":"6521","inReplyTo":"20070125142242.1402.qmail@b4b5deb4d44aa3.315fe32.mid.smarden.org","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-01-25T14:35:30Z","receivedAt":"2007-01-25T14:35:30Z","isPatch":false,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Gerrit Pape wrote:\n> Hi, I struggle with importing a CVS repository into git to switch over\n> development.  In some branches there're differences in the source code\n> after importing into git.  We tracked this down to tags and branches\n> that where tagged partially in CVS, first a tag was set on one\n> subdirectory tree (sources), later on another subdirectory tree (docs).\n> This confuses cvsimport or cvsps, the tag in git after import doesn't\n> match the tag in CVS.\n\nhow do you expect this to ever work?  your tag is not a time stable one.  the tag spans multiple change sets.  best forget the whole tag thing, seriously.  my cvs converter [1] already has a hard time reproducing branches correctly.  doing this with tags is impossible.  svn can do this because they don't have tags, so it is a kind of fake.  of course you could do this in git as well by actually creating a branch for a tag, but it is really messy.  just don't do that.\n\ngood luck\n  simon\n\n[1]: <http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs>, not 100% yet, but probably the best you can get at the moment.  i'm a perfectionist, so i might never call it \"done\".\n\n-- \nServe - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /\"\\\nWork - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \\ /\nParty Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \\\nDude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \\\n\n"},{"id":"32609","messageId":"20070125150536.GA8314@cepheus","threadId":"6521","inReplyTo":"45B8C032.7020004@fs.ei.tum.de","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-01-25T15:05:36Z","receivedAt":"2007-01-25T15:05:36Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hi Simon,\n\nSimon 'corecode' Schubert wrote:\n> [1]: <http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs>, not 100% yet, but \n> probably the best you can get at the moment.  i'm a perfectionist, so i \n> might never call it \"done\".\nI don't know ruby nor hg, but I managed to clone your repo.  Now I'm\nstuck with:\n\n\tzeisberg@cepheus:~/hsrc/fromcvs$ ruby1.8 fromcvs.rb \n\tfromcvs.rb:1:in `require': no such file to load -- rcsfile (LoadError)\n\t        from fromcvs.rb:1\n\n`locate rcsfile` only returns /usr/share/man/man5/rcsfile.5.gz from the\nrcs package.  `apt-cache search rcsfile` returns nothing.  (This is on\nDebian testing/unstable.)  `apt-cache search rcs ruby` only returns\n\n\taswiki - WikiWikiWeb clone (Wiki Engine) written in Ruby\n\nGoogle didn't help me either.\n\nIs there some documentation how to get that to work?\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\nhttp://www.google.com/search?q=the+speed+of+light+in+m%2Fs\n"},{"id":"32617","messageId":"45B8D9D1.2000802@fs.ei.tum.de","threadId":"6521","inReplyTo":"20070125150536.GA8314@cepheus","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-01-25T16:24:49Z","receivedAt":"2007-01-25T16:24:49Z","isPatch":false,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Uwe Kleine-König wrote:\n> I don't know ruby nor hg, but I managed to clone your repo.  Now I'm\n> stuck with:\n> \n> \tzeisberg@cepheus:~/hsrc/fromcvs$ ruby1.8 fromcvs.rb \n> \tfromcvs.rb:1:in `require': no such file to load -- rcsfile (LoadError)\n> \t        from fromcvs.rb:1\n\nyes, you need the rcsparse module, available from the same address.\n\n> Is there some documentation how to get that to work?\n\nI've written it a million times to different people on irc, but somehow I never got around to making a README out of it.  I'll write it up very condensed here and add this as a base for a README to the the repo.\n\nFrom CVS to * in little time\n============================\n\nPrerequisites:\n  - ruby (1.8.5 known working)\n  - fromcvs, <http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs>\n  - rcsparse, <http://ww2.fs.ei.tum.de/~corecode/hg/rcsparse> (ruby module)\n  - Ruby/RBTree, <http://raa.ruby-lang.org/project/ruby-rbtree/>\n  - for git: git-fast-import, <git://repo.or.cz/git/fastimport.git/>\n  - for hg: ruby-python, <http://ww2.fs.ei.tum.de/~corecode/hg/ruby-python>\n\n\nHow to convert a CVS repo:\n\nThere is still a nice frontend missing, so you have to invoke the scripts by hand.\n\n% mkdir gitdest && (cd gitdest && git init)\n% ruby togit.rb /path/to/cvsroot modulename gitdest\n% cd gitdest && git-repack -a -f -d      # optional, saves 20% or so\n\nIf you want to get nice author names, create setup the file authormap:\n\ncat > /path/to/cvsroot/CVSROOT/authormap\ncorecode\tSimon 'corecode' Schubert <corecode@fs.ei.tum.de>\njdoe\t\tJon H. Doe <hannidoe@example.net>\nbranch-fixup\tCVS repo conversion <flames@example.net>\n\nthat's about for the quickstart.  be sure to report conversion errors or runtime issues (possibly due to obscure CVS repo activity) to me.\n\ncheers\n  simon\n\n-- \nServe - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /\"\\\nWork - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \\ /\nParty Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \\\nDude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \\\n\n"},{"id":"32630","messageId":"20070125175220.GC13089@spearce.org","threadId":"6521","inReplyTo":"45B8C032.7020004@fs.ei.tum.de","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-25T17:52:20Z","receivedAt":"2007-01-25T17:52:20Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Simon 'corecode' Schubert <corecode@fs.ei.tum.de> wrote:\n> Gerrit Pape wrote:\n> >Hi, I struggle with importing a CVS repository into git to switch over\n> >development.  In some branches there're differences in the source code\n> >after importing into git.  We tracked this down to tags and branches\n> >that where tagged partially in CVS, first a tag was set on one\n> >subdirectory tree (sources), later on another subdirectory tree (docs).\n> >This confuses cvsimport or cvsps, the tag in git after import doesn't\n> >match the tag in CVS.\n> \n> how do you expect this to ever work?  your tag is not a time stable one.  \n> the tag spans multiple change sets.  best forget the whole tag thing, \n> seriously.  my cvs converter [1] already has a hard time reproducing \n> branches correctly.  doing this with tags is impossible.  svn can do this \n> because they don't have tags, so it is a kind of fake.  of course you could \n> do this in git as well by actually creating a branch for a tag, but it is \n> really messy.  just don't do that.\n\nIf you are importing your history you probably really do want\nthe tags.  As broken as they may be.  Because they represent real\nstate that you probably need to be able to recover in the future.\n\nOne could make the argument that most very old tags aren't worth\nimporting, but certainly tags related to recent releases that are\nstill in production use (and thus may need patching) are probably\nneeded.\n\nIn Git the only way to really do this is to create a branch from a\nnearby commit, then modify the branch until it conforms to the tag.\nDo a series of evil merges from the relevant commits of each file\nuntil you get the branch looking the way it needs to.  *THEN*\nyou tag it.\n \n> [1]: <http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs>, not 100% yet, but \n> probably the best you can get at the moment.  i'm a perfectionist, so i \n> might never call it \"done\".\n\nAlso probably the fastest CVS->Git converter publiclly available,\nas its backed by git-fast-import.  :)\n\n-- \nShawn.\n"},{"id":"32671","messageId":"46a038f90701251806k719dd35p7b13fe049b9cf25c@mail.gmail.com","threadId":"6521","inReplyTo":"45B8C032.7020004@fs.ei.tum.de","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-01-26T02:06:19Z","receivedAt":"2007-01-26T02:06:19Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 1/26/07, Simon 'corecode' Schubert <corecode@fs.ei.tum.de> wrote:\n> how do you expect this to ever work?  your tag is not a time stable one.\n\nI agree on that, but you _can_ try a range of importers. I think you\nshould give Keith Packard's parsecvs a try. It is memory-bound and\nwon't do incremental imports but it manages to import some repos\ncvsimport can't do directly.\n\nThe other option is to use cvs2svn, which is the most conservative and\ncareful importer around, and most likely to be able to deal with your\ninsane tags. And then git-svnimport right after ;-)\n\ncheers\n\nm\n"},{"id":"32686","messageId":"45B99D9C.40908@fs.ei.tum.de","threadId":"6521","inReplyTo":"46a038f90701251806k719dd35p7b13fe049b9cf25c@mail.gmail.com","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-01-26T06:20:12Z","receivedAt":"2007-01-26T06:20:12Z","isPatch":false,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Martin Langhoff wrote:\n> On 1/26/07, Simon 'corecode' Schubert <corecode@fs.ei.tum.de> wrote:\n>> how do you expect this to ever work?  your tag is not a time stable one.\n> I agree on that, but you _can_ try a range of importers. I think you\n> should give Keith Packard's parsecvs a try. It is memory-bound and\n> won't do incremental imports but it manages to import some repos\n> cvsimport can't do directly.\n\nwhichever importer you try, it *will* fail to create pure tags equivalent to the CVS tag.  it is not possible.  of course you can do trickery and create branches to simulate crooked tags.\n\n> The other option is to use cvs2svn, which is the most conservative and\n> careful importer around, and most likely to be able to deal with your\n> insane tags. And then git-svnimport right after ;-)\n\nyes, cvs2svn is quite top notch regarding the brokenness in repos it tolerates.  however, going from svn to git is equally complicated again, as you can't nicely convert svn's copy-to-branch if it again copies files from different revisions.  you just converted the problem to svn, but you didn't make it go away.\n\ncheers\n  simon\n\n-- \nServe - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /\"\\\nWork - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \\ /\nParty Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \\\nDude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \\\n\n"},{"id":"32696","messageId":"20070126090006.10943.qmail@2a614a0300a3c0.315fe32.mid.smarden.org","threadId":"6521","inReplyTo":"46a038f90701251806k719dd35p7b13fe049b9cf25c@mail.gmail.com","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2007-01-26T09:00:06Z","receivedAt":"2007-01-26T09:00:06Z","isPatch":false,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Fri, Jan 26, 2007 at 03:06:19PM +1300, Martin Langhoff wrote:\n> The other option is to use cvs2svn, which is the most conservative and\n> careful importer around, and most likely to be able to deal with your\n> insane tags. And then git-svnimport right after ;-)\n\nWe tried that already, cvs2svn did manage the tags and branches\ncorrectly, but then git-svnimport had the same problems.\n\nThanks, Gerrit.\n"},{"id":"32728","messageId":"epcq6f$iak$1@sea.gmane.org","threadId":"6521","inReplyTo":"45B8C032.7020004@fs.ei.tum.de","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-26T11:56:03Z","receivedAt":"2007-01-26T11:56:03Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"[Cc: git@vger.kernel.org]\n\nSimon 'corecode' Schubert wrote:\n\n> [1]: <http://ww2.fs.ei.tum.de/~corecode/hg/fromcvs>, not 100% yet, but\n> probably the best you can get at the moment.  i'm a perfectionist, so\n> I might never call it \"done\".  \n\nCould you please add info about this work (so other can use it too)\nto http://git.or.cz/gitwiki/InterfacesFrontendsAndTools in the\n\"Interaction with other Revision Control Systems\" section? TIA.\n\nP.S. Please use (if possible) word wrap around 72 - 76 columns.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"32776","messageId":"200701270012.50157.robin.rosenberg.lists@dewire.com","threadId":"6521","inReplyTo":"45B99D9C.40908@fs.ei.tum.de","subject":"Re: cvsimport/cvsps: wrong revisions in branch","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-01-26T23:12:49Z","receivedAt":"2007-01-26T23:12:49Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"fredag 26 januari 2007 07:20 skrev Simon 'corecode' Schubert:\n> whichever importer you try, it *will* fail to create pure tags equivalent\n> to the CVS tag.  it is not possible.  of course you can do trickery and\n> create branches to simulate crooked tags.\n\nWell, you could create a standalone tag not on any branch at all, I guess, \njust create a tree and a commit and tag corresponding to the tagged files. At \nleast you wouldn't be lying about the history of the tag by implicating it \nwas made through some magic merge.\n\n-- robin\n"}]}