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

Re: Working with Git and CVS in a team.

From
JFJohn J. Franey <jjfraney@gmail.com>
Date
Jun 16, 2008, 16:04 UTC
Message-ID
<1213632284.11517.78.camel@isidore.myhome.westell.com>
In-Reply-To
<200806132243.36695.m1stocke@hsr.ch>
On Fri, 2008-06-13 at 14:33 +0200, Mirko Stocker wrote:
Show 6 quoted lines
> Our team works on an existing project that's in CVS, but we don't have
> the permissions to commit directly to it. We still need to make
> changes and want to stay as up to date as possible, so we are trying
> to use git to track the CVS repository and to collaborate inside the
> team.
> 
I'm in a team that is all CVS.  I'm the only one using git.
I can commit to CVS, unlike your situation.
Show 5 quoted lines
> 
> Now, I'm quite new to git, so I'm not sure if the solution I created
> is "correct", not way too complicated, or if there are problems waiting
> for us.
> 

I don't think there is a 'wrong' way. 'Whatever works' is the motto. The configuration should match the workflow. So, I don't have any comment on yours. I thought I'd share mine, in case there is value. I think I will learn something

My setup is:
+----------+
| cvs repo |
+----------+
     |
     | (1)
     |
+----------+
| /cvs_git |
+----------+
     |
     | (2)
    \|/
+---------------------+   (5)   +--------------------+
| john's private repo |-------->| john's public repo |
+---------------------+         +--------------------+
     |
     | (3)
    \|/
+--------------------+
| john's cvs sandbox |
+--------------------+
     |
    \|/ (4)
+----------+
| cvs repo |
+----------+
(1) git-cvsimport -i ...
Runs in cron every 30 minutes.
The output git repo is on a shared server.  git users (me) can clone/fetch/pull.

The git repo for cvs is purely one way: no commits are to be pushed to this repo. All content comes from the cvs repo.

This is importing ALL branches from CVS because it git users (me) require access to all cvs branches.

(2) git clone -o cvs 

Using -o, my private repo uses 'cvs' as the name of the git remote that tracks cvs. This lets me do 'git fetch cvs', which feels right.

And, to create a branch from the cvs head branch:
'git checkout -b br cvs/origin'

(3) git cvsexportcommit (4) cvs commit

These close the loop: my changes are committed to cvs repo. Alternatively, the loop can be closed by emailing patch files to a cvs committer.

(5) git push public

'public' is the name of my public repo. The commits I push to public are for developers that are using git (currently zero) who want to see my work before it gets to cvs' head (which is under high contention).

I expect my team members to push to their one public repo. Then I can do: 'git fetch alice' to get Alice's work.

At the end of all this, when I do a 'git branch -r' I will see something like:

cvs/br1 cvs/br2 alice/br4 alice/br5 bob/br6 bob/br7

Thus making obvious which branch originates from which developer or from cvs.

In this configuration, the 'merge-dude' is simply another user with a private and public repo.

Issue with being the git user in a team of cvs users:
git makes merges easier and more robust.  I don't want to use cvs anymore.

My main problem is sharing my changes to cvs users. cvs head is under contention and protection, so I can't simply commit all my changes to cvs head. Our cvs strategy is to create a branch for each developer or topic. If I create a branch in cvs repo for my git commits, I'd also want to keep that cvs branch upto date wrt cvs head. I haven't sorted out how to do that easily with the git tools.

Show 8 quoted lines
> 
> 
> What I don't like is how we have to make the upstream patch(es). Is
> there an easy way we can get multiple patches, lets say for each
> commit we made? Or is it easier to make a lots of branches and to
> then create a patch from the diff between the branch and origin/origin?
> 
> 

I don't know enough. I'd try it both ways to see which works for you. Doesn't git easily create a patch file in either case? (This is the part I'm not sure of.)

Regards, John

Previous: Miklos VajnaNext: Jakub Narebski
Message 7 of 14 in “Working with Git and CVS in a team.”
  1. Mirko StockerJun 13, 2008
  2. Miklos VajnaJun 13, 2008
  3. Mirko StockerJun 13, 2008
  4. Miklos VajnaJun 13, 2008
  5. Mirko StockerJun 15, 2008
  6. Miklos VajnaJun 15, 2008
  7. John J. FraneyJun 16, 2008
  8. Jakub NarebskiJun 16, 2008
  9. Jeff KingJun 13, 2008
  10. Mirko StockerJun 13, 2008
  11. Jeff KingJun 13, 2008
  12. Mirko StockerJun 15, 2008
  13. Jeff KingJun 15, 2008
  14. Mirko StockerJun 16, 2008

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.