git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: CVS <--> GIT workflow...

From
DCDavid Chanters <david.chanters@googlemail.com>
Date
Jul 1, 2009, 21:25 UTC
Message-ID
<ac3d41850907011425x966483awe1757e24417d9da4@mail.gmail.com>
In-Reply-To
<m3d48kw4uz.fsf@localhost.localdomain>
2009/7/1 Jakub Narebski <jnareb@gmail.com>:
Show 23 quoted lines
> David Chanters <david.chanters@googlemail.com> writes:
>
>> I am wondering if there's any best practises/howtos on using CVS and
>> Git together.  I have a project which is currently residing in CVS;
>> people actively use it to add changes, etc.  Which is fine -- and for
>> a variety of reasons we're unable to simply switch away from using CVS
>> to Git.
>>
>> So... the question is, can I use Git locally to manage all my work in
>> -- create topic branches, merge them, etc., and then commit that back
>> out to the CVS repository?   Likewise, I would need to keep my Git
>> repository in synch with any changes to the CVS repository -- is that
>> possible?  Has anyone else done something like this?  What I am
>> effectively wanting to do is Git for my entire development on this
>> project and just forget it even uses CVS.
>>
>> I've read up on git-cvsimport which seems to explain how to convert a
>> current CVS repo over to Git -- is that right?  Any information you
>> can point me to would be very welcome.  I am not adverse to reading,
>> providing it's useful to me.  :)
>
> I think from all CVS importers (git-cvsimport, parsecvs, git mode of
> cvs2svn aka. cvs2git) only git-cvsimport has incremental mode.
Excellent.   So git-cvsimport it is then.  That's stage 1.
> As for exporting to CVS there is git-cvsexportcommit and git-cvsserver
> (which functions like cvsserver, but conects to git repository;
> although it has its own limitations).

I wouldn't need connectivity like what git-cvsserver seems to imply. git-cvsexportcommit sounds about right.

> But you should really hope that your fellow CVS committers use good
> practice; because it is quite easy to create very messy CVS repository
> (so that for example it would be hard to extract changesets).
They do -- which is about the only guaranteed thing.
So what would I do?  Something like this:
1.  Use git-cvsimport to "convert" a snapshot of the current CVS
project to something Git can understand.
2.  Checkout this git project via git clone in the usual way.
3,  Hack away in this Git clone.
4.  Use git-cvsexportcommit to extract commits?

What about my workflow within the Git repository? I assume that "Master" would be the branch I would want to merge *to* if I have local topic brances I wish to have in to CVS, and then the commits on Master would be something git-cvsexportcommit would look at?

Indeed, it seems git-cvsexportcommit is somewhat "manual" -- is there no way of automating that to say something like: "Take all commits on branch $FOO in Git, which aren't in CVS, and apply them?" I might be missing some understanding here.

Any advice greatly received.  :)
David
Previous: Jakub NarebskiNext: Nick Woolley
Message 5 of 6 in “CVS <--> GIT workflow...”
  1. David ChantersJul 1, 2009
  2. John TapsellJul 1, 2009
  3. David ChantersJul 1, 2009
  4. Jakub NarebskiJul 1, 2009
  5. David ChantersJul 1, 2009
  6. Nick WoolleyJul 2, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.