* Git and cvsimport
@ 2010-04-26 14:27 Marin Atanasov
2010-04-27 7:37 ` Michael J Gruber
0 siblings, 1 reply; 8+ messages in thread
From: Marin Atanasov @ 2010-04-26 14:27 UTC (permalink / raw)
To: git
Hello,
I need to import an existing CVS repo to Git. Using git-cvsimport
works well for me when importing from the CVS server itself, but I
need to do something different.
Here's a little info about what I'm doing.
$ pwd
/home/<user>/test
$ git --version
git version 1.5.6.5
$ git cvsimport -v -d :pserver:<user>@<server>:/var/
cvsroot -C test.git test-repo
Initialized empty Git repository in /home/<user>/test/test.git/.git/
Running cvsps...
connect error: Network is unreachable
cvs rlog: Logging test-repo
Fetching file1 v 1.1
New file1: 14 bytes
Fetching file2 v 1.1
New file2: 14 bytes
Fetching file3 v 1.1
New file3: 14 bytes
Tree ID bf675ce25c8ca3fd1f4a120ea933510c90ccda16
Parent ID (empty)
Committed patch 1 (origin +0000 2010-04-26 09:40:58)
Commit ID 377641eae81975e214a579da9e6c0c5afd819b17
Created tag 'SOMETAG' on 'origin'
Fetching file1 v 1.2
Update file1: 47 bytes
Fetching file3 v 1.2
Update file3: 47 bytes
Tree ID 10ab70cdcc53bb94684d09e60817bb62cb8c3d98
Parent ID 377641eae81975e214a579da9e6c0c5afd819b17
Committed patch 2 (origin +0000 2010-04-26 09:44:22)
Commit ID fea2a99c906e57df5c4735ba3f9627cbb8fba295
DONE; creating master branch
The above commands works fine, when I directly get the files from the
CVS server, but I want to do the following.
- checkout files from CVS, which are already tagged with certain
names to a local folder
- then import those files to Git with git-cvsimport
- fetch those imports later by a shared bare repo into different
branches, so at the end each branch will contain the files with the
certain tag.
So, If i do the following, then git-cvsimport fails:
$ pwd
/home/<user>/test
$ cvs -d :pserver:<user>@<server>:/var/cvsroot co -r SOMETAG test-repo
cvs checkout: Updating test-repo
U test-repo/file1
U test-repo/file2
U test-repo/file3
$ git cvsimport -v -d /home/<user>/test -C test.git test-repo
Expected Valid-requests from server, but got: E Cannot access
/home/<user>/test/CVSROOT
Can you give me some hints how to do this? Seems that I can import CVS
repos from remote server, but cannot do this from a local folder..
Thanks and regards,
Marin
--
Marin Atanasov Nikolov
dnaeon AT gmail DOT com
daemon AT unix-heaven DOT org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-26 14:27 Git and cvsimport Marin Atanasov
@ 2010-04-27 7:37 ` Michael J Gruber
2010-04-27 10:41 ` Marin Atanasov
0 siblings, 1 reply; 8+ messages in thread
From: Michael J Gruber @ 2010-04-27 7:37 UTC (permalink / raw)
To: Marin Atanasov; +Cc: git
Marin Atanasov venit, vidit, dixit 26.04.2010 16:27:
> Hello,
>
> I need to import an existing CVS repo to Git. Using git-cvsimport
> works well for me when importing from the CVS server itself, but I
> need to do something different.
>
> Here's a little info about what I'm doing.
>
> $ pwd
> /home/<user>/test
>
> $ git --version
> git version 1.5.6.5
>
> $ git cvsimport -v -d :pserver:<user>@<server>:/var/
> cvsroot -C test.git test-repo
> Initialized empty Git repository in /home/<user>/test/test.git/.git/
> Running cvsps...
> connect error: Network is unreachable
> cvs rlog: Logging test-repo
> Fetching file1 v 1.1
> New file1: 14 bytes
> Fetching file2 v 1.1
> New file2: 14 bytes
> Fetching file3 v 1.1
> New file3: 14 bytes
> Tree ID bf675ce25c8ca3fd1f4a120ea933510c90ccda16
> Parent ID (empty)
> Committed patch 1 (origin +0000 2010-04-26 09:40:58)
> Commit ID 377641eae81975e214a579da9e6c0c5afd819b17
> Created tag 'SOMETAG' on 'origin'
> Fetching file1 v 1.2
> Update file1: 47 bytes
> Fetching file3 v 1.2
> Update file3: 47 bytes
> Tree ID 10ab70cdcc53bb94684d09e60817bb62cb8c3d98
> Parent ID 377641eae81975e214a579da9e6c0c5afd819b17
> Committed patch 2 (origin +0000 2010-04-26 09:44:22)
> Commit ID fea2a99c906e57df5c4735ba3f9627cbb8fba295
> DONE; creating master branch
>
> The above commands works fine, when I directly get the files from the
> CVS server, but I want to do the following.
>
> - checkout files from CVS, which are already tagged with certain
> names to a local folder
> - then import those files to Git with git-cvsimport
> - fetch those imports later by a shared bare repo into different
> branches, so at the end each branch will contain the files with the
> certain tag.
>
> So, If i do the following, then git-cvsimport fails:
>
> $ pwd
> /home/<user>/test
>
> $ cvs -d :pserver:<user>@<server>:/var/cvsroot co -r SOMETAG test-repo
> cvs checkout: Updating test-repo
> U test-repo/file1
> U test-repo/file2
> U test-repo/file3
>
> $ git cvsimport -v -d /home/<user>/test -C test.git test-repo
> Expected Valid-requests from server, but got: E Cannot access
> /home/<user>/test/CVSROOT
>
> Can you give me some hints how to do this? Seems that I can import CVS
> repos from remote server, but cannot do this from a local folder..
... because a folder is not a server, and a cvs checkout is not a cvs repo.
It's not completely clear to me what you want and why, but the simplest
way seems to be to checkout each cvs tag using cvs, and (add &) commit
the result to the git branch of your choice using git. You don't seem to
want to convert the cvs repo, so don't use git cvs-import.
But, really, I don't know what you want - history-less git branches from
cvs tags?
Michael
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-27 7:37 ` Michael J Gruber
@ 2010-04-27 10:41 ` Marin Atanasov
2010-04-27 11:03 ` Michael J Gruber
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Marin Atanasov @ 2010-04-27 10:41 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
On Tue, Apr 27, 2010 at 10:37 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Marin Atanasov venit, vidit, dixit 26.04.2010 16:27:
>> Hello,
>>
>> I need to import an existing CVS repo to Git. Using git-cvsimport
>> works well for me when importing from the CVS server itself, but I
>> need to do something different.
>>
>> Here's a little info about what I'm doing.
>>
>> $ pwd
>> /home/<user>/test
>>
>> $ git --version
>> git version 1.5.6.5
>>
>> $ git cvsimport -v -d :pserver:<user>@<server>:/var/
>> cvsroot -C test.git test-repo
>> Initialized empty Git repository in /home/<user>/test/test.git/.git/
>> Running cvsps...
>> connect error: Network is unreachable
>> cvs rlog: Logging test-repo
>> Fetching file1 v 1.1
>> New file1: 14 bytes
>> Fetching file2 v 1.1
>> New file2: 14 bytes
>> Fetching file3 v 1.1
>> New file3: 14 bytes
>> Tree ID bf675ce25c8ca3fd1f4a120ea933510c90ccda16
>> Parent ID (empty)
>> Committed patch 1 (origin +0000 2010-04-26 09:40:58)
>> Commit ID 377641eae81975e214a579da9e6c0c5afd819b17
>> Created tag 'SOMETAG' on 'origin'
>> Fetching file1 v 1.2
>> Update file1: 47 bytes
>> Fetching file3 v 1.2
>> Update file3: 47 bytes
>> Tree ID 10ab70cdcc53bb94684d09e60817bb62cb8c3d98
>> Parent ID 377641eae81975e214a579da9e6c0c5afd819b17
>> Committed patch 2 (origin +0000 2010-04-26 09:44:22)
>> Commit ID fea2a99c906e57df5c4735ba3f9627cbb8fba295
>> DONE; creating master branch
>>
>> The above commands works fine, when I directly get the files from the
>> CVS server, but I want to do the following.
>>
>> - checkout files from CVS, which are already tagged with certain
>> names to a local folder
>> - then import those files to Git with git-cvsimport
>> - fetch those imports later by a shared bare repo into different
>> branches, so at the end each branch will contain the files with the
>> certain tag.
>>
>> So, If i do the following, then git-cvsimport fails:
>>
>> $ pwd
>> /home/<user>/test
>>
>> $ cvs -d :pserver:<user>@<server>:/var/cvsroot co -r SOMETAG test-repo
>> cvs checkout: Updating test-repo
>> U test-repo/file1
>> U test-repo/file2
>> U test-repo/file3
>>
>> $ git cvsimport -v -d /home/<user>/test -C test.git test-repo
>> Expected Valid-requests from server, but got: E Cannot access
>> /home/<user>/test/CVSROOT
>>
>> Can you give me some hints how to do this? Seems that I can import CVS
>> repos from remote server, but cannot do this from a local folder..
>
> ... because a folder is not a server, and a cvs checkout is not a cvs repo.
>
> It's not completely clear to me what you want and why, but the simplest
> way seems to be to checkout each cvs tag using cvs, and (add &) commit
> the result to the git branch of your choice using git. You don't seem to
> want to convert the cvs repo, so don't use git cvs-import.
>
> But, really, I don't know what you want - history-less git branches from
> cvs tags?
>
> Michael
>
Hello Michael,
Perhaps I didn't explain better what I want to accomplish :)
I want to convert CVS repo to a Git one.
But checking out from CVS and then converting to Git, checks out HEAD
from CVS, thus the latest revisions.
What I want to do is to checkout from CVS the files which are tagged
RELEASE_1_0 for example, and then import the files to a Git repo.
Files tagged as RELEASE_1_0 differ from HEAD files, so I want only
those files with that tag for example.
Is this possible to do with git-cvsimport, to specify the tag you want
to checkout from CVS?
I went through the documentation, but didn't see something like that.
If I checkout the files from CVS with that tag and then add, commit to
a git repo, then I'll lose the CVS history, and this is most important
for me keep.
Regards,
Marin
--
Marin Atanasov Nikolov
dnaeon AT gmail DOT com
daemon AT unix-heaven DOT org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-27 10:41 ` Marin Atanasov
@ 2010-04-27 11:03 ` Michael J Gruber
2010-04-27 11:57 ` Nick
2010-04-27 11:58 ` Tor Arntsen
2 siblings, 0 replies; 8+ messages in thread
From: Michael J Gruber @ 2010-04-27 11:03 UTC (permalink / raw)
To: Marin Atanasov; +Cc: git
Marin Atanasov venit, vidit, dixit 27.04.2010 12:41:
> On Tue, Apr 27, 2010 at 10:37 AM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> Marin Atanasov venit, vidit, dixit 26.04.2010 16:27:
>>> Hello,
>>>
>>> I need to import an existing CVS repo to Git. Using git-cvsimport
>>> works well for me when importing from the CVS server itself, but I
>>> need to do something different.
>>>
>>> Here's a little info about what I'm doing.
>>>
>>> $ pwd
>>> /home/<user>/test
>>>
>>> $ git --version
>>> git version 1.5.6.5
>>>
>>> $ git cvsimport -v -d :pserver:<user>@<server>:/var/
>>> cvsroot -C test.git test-repo
>>> Initialized empty Git repository in /home/<user>/test/test.git/.git/
>>> Running cvsps...
>>> connect error: Network is unreachable
>>> cvs rlog: Logging test-repo
>>> Fetching file1 v 1.1
>>> New file1: 14 bytes
>>> Fetching file2 v 1.1
>>> New file2: 14 bytes
>>> Fetching file3 v 1.1
>>> New file3: 14 bytes
>>> Tree ID bf675ce25c8ca3fd1f4a120ea933510c90ccda16
>>> Parent ID (empty)
>>> Committed patch 1 (origin +0000 2010-04-26 09:40:58)
>>> Commit ID 377641eae81975e214a579da9e6c0c5afd819b17
>>> Created tag 'SOMETAG' on 'origin'
>>> Fetching file1 v 1.2
>>> Update file1: 47 bytes
>>> Fetching file3 v 1.2
>>> Update file3: 47 bytes
>>> Tree ID 10ab70cdcc53bb94684d09e60817bb62cb8c3d98
>>> Parent ID 377641eae81975e214a579da9e6c0c5afd819b17
>>> Committed patch 2 (origin +0000 2010-04-26 09:44:22)
>>> Commit ID fea2a99c906e57df5c4735ba3f9627cbb8fba295
>>> DONE; creating master branch
>>>
>>> The above commands works fine, when I directly get the files from the
>>> CVS server, but I want to do the following.
>>>
>>> - checkout files from CVS, which are already tagged with certain
>>> names to a local folder
>>> - then import those files to Git with git-cvsimport
>>> - fetch those imports later by a shared bare repo into different
>>> branches, so at the end each branch will contain the files with the
>>> certain tag.
>>>
>>> So, If i do the following, then git-cvsimport fails:
>>>
>>> $ pwd
>>> /home/<user>/test
>>>
>>> $ cvs -d :pserver:<user>@<server>:/var/cvsroot co -r SOMETAG test-repo
>>> cvs checkout: Updating test-repo
>>> U test-repo/file1
>>> U test-repo/file2
>>> U test-repo/file3
>>>
>>> $ git cvsimport -v -d /home/<user>/test -C test.git test-repo
>>> Expected Valid-requests from server, but got: E Cannot access
>>> /home/<user>/test/CVSROOT
>>>
>>> Can you give me some hints how to do this? Seems that I can import CVS
>>> repos from remote server, but cannot do this from a local folder..
>>
>> ... because a folder is not a server, and a cvs checkout is not a cvs repo.
>>
>> It's not completely clear to me what you want and why, but the simplest
>> way seems to be to checkout each cvs tag using cvs, and (add &) commit
>> the result to the git branch of your choice using git. You don't seem to
>> want to convert the cvs repo, so don't use git cvs-import.
>>
>> But, really, I don't know what you want - history-less git branches from
>> cvs tags?
>>
>> Michael
>>
>
> Hello Michael,
>
> Perhaps I didn't explain better what I want to accomplish :)
and perhaps I don't understand cvs tags well enough :)
>
> I want to convert CVS repo to a Git one.
>
> But checking out from CVS and then converting to Git, checks out HEAD
> from CVS, thus the latest revisions.
>
> What I want to do is to checkout from CVS the files which are tagged
> RELEASE_1_0 for example, and then import the files to a Git repo.
> Files tagged as RELEASE_1_0 differ from HEAD files, so I want only
> those files with that tag for example.
>
> Is this possible to do with git-cvsimport, to specify the tag you want
> to checkout from CVS?
>
I don't think so, but the actual CVS checkout doesn't matter so much.
git cvsimport will import cvs tags as git tags (at least it promises to,
never tried myself). Once your git repo has all the cvs commits you want
(and more) you can always create a git branch which points at the tag
you want, and delete the other branches if you like. You can even give
them the same name if you don't mind dealing with ambiguous refnames
(git checkout -b tagnamebranch tagname).
Especially since you seemlingy want to do this with multiple tags, the
advantage of that approach is that you run git cvsimport once, and then
git branch or checkout multiple times (once for each tag), which is fast.
[Do you want to do a one-off conversion or keep syncing with cvs?]
Michael
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-27 10:41 ` Marin Atanasov
2010-04-27 11:03 ` Michael J Gruber
@ 2010-04-27 11:57 ` Nick
2010-04-27 11:58 ` Tor Arntsen
2 siblings, 0 replies; 8+ messages in thread
From: Nick @ 2010-04-27 11:57 UTC (permalink / raw)
To: Marin Atanasov, git
Marin Atanasov wrote:
> I want to convert CVS repo to a Git one.
If you don't care about incrementally updating the Git repo from the CVS one, I
suggest you don't use git-cvsimport. It can make mistakes in the translation,
especially with large and old repositories. On the other hand, git-cvsimport is
currently the only tool which can incrementally import changes from CVS, i.e.
co-exist with it.
cvs2git is a tool which worked more reliably for me, but it can only make a
one-off conversion. Also, you might need to tidy up the result afterwards -
removing crufty tags, unrelated directories, correcting committer identities,
etc. git-filter-branch may be useful here.
If you do care about co-existing with CVS, I find it gets to be hard work,
especially if your CVS repo has branches you have to follow - so really I'd
suggest you reconsider and only try it if you really have no choice.
In that case you may want to write a wrapper script for
git-cvsimport/exportcommit commands to reduce the complexity of using them.
I've attempted this, and it sort of works for me, but the result is not really
satisfactory, I find it's still liable to break on encountering random things
cvsimport/cvsexportcommit can't handle, and then you need to fix things manually
(although usually this can be done in Git). Ask me if you want to know more.
git-cvssever may be another option, if your CVS users agree, but I've no
experience with it.
My preferred strategy is to persuade my colleagues to abandon CVS entirely.
Cheers,
N
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-27 10:41 ` Marin Atanasov
2010-04-27 11:03 ` Michael J Gruber
2010-04-27 11:57 ` Nick
@ 2010-04-27 11:58 ` Tor Arntsen
2010-04-28 5:27 ` Marin Atanasov Nikolov
2 siblings, 1 reply; 8+ messages in thread
From: Tor Arntsen @ 2010-04-27 11:58 UTC (permalink / raw)
To: Marin Atanasov; +Cc: Michael J Gruber, git
On Tue, Apr 27, 2010 at 12:41, Marin Atanasov <dnaeon@gmail.com> wrote:
> Perhaps I didn't explain better what I want to accomplish :)
>
> I want to convert CVS repo to a Git one.
But the above statement..
[..]
> What I want to do is to checkout from CVS the files which are tagged
> RELEASE_1_0 for example, and then import the files to a Git repo.
> Files tagged as RELEASE_1_0 differ from HEAD files, so I want only
> those files with that tag for example.
.. seems to be in conflict with the above paragraph. Files tagged with
RELEASE_1_0 sounds like a revision tag (i.e. not a branch). If you
want to checkout that snapshot and insert into a Git rep you could as
well just 'cvs export -r RELEASE_1_0 <module>; git init; git add .;
git commit'
but that obviously won't give you any CVS history in the Git repo.
Is RELEASE_1_0 instead a branch tag? I.e. a CVS branch?
-Tor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-27 11:58 ` Tor Arntsen
@ 2010-04-28 5:27 ` Marin Atanasov Nikolov
2010-04-28 9:19 ` Andreas Schwab
0 siblings, 1 reply; 8+ messages in thread
From: Marin Atanasov Nikolov @ 2010-04-28 5:27 UTC (permalink / raw)
To: Tor Arntsen; +Cc: Michael J Gruber, git
Hello,
On Tue, Apr 27, 2010 at 2:58 PM, Tor Arntsen <tor@spacetec.no> wrote:
> On Tue, Apr 27, 2010 at 12:41, Marin Atanasov <dnaeon@gmail.com> wrote:
>
>> Perhaps I didn't explain better what I want to accomplish :)
>>
>> I want to convert CVS repo to a Git one.
>
> But the above statement..
> [..]
>> What I want to do is to checkout from CVS the files which are tagged
>> RELEASE_1_0 for example, and then import the files to a Git repo.
>> Files tagged as RELEASE_1_0 differ from HEAD files, so I want only
>> those files with that tag for example.
>
> .. seems to be in conflict with the above paragraph. Files tagged with
> RELEASE_1_0 sounds like a revision tag (i.e. not a branch). If you
> want to checkout that snapshot and insert into a Git rep you could as
> well just 'cvs export -r RELEASE_1_0 <module>; git init; git add .;
> git commit'
> but that obviously won't give you any CVS history in the Git repo.
>
Yes, I could do that, but then I'll lose the history, which is the worst case.
The import will be a one-time action. Once we import everything from
CVS to Git, we don't use CVS anymore, so no need of incremental
imports.
> Is RELEASE_1_0 instead a branch tag? I.e. a CVS branch?
RELEASE_1_0 is just a CVS tag you create using `cvs tag <tag-name> <file>`.
The CVS repo does not contain any branches at all.
We have a lot of test and production systems, where production systems
fetch from a central repository the files tagged as STABLE, and test
systems fetch the files tagged as TEST.
Another workaround that I'm thinking of might be:
1. git-cvsimport the whole CVS repository.
2. create a new bare repo, and fetch the files previously imported by
git-cvsimport to master branch - that way we'll have all the history
we need in the master branch.
3. checkout from CVS files tagged as STABLE, TEST, etc... to a new
repo, and then add, commit them to a git repo.
4. fetch again the repo in point 3. to the bare repo from point 2.,
in the specified branch -> TEST, STABLE, etc..
5. I won't have the history in the STABLE, TEST, etc.. branches, but
I'll have it in the master branch then.
6. From later on we'll be using after all the TEST, STABLE, etc.
branches, so master will be kept untouched.
7. On the central repository we'll just clone the already created
bare repo that contains the master, TEST, STABLE, etc.. branches, and
we'll set it to track TEST, STABLE, etc. for example.
What do you think about this? Is it a good approach at all?
Regards,
Marin
>
> -Tor
>
--
Marin Atanasov Nikolov
dnaeon AT gmail DOT com
daemon AT unix-heaven DOT org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Git and cvsimport
2010-04-28 5:27 ` Marin Atanasov Nikolov
@ 2010-04-28 9:19 ` Andreas Schwab
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2010-04-28 9:19 UTC (permalink / raw)
To: Marin Atanasov Nikolov; +Cc: Tor Arntsen, Michael J Gruber, git
Marin Atanasov Nikolov <dnaeon@gmail.com> writes:
> 1. git-cvsimport the whole CVS repository.
That's all you need, IIUC. There are other tools like parsecvs and
cvs2git that may produce better results than git-cvsimport, though.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-04-28 9:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-26 14:27 Git and cvsimport Marin Atanasov
2010-04-27 7:37 ` Michael J Gruber
2010-04-27 10:41 ` Marin Atanasov
2010-04-27 11:03 ` Michael J Gruber
2010-04-27 11:57 ` Nick
2010-04-27 11:58 ` Tor Arntsen
2010-04-28 5:27 ` Marin Atanasov Nikolov
2010-04-28 9:19 ` Andreas Schwab
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).