* Syncing with CVS @ 2009-01-19 9:39 Christian von Kietzell 2009-01-19 10:28 ` Johan Herland ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Christian von Kietzell @ 2009-01-19 9:39 UTC (permalink / raw) To: git Hi, I have a project I started in git. After a while I exported that to CVS via git cvsexportcommit which worked quite nicely. Now, a colleague made changes to the project - in CVS. What's the best way to get those back into my git repository so that I'll be able to sync back and forth between git and CVS? I had a quick look at the wiki but couldn't find anything appropriate. I know of git cvsimport, of course, but that doesn't work on my original repository. Or does it? I didn't find anything on how to limit what to import. After all, some of the commits are already in my repository (the ones I exported). Hope any of you can help. Thanks in advance. Chris ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Syncing with CVS 2009-01-19 9:39 Syncing with CVS Christian von Kietzell @ 2009-01-19 10:28 ` Johan Herland 2009-01-19 10:58 ` Boaz Harrosh 2009-01-19 22:05 ` Robin Rosenberg 2 siblings, 0 replies; 4+ messages in thread From: Johan Herland @ 2009-01-19 10:28 UTC (permalink / raw) To: Christian von Kietzell; +Cc: git On Monday 19 January 2009, Christian von Kietzell wrote: > Hi, > > I have a project I started in git. After a while I exported that to > CVS via git cvsexportcommit which worked quite nicely. Now, a > colleague made changes to the project - in CVS. What's the best way > to get those back into my git repository so that I'll be able to sync > back and forth between git and CVS? I had a quick look at the wiki > but couldn't find anything appropriate. > > I know of git cvsimport, of course, but that doesn't work on my > original repository. Or does it? I didn't find anything on how to > limit what to import. After all, some of the commits are already in > my repository (the ones I exported). > > Hope any of you can help. Thanks in advance. Unfortunately bidirectional syncing between CVS and Git is pretty much impossible in the general case, because CVS's structure is so different from Git's. For one, it is very easy to (re)move tags and branches in CVS, with no record of where it was moved from. (Also, as anybody involved in proper CVS-to-Git converters ("git cvsimport" does _not_ fall into this category) will tell you, recreating history from CVS is a highly non-trivial task in itself.) This means that even if you have imported some CVS state into Git, you cannot guarantee that the CVS state has not changed the next time you try to import. Therefore, it is very hard to determine whether you're importing a whole new branch from CVS, or whether you are just incrementally importing patches on top of a previously imported branch. I have a similar situation at $dayjob, where we have a central CVS server with the official version, and I use Git for working locally. In this case, I use "git cvsexportcommit" to propagate my local changes to the CVS server. I only use this approach on branches where nobody else is allowed to commit (of course CVS does not enforce this rule, so I have to manually make sure that does not happen). If someone else were to commit to my branch in CVS, I would have to redo a full CVS-to-Git conversion, in order to get a new Git repo that is in sync with CVS. I can then resume "git cvsexportcommit" to propagate my changes from Git to CVS. Have fun! :) ...Johan -- Johan Herland, <johan@herland.net> www.herland.net ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Syncing with CVS 2009-01-19 9:39 Syncing with CVS Christian von Kietzell 2009-01-19 10:28 ` Johan Herland @ 2009-01-19 10:58 ` Boaz Harrosh 2009-01-19 22:05 ` Robin Rosenberg 2 siblings, 0 replies; 4+ messages in thread From: Boaz Harrosh @ 2009-01-19 10:58 UTC (permalink / raw) To: Christian von Kietzell; +Cc: git Christian von Kietzell wrote: > Hi, > > I have a project I started in git. After a while I exported that to > CVS via git cvsexportcommit which worked quite nicely. Now, a > colleague made changes to the project - in CVS. What's the best way to > get those back into my git repository so that I'll be able to sync > back and forth between git and CVS? I had a quick look at the wiki but > couldn't find anything appropriate. > > I know of git cvsimport, of course, but that doesn't work on my > original repository. Or does it? I didn't find anything on how to > limit what to import. After all, some of the commits are already in my > repository (the ones I exported). > > Hope any of you can help. Thanks in advance. > > Chris I would "git cvsimport" into temporary new git. Then "git remote add cvs_import that_temp_git" into the main git Then find the point of the common base, do "git tag CVS_GIT_BASE that_base_commit_uid" "git checkout -b cvs_import cvs_import/master" "git rebase --onto master CVS_GIT_BASE" So in fact I'm just cherry-picking the additions from CVS and reapplying on to original git tree. If you want it more automatic you'll need to do the above in a script with some kind of naming conventions for your git tags and CVS's tags at points of sync. Boaz ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Syncing with CVS 2009-01-19 9:39 Syncing with CVS Christian von Kietzell 2009-01-19 10:28 ` Johan Herland 2009-01-19 10:58 ` Boaz Harrosh @ 2009-01-19 22:05 ` Robin Rosenberg 2 siblings, 0 replies; 4+ messages in thread From: Robin Rosenberg @ 2009-01-19 22:05 UTC (permalink / raw) To: Christian von Kietzell; +Cc: git måndag 19 januari 2009 10:39:53 skrev Christian von Kietzell: > Hi, > > I have a project I started in git. After a while I exported that to > CVS via git cvsexportcommit which worked quite nicely. Now, a > colleague made changes to the project - in CVS. What's the best way to > get those back into my git repository so that I'll be able to sync > back and forth between git and CVS? I had a quick look at the wiki but > couldn't find anything appropriate. > > I know of git cvsimport, of course, but that doesn't work on my > original repository. Or does it? I didn't find anything on how to > limit what to import. After all, some of the commits are already in my > repository (the ones I exported). Just continue with cvsimport, then git rebase origin. That'll drop the commits that you made when the same commit have been discovered in CVS. I personally do the cvs import into a separate repo using a cron job. That extra repo is my origin so I get up-to-date using git fetch and rebase just as if the CVS commits would come from a real repo. -- robin ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-19 22:07 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-01-19 9:39 Syncing with CVS Christian von Kietzell 2009-01-19 10:28 ` Johan Herland 2009-01-19 10:58 ` Boaz Harrosh 2009-01-19 22:05 ` Robin Rosenberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).