{"thread":{"id":"13932","subject":"Working with Git and CVS in a team.","startedAt":"2008-06-13T14:33:34Z","lastAt":"2008-06-16T16:44:42Z","messageCount":14,"participants":["Mirko Stocker","Miklos Vajna","Jeff King","John J. Franey","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"79724","messageId":"200806131633.34980.mirko.stocker@hsr.ch","threadId":"13932","inReplyTo":null,"subject":"Working with Git and CVS in a team.","fromName":"Mirko Stocker","fromEmail":"mirko.stocker@hsr.ch","sentAt":"2008-06-13T14:33:34Z","receivedAt":"2008-06-13T14:33:34Z","isPatch":false,"sender":{"key":"mirko.stocker@hsr.ch","avatar":"https://gravatar.com/avatar/c7319a4f11f1e9584655281941f5cea117fe841c8b47ad3860fefb1cf7eb1822?d=mp&s=160"},"body":"Hello,\n\nOur team works on an existing project that's in CVS, but we don't have\nthe permissions to commit directly to it. We still need to make\nchanges and want to stay as up to date as possible, so we are trying\nto use git to track the CVS repository and to collaborate inside the\nteam.\n\nNow, I'm quite new to git, so I'm not sure if the solution I created\nis \"correct\", not way too complicated, or if there are problems waiting\nfor us.\n\ngit-cvsimport seems to be the solution, so I've established the \nfollowing structure:\n\n+-----------------+\n| dev.eclipse.org |\n+-----------------+\n        ^\n        | (1)\n        |         (2)                      (3)\n+---------------+      +---------------+        +------------+\n| ifs:/from-cvs | ---> | ifs:/git-proj | <----- | Merge-Dude |\n+---------------+      +---------------+        +------------+\n                          /           \\\n                         /             \\\n                        /               \\\n                    +------+         +------+\n                    | User |   (4)   | User |\n                    +------+         +------+\n\n1) I use git-cvsimport to update the repository every night. /git-proj\n   is a \"clone --bare\" of the /from-cvs repository.\n\n2) After the import, I push the changes from CVS to /git-proj using\n   'git push /git-proj origin'.\n\nThis first two steps can be done with a cronjob, there shouldn't be\nany conflicts.\n\n3) Then we have the role of a \"Merge-Dude\" who pulls the changes from\n   /git-proj and uses 'git merge origin/origin' to update his master.\n   If there are any conflicts, he resolves them and pushes everything\n   back to the master at /git-proj.\n\n4) The users can just push and pull from /git-proj.\n\n>From time to time, we can use 'git diff origin/origin' to get a patch\nwith all the changes we made and have to send upstream.\n\nWhat do you guys think, is this approach feasible?\n\nWhat I don't like is how we have to make the upstream patch(es). Is\nthere an easy way we can get multiple patches, lets say for each\ncommit we made? Or is it easier to make a lots of branches and to\nthen create a patch from the diff between the branch and origin/origin?\n\nWow, this got longer than I expected. Thanks in advance!\n\nMirko Stocker\n"},{"id":"79728","messageId":"20080613145010.GU29404@genesis.frugalware.org","threadId":"13932","inReplyTo":"200806131633.34980.mirko.stocker@hsr.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-13T14:50:10Z","receivedAt":"2008-06-13T14:50:10Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Fri, Jun 13, 2008 at 04:33:34PM +0200, Mirko Stocker <mirko.stocker@hsr.ch> wrote:\n> 3) Then we have the role of a \"Merge-Dude\" who pulls the changes from\n>    /git-proj and uses 'git merge origin/origin' to update his master.\n>    If there are any conflicts, he resolves them and pushes everything\n>    back to the master at /git-proj.\n> \n> 4) The users can just push and pull from /git-proj.\n> \n> From time to time, we can use 'git diff origin/origin' to get a patch\n> with all the changes we made and have to send upstream.\n> \n> What do you guys think, is this approach feasible?\n> \n> What I don't like is how we have to make the upstream patch(es). Is\n> there an easy way we can get multiple patches, lets say for each\n> commit we made? Or is it easier to make a lots of branches and to\n> then create a patch from the diff between the branch and origin/origin?\n\nDon't you mean origin/master?\n\nIn general, if you don't merge your changes but you rebase on top of the\nnew upstream head, then you can use 'git format-patch origin/master..'\nto create patches for each commit.\n\nIt'll include the commit message and each commit will be written out as\na separate file.\n"},{"id":"79735","messageId":"20080613160911.GB3140@sigill.intra.peff.net","threadId":"13932","inReplyTo":"200806131633.34980.mirko.stocker@hsr.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-13T16:09:11Z","receivedAt":"2008-06-13T16:09:11Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 13, 2008 at 04:33:34PM +0200, Mirko Stocker wrote:\n\n> 1) I use git-cvsimport to update the repository every night. /git-proj\n>    is a \"clone --bare\" of the /from-cvs repository.\n> \n> 2) After the import, I push the changes from CVS to /git-proj using\n>    'git push /git-proj origin'.\n\nYou could simplify this by just cvsimporting to an 'upstream' branch in\ngit-proj.\n\n> 3) Then we have the role of a \"Merge-Dude\" who pulls the changes from\n>    /git-proj and uses 'git merge origin/origin' to update his master.\n>    If there are any conflicts, he resolves them and pushes everything\n>    back to the master at /git-proj.\n\nAnd then it works the same: he just pulls 'upstream' occasionally,\nmerges it into your work, and then pushes the result.\n\n-Peff\n"},{"id":"79782","messageId":"200806132243.36695.m1stocke@hsr.ch","threadId":"13932","inReplyTo":"20080613145010.GU29404@genesis.frugalware.org","subject":"Re: Working with Git and CVS in a team.","fromName":"Mirko Stocker","fromEmail":"m1stocke@hsr.ch","sentAt":"2008-06-13T20:43:36Z","receivedAt":"2008-06-13T20:43:36Z","isPatch":false,"sender":{"key":"m1stocke@hsr.ch","avatar":null},"body":"On Friday 13 June 2008 16:50:10 Miklos Vajna wrote:\n> On Fri, Jun 13, 2008 at 04:33:34PM +0200, Mirko Stocker \n<mirko.stocker@hsr.ch> wrote:\n> > What I don't like is how we have to make the upstream patch(es). Is\n> > there an easy way we can get multiple patches, lets say for each\n> > commit we made? Or is it easier to make a lots of branches and to\n> > then create a patch from the diff between the branch and origin/origin?\n>\n> Don't you mean origin/master?\n\nHm, I'm not sure.. if I work on an a feature in a branch, and now I want to \ncreate a patch that applies to the CVS head, then I have to make the diff to \norigin/origin, right?\n\n> In general, if you don't merge your changes but you rebase on top of the\n> new upstream head, then you can use 'git format-patch origin/master..'\n> to create patches for each commit.\n\nAh, I didn't know about git-rebase, thanks! That's exactly what I wanted :) I \nthink I've already fallen in love with git.\n"},{"id":"79783","messageId":"200806132247.03947.m1stocke@hsr.ch","threadId":"13932","inReplyTo":"20080613160911.GB3140@sigill.intra.peff.net","subject":"Re: Working with Git and CVS in a team.","fromName":"Mirko Stocker","fromEmail":"m1stocke@hsr.ch","sentAt":"2008-06-13T20:47:03Z","receivedAt":"2008-06-13T20:47:03Z","isPatch":false,"sender":{"key":"m1stocke@hsr.ch","avatar":null},"body":"On Friday 13 June 2008 18:09:11 Jeff King wrote:\n> On Fri, Jun 13, 2008 at 04:33:34PM +0200, Mirko Stocker wrote:\n> > 1) I use git-cvsimport to update the repository every night. /git-proj\n> >    is a \"clone --bare\" of the /from-cvs repository.\n> >\n> > 2) After the import, I push the changes from CVS to /git-proj using\n> >    'git push /git-proj origin'.\n>\n> You could simplify this by just cvsimporting to an 'upstream' branch in\n> git-proj.\n\nHm, I've tried that, but it doesnt seem to work.. git-proj is a bare \nrepository, and git-cvsimport always creates a new .git in it. I'm using \nthe -C option to specify the target. Is anything else needed?\n\nRegards\n\nMirko\n"},{"id":"79781","messageId":"20080613204740.GA29404@genesis.frugalware.org","threadId":"13932","inReplyTo":"200806132243.36695.m1stocke@hsr.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-13T20:47:40Z","receivedAt":"2008-06-13T20:47:40Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Fri, Jun 13, 2008 at 10:43:36PM +0200, Mirko Stocker <m1stocke@hsr.ch> wrote:\n> > Don't you mean origin/master?\n> \n> Hm, I'm not sure.. if I work on an a feature in a branch, and now I want to \n> create a patch that applies to the CVS head, then I have to make the diff to \n> origin/origin, right?\n\n'origin/origin' means the 'origin' branch of the 'origin' remote. Given\nthat you said you created the 'origin' remote's repo using\ngit-cvsimport, I assumed that the 'origin' remote has only one branch\n(named 'master').\n"},{"id":"79784","messageId":"20080613205525.GA21165@sigill.intra.peff.net","threadId":"13932","inReplyTo":"200806132247.03947.m1stocke@hsr.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-13T20:55:26Z","receivedAt":"2008-06-13T20:55:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jun 13, 2008 at 10:47:03PM +0200, Mirko Stocker wrote:\n\n> Hm, I've tried that, but it doesnt seem to work.. git-proj is a bare \n> repository, and git-cvsimport always creates a new .git in it. I'm using \n> the -C option to specify the target. Is anything else needed?\n\nAh, I hadn't thought of that. Apparently git-cvsimport doesn't\nunderstand bare repos. There is even a Debian bug reported:\n\n  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472873\n\nYou might be able to hack around it with:\n\n  mkdir bare.git && (cd bare.git && git init)\n  mkdir cvsimport-hack && ln -s ../bare.git cvsimport-hack/.git\n  git cvsimport -C cvsimport-hack\n\n-Peff\n"},{"id":"79954","messageId":"200806152220.05290.me@misto.ch","threadId":"13932","inReplyTo":"20080613204740.GA29404@genesis.frugalware.org","subject":"Re: Working with Git and CVS in a team.","fromName":"Mirko Stocker","fromEmail":"me@misto.ch","sentAt":"2008-06-15T20:20:05Z","receivedAt":"2008-06-15T20:20:05Z","isPatch":false,"sender":{"key":"me@misto.ch","avatar":null},"body":"On Friday 13 June 2008 22:47:40 Miklos Vajna wrote:\n> 'origin/origin' means the 'origin' branch of the 'origin' remote. Given\n> that you said you created the 'origin' remote's repo using\n> git-cvsimport, I assumed that the 'origin' remote has only one branch\n> (named 'master').\n\nHm, git-cvsimport created a master and an origin branch. And then I push the \norigin branch to the bare repository to share it with my colleagues. So for \nthe users, origin/origin contains the original CVS content, so we need to \nmake the diff against that, don't we? That's how I think this whole thing \nworks, I might be wrong :-)\n"},{"id":"79955","messageId":"200806152222.50119.me@misto.ch","threadId":"13932","inReplyTo":"20080613205525.GA21165@sigill.intra.peff.net","subject":"Re: Working with Git and CVS in a team.","fromName":"Mirko Stocker","fromEmail":"me@misto.ch","sentAt":"2008-06-15T20:22:49Z","receivedAt":"2008-06-15T20:22:49Z","isPatch":false,"sender":{"key":"me@misto.ch","avatar":null},"body":"On Friday 13 June 2008 22:55:26 Jeff King wrote:\n> Ah, I hadn't thought of that. Apparently git-cvsimport doesn't\n> understand bare repos. There is even a Debian bug reported:\n>\n>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472873\n>\n> You might be able to hack around it with:\n>\n>   mkdir bare.git && (cd bare.git && git init)\n>   mkdir cvsimport-hack && ln -s ../bare.git cvsimport-hack/.git\n>   git cvsimport -C cvsimport-hack\n\nUh, ok.. :) Thanks. \n\nI just wondered, do I even need the additional bare repository? If I use \ngit-cvsimport with -i, then it creates only the .git without doing a \ncheckout, then we could just clone this one from the clients and pull/push to \nit?\n\nThanks\n\nMirko\n"},{"id":"79956","messageId":"20080615203438.GV29404@genesis.frugalware.org","threadId":"13932","inReplyTo":"200806152220.05290.me@misto.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-15T20:34:38Z","receivedAt":"2008-06-15T20:34:38Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Jun 15, 2008 at 10:20:05PM +0200, Mirko Stocker <me@misto.ch> wrote:\n> Hm, git-cvsimport created a master and an origin branch. And then I push the \n> origin branch to the bare repository to share it with my colleagues. So for \n> the users, origin/origin contains the original CVS content, so we need to \n> make the diff against that, don't we? That's how I think this whole thing \n> works, I might be wrong :-)\n\nOh, you are right. Sorry for the noise. I forgot that git-cvsimport\ncreates an origin branch without -o master.\n"},{"id":"79957","messageId":"20080615204841.GA10270@sigill.intra.peff.net","threadId":"13932","inReplyTo":"200806152222.50119.me@misto.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-15T20:48:41Z","receivedAt":"2008-06-15T20:48:41Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jun 15, 2008 at 10:22:49PM +0200, Mirko Stocker wrote:\n\n> >   mkdir bare.git && (cd bare.git && git init)\n> >   mkdir cvsimport-hack && ln -s ../bare.git cvsimport-hack/.git\n> >   git cvsimport -C cvsimport-hack\n> \n> Uh, ok.. :) Thanks. \n> \n> I just wondered, do I even need the additional bare repository? If I use \n> git-cvsimport with -i, then it creates only the .git without doing a \n> checkout, then we could just clone this one from the clients and pull/push to \n> it?\n\nSure. From the client perspective, there's not really a difference\nbetween a bare repo and one with a working directory. Using just one\nrepo with a working directory will mean you just have one extra checkout\non the server, which wastes a little space.\n\n-Peff\n"},{"id":"80029","messageId":"200806161539.40007.mirko.stocker@hsr.ch","threadId":"13932","inReplyTo":"20080615204841.GA10270@sigill.intra.peff.net","subject":"Re: Working with Git and CVS in a team.","fromName":"Mirko Stocker","fromEmail":"mirko.stocker@hsr.ch","sentAt":"2008-06-16T13:39:39Z","receivedAt":"2008-06-16T13:39:39Z","isPatch":false,"sender":{"key":"mirko.stocker@hsr.ch","avatar":"https://gravatar.com/avatar/c7319a4f11f1e9584655281941f5cea117fe841c8b47ad3860fefb1cf7eb1822?d=mp&s=160"},"body":"On Sunday 15 June 2008 22:48:41 Jeff King wrote:\n> Sure. From the client perspective, there's not really a difference\n> between a bare repo and one with a working directory. Using just one\n> repo with a working directory will mean you just have one extra checkout\n> on the server, which wastes a little space.\n\nOk, but in my case I have the checkout on the server in any case, whether I \npush it to the bare repository or use it directly.\n\nThanks again\n\nMirko\n"},{"id":"80039","messageId":"1213632284.11517.78.camel@isidore.myhome.westell.com","threadId":"13932","inReplyTo":"200806132243.36695.m1stocke@hsr.ch","subject":"Re: Working with Git and CVS in a team.","fromName":"John J. Franey","fromEmail":"jjfraney@gmail.com","sentAt":"2008-06-16T16:04:44Z","receivedAt":"2008-06-16T16:04:44Z","isPatch":false,"sender":{"key":"jjfraney@gmail.com","avatar":null},"body":"On Fri, 2008-06-13 at 14:33 +0200, Mirko Stocker wrote:\n\n\n> Our team works on an existing project that's in CVS, but we don't have\n> the permissions to commit directly to it. We still need to make\n> changes and want to stay as up to date as possible, so we are trying\n> to use git to track the CVS repository and to collaborate inside the\n> team.\n> \n\nI'm in a team that is all CVS.  I'm the only one using git.\n\nI can commit to CVS, unlike your situation.\n\n> \n> Now, I'm quite new to git, so I'm not sure if the solution I created\n> is \"correct\", not way too complicated, or if there are problems waiting\n> for us.\n> \n\nI don't think there is a 'wrong' way.  'Whatever works' is the motto. \nThe configuration should match the workflow.  So, I don't have any\ncomment on yours.  I thought I'd share mine, in case there is value.  I\nthink I will learn something\n\n\nMy setup is:\n\n+----------+\n| cvs repo |\n+----------+\n     |\n     | (1)\n     |\n+----------+\n| /cvs_git |\n+----------+\n     |\n     | (2)\n    \\|/\n+---------------------+   (5)   +--------------------+\n| john's private repo |-------->| john's public repo |\n+---------------------+         +--------------------+\n     |\n     | (3)\n    \\|/\n+--------------------+\n| john's cvs sandbox |\n+--------------------+\n     |\n    \\|/ (4)\n+----------+\n| cvs repo |\n+----------+\n\n(1) git-cvsimport -i ...\n\nRuns in cron every 30 minutes.\n\nThe output git repo is on a shared server.  git users (me) can clone/fetch/pull.\n\nThe git repo for cvs is purely one way: no commits are to be pushed to\nthis repo.  All content comes from the cvs repo.\n\nThis is importing ALL branches from CVS because it git users (me)\nrequire access to all cvs branches. \n\n\n(2) git clone -o cvs \n\nUsing -o, my private repo uses 'cvs' as the name of the git remote that\ntracks cvs.  This lets me do 'git fetch cvs', which feels right.\n\nAnd, to create a branch from the cvs head branch:\n\n'git checkout -b br cvs/origin'\n\n\n\n\n(3) git cvsexportcommit\n(4) cvs commit\n\nThese close the loop: my changes are committed to cvs repo. \nAlternatively, the loop can be closed by emailing patch files to a cvs\ncommitter.\n\n\n\n(5) git push public\n\n'public' is the name of my public repo.  The commits I push to public\nare for developers that are using git (currently zero) who want to see\nmy work before it gets to cvs' head (which is under high contention).\n\nI expect my team members to push to their one public repo.  Then I can\ndo: 'git fetch alice' to get Alice's work.\n\nAt the end of all this, when I do a 'git branch -r' I will see something like:\n\ncvs/br1\ncvs/br2\nalice/br4\nalice/br5\nbob/br6\nbob/br7\n\nThus making obvious which branch originates from which developer or from cvs.\n\n\nIn this configuration, the 'merge-dude' is simply another user with a\nprivate and public repo.\n\n\n\n\n\n\nIssue with being the git user in a team of cvs users:\n\ngit makes merges easier and more robust.  I don't want to use cvs anymore.\n\nMy main problem is sharing my changes to cvs users.  cvs head is under\ncontention and protection, so I can't simply commit all my changes to\ncvs head.  Our cvs strategy is to create a branch for each developer or\ntopic.  If I create a branch in cvs repo for my git commits, I'd also\nwant to keep that cvs branch upto date wrt cvs head. I haven't sorted\nout how to do that easily with the git tools.\n\n\n\n\n> \n> \n> What I don't like is how we have to make the upstream patch(es). Is\n> there an easy way we can get multiple patches, lets say for each\n> commit we made? Or is it easier to make a lots of branches and to\n> then create a patch from the diff between the branch and origin/origin?\n> \n> \n\nI don't know enough.  I'd try it both ways to see which works for you. \nDoesn't git easily create a patch file in either case?  (This is the\npart I'm not sure of.)\n\n\nRegards,\nJohn\n"},{"id":"80050","messageId":"g3659u$u74$1@ger.gmane.org","threadId":"13932","inReplyTo":"1213632284.11517.78.camel@isidore.myhome.westell.com","subject":"Re: Working with Git and CVS in a team.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-16T16:44:42Z","receivedAt":"2008-06-16T16:44:42Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"<opublikowany i wysłany>\n\nJohn J. Franey wrote:\n\n> (3) git cvsexportcommit\n> (4) cvs commit\n\nWhat about git-cvsserver instead?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}