Hello,
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.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.git-cvsimport seems to be the solution, so I've established the
following structure:+-----------------+
| dev.eclipse.org |
+-----------------+
^
| (1)
| (2) (3)
+---------------+ +---------------+ +------------+
| ifs:/from-cvs | ---> | ifs:/git-proj | <----- | Merge-Dude |
+---------------+ +---------------+ +------------+
/ \
/ \
/ \
+------+ +------+
| User | (4) | User |
+------+ +------+1) I use git-cvsimport to update the repository every night. /git-proj
is a "clone --bare" of the /from-cvs repository.2) After the import, I push the changes from CVS to /git-proj using
'git push /git-proj origin'.This first two steps can be done with a cronjob, there shouldn't be
any conflicts.3) Then we have the role of a "Merge-Dude" who pulls the changes from
/git-proj and uses 'git merge origin/origin' to update his master.
If there are any conflicts, he resolves them and pushes everything
back to the master at /git-proj.4) The users can just push and pull from /git-proj.
From time to time, we can use 'git diff origin/origin' to get a patch
with all the changes we made and have to send upstream.What do you guys think, is this approach feasible?
What I don't like is how we have to make the upstream patch(es). Is
there an easy way we can g...
You could simplify this by just cvsimporting to an 'upstream' branch in
And then it works the same: he just pulls 'upstream' occasionally,
merges it into your work, and then pushes the result.-Peff
--
Hm, I've tried that, but it doesnt seem to work.. git-proj is a bare
repository, and git-cvsimport always creates a new .git in it. I'm using
the -C option to specify the target. Is anything else needed?Regards
Mirko
--
Ah, I hadn't thought of that. Apparently git-cvsimport doesn't
understand bare repos. There is even a Debian bug reported:http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472873
You might be able to hack around it with:
mkdir bare.git && (cd bare.git && git init)
mkdir cvsimport-hack && ln -s ../bare.git cvsimport-hack/.git
git cvsimport -C cvsimport-hack-Peff
--
Uh, ok.. :) Thanks.
I just wondered, do I even need the additional bare repository? If I use
git-cvsimport with -i, then it creates only the .git without doing a
checkout, then we could just clone this one from the clients and pull/push to
it?Thanks
Mirko
--
Sure. From the client perspective, there's not really a difference
between a bare repo and one with a working directory. Using just one
repo with a working directory will mean you just have one extra checkout
on the server, which wastes a little space.-Peff
--
Ok, but in my case I have the checkout on the server in any case, whether I
push it to the bare repository or use it directly.Thanks again
Mirko
--
On Fri, Jun 13, 2008 at 04:33:34PM +0200, Mirko Stocker <mirko.stocker@hsr.=
Don't you mean origin/master?
In general, if you don't merge your changes but you rebase on top of the
new upstream head, then you can use 'git format-patch origin/master..'
to create patches for each commit.It'll include the commit message and each commit will be written out as
a separate file.
Hm, I'm not sure.. if I work on an a feature in a branch, and now I want to
create a patch that applies to the CVS head, then I have to make the diff toAh, I didn't know about git-rebase, thanks! That's exactly what I wanted :) I
think I've already fallen in love with git.
--
I'm in a team that is all CVS. I'm the only one using git.
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 somethingMy 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 commitThese 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 -...
On Fri, Jun 13, 2008 at 10:43:36PM +0200, Mirko Stocker <m1stocke@hsr.ch> w=
'origin/origin' means the 'origin' branch of the 'origin' remote. Given
that you said you created the 'origin' remote's repo using
git-cvsimport, I assumed that the 'origin' remote has only one branch
(named 'master').
Hm, git-cvsimport created a master and an origin branch. And then I push the
origin branch to the bare repository to share it with my colleagues. So for
the users, origin/origin contains the original CVS content, so we need to
make the diff against that, don't we? That's how I think this whole thing
works, I might be wrong :-)
--
Oh, you are right. Sorry for the noise. I forgot that git-cvsimport
creates an origin branch without -o master.
| Ingo Molnar | [bug] block subsystem related crash with latest -git |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Adrian Bunk | Re: net/ipv4/fib_trie.c - compile error (Re: 2.6.23-rc3-mm1) |
git: | |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
