{"thread":{"id":"8977","subject":"git-cvsimport newbie question","startedAt":"2007-07-11T07:20:10Z","lastAt":"2007-07-11T15:45:48Z","messageCount":2,"participants":["Scott Lamb"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47007","messageId":"469484AA.7040701@slamb.org","threadId":"8977","inReplyTo":null,"subject":"git-cvsimport newbie question","fromName":"Scott Lamb","fromEmail":"slamb@slamb.org","sentAt":"2007-07-11T07:20:10Z","receivedAt":"2007-07-11T07:20:10Z","isPatch":false,"sender":{"key":"slamb@slamb.org","avatar":null},"body":"I'm trying to automatically maintain a git mirror of a (very) remote CVS\nrepository which is suitable for a few people to clone. I'm creating and\nupdating it now by running this periodically:\n\n    $ mkdir ~/git/racoon2.git; cd ~/git/racoon2.git && git-cvsimport -d\n:pserver:anoncvs@anoncvs.racoon2.wide.ad.jp:/anoncvs/racoon2 -r wide -i\nracoon2\n\nand cloning/pulling it in the simplest possible way:\n\n    $ git clone racoon2.git myracoon2\n    $ cd myracoon2\n    $ stg init\n    ...work work work...\n    $ stg pull\n\nBut my clones don't see all the upstream branches:\n\n    $ git remote show origin\n    * remote origin\n      URL: /home/slamb/git/racoon2.git/.git\n      Remote branch(es) merged with 'git pull' while on branch master\n        master\n      Tracked remote branches\n        master\n\nIn fact, the only branch I see is the one which isn't even updated,\nwhich confused into thinking upstream wasn't changing. (I can't say the\nmanpage didn't warn me, though - \"By default initial import will create\nand populate a \"master\" branch from the CVS repository's main branch\nwhich you're free to work with; after that, you need to git merge\nincremental imports, or any CVS branches, yourself.\")\n\nOkay, it seems like what I actually want is this:\n\n    $ git-cvsimport -d $CVSROOT -o master -i racoon2\n\nwhich essentially creates a repository that is a mirror of upstream\nrather than one which pretends to be tracking a nonexistent upstream git\nrepository. Now on the cloned branches \"git branch -r\" does what I want,\nas does a simple \"git pull\".\n\nBut from the manpage, it appears I'm reverting to a much older way of\ndoing things. Maybe I should be giving the newer way a shot? Was this\n\"-r\" way meant to be used with cloning the mirrored repository? If so,\nwhat's the workflow there? maybe I should reset racoon2.git's \"master\"\nbranch to the beginning of time (to avoid confusion), update head to\npoint to remotes/wide/master (so simple \"git clone\" and \"git pull\"\ncommands get CVS HEAD), and then update remote.origin.fetch on each\ncloned repository to pull in other branches as needed? But even after\ndoing that, \"git remote show origin\" on a cloned repository still won't\ngive me the list of branches I want. So this seems doesn't seem as good\nas the old way.\n\nIs there any way to make a repository cloned from a new-style\ncvsimported one show the list of branches? It looks like I can't have a\nremote in one repository refer to a remote in another repository - it\nwants a direct reference. Most things seem to ignore origin's remotes,\nat least unless I explicitly name one like \"git pull origin\nrefs/remotes/wide/master\".\n\nBest regards,\nScott\n\n-- \nScott Lamb <http://www.slamb.org/>\n"},{"id":"47044","messageId":"4694FB2C.4070505@slamb.org","threadId":"8977","inReplyTo":"469484AA.7040701@slamb.org","subject":"Re: git-cvsimport newbie question","fromName":"Scott Lamb","fromEmail":"slamb@slamb.org","sentAt":"2007-07-11T15:45:48Z","receivedAt":"2007-07-11T15:45:48Z","isPatch":false,"sender":{"key":"slamb@slamb.org","avatar":null},"body":"Scott Lamb wrote:\n> But from the manpage, it appears I'm reverting to a much older way of\n> doing things. Maybe I should be giving the newer way a shot? Was this\n> \"-r\" way meant to be used with cloning the mirrored repository? If so,\n> what's the workflow there? maybe I should reset racoon2.git's \"master\"\n> branch to the beginning of time (to avoid confusion), update head to\n> point to remotes/wide/master (so simple \"git clone\" and \"git pull\"\n> commands get CVS HEAD), and then update remote.origin.fetch on each\n> cloned repository to pull in other branches as needed? But even after\n> doing that, \"git remote show origin\" on a cloned repository still won't\n> give me the list of branches I want. So this seems doesn't seem as good\n> as the old way.\n> \n> Is there any way to make a repository cloned from a new-style\n> cvsimported one show the list of branches? It looks like I can't have a\n> remote in one repository refer to a remote in another repository - it\n> wants a direct reference. Most things seem to ignore origin's remotes,\n> at least unless I explicitly name one like \"git pull origin\n> refs/remotes/wide/master\".\n\nHmm...I just saw in a git-svn howto [1] this text:\n\n    [FIXME] This is all very important information for people setting\n    up central tracking servers. This needs expansion, probably its own\n    section. Talk about tracking server symlink tricks\n    (eg refs/heads/svn -> ../remotes and\n    refs/ttags/svn -> ../remotes/tags)\n\nMaybe I want to be doing something similar with git-cvsimport? I'm sure\nthere's *some* reason way to take advantage of the my named remote; I\njust haven't figured out what it is yet. Could someone please fill in\ndetails on this text?\n\nBest regards,\nScott\n\n\n[1] - http://utsl.gen.nz/talks/git-svn/intro.html\n"}]}