threads / discuss / 15804

files missing after converting a cvs repository to git

Subject: files missing after converting a cvs repository to git

## tl;dr

7 messages between Oct 6, 2008 and Oct 8, 2008.

replies: 6people: 4as markdown or json

Adam Mercer· Oct 6, 2008, 22:02 UTC · lore
Hi

One of the prrojects I am involved with is currently looking into migrating from cvs to git, therefore we have been investigating this by setting up a git repository that tracks cvs, however there are some very strange things going on and I was hoping someone could offer some insight into what is going on.

I use the following git cvsimport command to import the repository:

$ git cvsimport -v -a -i -k -d:pserver:user@server:port/path/to/cvs/repo -C /path/to/new/git/repo module

this ran successfully with no warnings or errors. However, when I checkout the new git repository that are several files missing from the git checkout that are present in the cvs checkout.

Does anyone know why this would happen, or how to find out? This is a major problem because we will be unable to migrate to cvs until this can be solved.

Cheers
Adam
Andreas Ericsson· Oct 7, 2008, 06:08 UTC · re: Adam Mercer · lore

Re: files missing after converting a cvs repository to git

Adam Mercer wrote:
Show 19 quoted lines
> Hi
> 
> One of the prrojects I am involved with is currently looking into
> migrating from cvs to git, therefore we have been investigating this
> by setting up a git repository that tracks cvs, however there are some
> very strange things going on and I was hoping someone could offer some
> insight into what is going on.
> 
> I use the following git cvsimport command to import the repository:
> 
> $ git cvsimport -v -a -i -k
> -d:pserver:user@server:port/path/to/cvs/repo -C /path/to/new/git/repo
> module
> 
> this ran successfully with no warnings or errors. However, when I
> checkout the new git repository that are several files missing from
> the git checkout that are present in the cvs checkout.
> 
> Does anyone know why this would happen, or how to find out?

Has the CVS repo been tampered with in the past? If so, it's entirely possible that checking out and working with CVS works just fine, but getting history into coherent changesets is impossible.

Can you checkout the offending (old) revisions using CVS? If so, there is indeed a bug in the cvs-importer. Otherwise, your CVS repo is hosed and you're reduced to running whatever conversion tool does the best job if you want to maintain history.

cvs2svn is apparently quite good at getting even the weirdest history right. Perhaps you can try that and then running "git svn" on the resulting svn repo?

Good luck. You'll probably need it :-/
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Jakub Narebski· Oct 7, 2008, 10:15 UTC · re: Andreas Ericsson · lore

Re: files missing after converting a cvs repository to git

Andreas Ericsson wrote:
> cvs2svn is apparently quite good at getting even the weirdest history
> right. Perhaps you can try that and then running "git svn" on the
> resulting svn repo?
cvs2svn has git output now (I think it is actually fast-import output)
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Michael Haggerty· Oct 7, 2008, 10:46 UTC · re: Jakub Narebski · lore

Re: files missing after converting a cvs repository to git

Jakub Narebski wrote:
Show 7 quoted lines
> Andreas Ericsson wrote:
> 
>> cvs2svn is apparently quite good at getting even the weirdest history
>> right. Perhaps you can try that and then running "git svn" on the
>> resulting svn repo?
> 
> cvs2svn has git output now (I think it is actually fast-import output)

Correct. See http://cvs2svn.tigris.org/cvs2git.html for more info. I suggest using the trunk version of cvs2svn for conversions to git.

Please note, however, that cvs2svn can only handle one-time conversions (i.e., not tracking a live CVS repository incrementally).

Michael
Adam Mercer· Oct 7, 2008, 15:58 UTC · re: Michael Haggerty · lore

Re: files missing after converting a cvs repository to git

On Tue, Oct 7, 2008 at 05:46, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> Jakub Narebski wrote:
Show 11 quoted lines
>>> cvs2svn is apparently quite good at getting even the weirdest history
>>> right. Perhaps you can try that and then running "git svn" on the
>>> resulting svn repo?
>>
>> cvs2svn has git output now (I think it is actually fast-import output)
>
> Correct.  See http://cvs2svn.tigris.org/cvs2git.html for more info.  I
> suggest using the trunk version of cvs2svn for conversions to git.
>
> Please note, however, that cvs2svn can only handle one-time conversions
> (i.e., not tracking a live CVS repository incrementally).
Thanks, I'll look into this for creating the final git repos.
Cheers
Adam
Adam Mercer· Oct 7, 2008, 15:55 UTC · re: Andreas Ericsson · lore

Re: files missing after converting a cvs repository to git

On Tue, Oct 7, 2008 at 01:08, Andreas Ericsson <ae@op5.se> wrote:
> Has the CVS repo been tampered with in the past? If so, it's entirely
> possible that checking out and working with CVS works just fine, but
> getting history into coherent changesets is impossible.

Unfortunately yes. Thats what I thought, and was afraid, was going on. I've managed to get things working by restoring some of the missing files ,v files from a backup and regenerating the tracking repositories. Then I had to remove the files in question from cvs and readd them, git cvsimport then saw these files.

> cvs2svn is apparently quite good at getting even the weirdest history
> right. Perhaps you can try that and then running "git svn" on the
> resulting svn repo?
Thanks, I'll give cvs2svn a go.
> Good luck. You'll probably need it :-/
Cheers
Adam
Andreas Ericsson· Oct 8, 2008, 06:16 UTC · re: Adam Mercer · lore

Re: files missing after converting a cvs repository to git

Adam Mercer wrote:
Show 12 quoted lines
> On Tue, Oct 7, 2008 at 01:08, Andreas Ericsson <ae@op5.se> wrote:
> 
>> Has the CVS repo been tampered with in the past? If so, it's entirely
>> possible that checking out and working with CVS works just fine, but
>> getting history into coherent changesets is impossible.
> 
> Unfortunately yes. Thats what I thought, and was afraid, was going on.
> I've managed to get things working by restoring some of the missing
> files ,v files from a backup and regenerating the tracking
> repositories. Then I had to remove the files in question from cvs and
> readd them, git cvsimport then saw these files.
> 

Ouch. In that case, all bets are off when it comes to correctly cloning the history, I'm afraid. On the up-side, if you get a oneshot conversion done properly you can easily convert it to something else later in case git doesn't meet your needs, and it might even be easier to add commit support to "git cvsserver" than it is to fix your broken repository (it might be in there already; I don't use it so I don't know), in which case you can use CVS with a git object store.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

← back to recent threads