# files missing after converting a cvs repository to git

7 messages from 2008-10-06 to 2008-10-08. Participants: Adam Mercer, Andreas Ericsson, Jakub Narebski, Michael Haggerty.
Thread: https://gitlist.dev/t/15804

## Adam Mercer, 2008-10-06 22:02

Subject: files missing after converting a cvs repository to git
Message-ID: <799406d60810061502y417ec53o1a1f5cef800dfe45@mail.gmail.com>
URL: https://gitlist.dev/e/799406d60810061502y417ec53o1a1f5cef800dfe45%40mail.gmail.com

```
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, 2008-10-07 06:08

Subject: Re: files missing after converting a cvs repository to git
Message-ID: <48EAFCEF.8030907@op5.se>
URL: https://gitlist.dev/e/48EAFCEF.8030907%40op5.se
In-Reply-To: <799406d60810061502y417ec53o1a1f5cef800dfe45@mail.gmail.com>

```
Adam Mercer wrote:
> 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, 2008-10-07 10:15

Subject: Re: files missing after converting a cvs repository to git
Message-ID: <gcfcrg$ubc$1@ger.gmane.org>
URL: https://gitlist.dev/e/gcfcrg%24ubc%241%40ger.gmane.org
In-Reply-To: <48EAFCEF.8030907@op5.se>

```
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, 2008-10-07 10:46

Subject: Re: files missing after converting a cvs repository to git
Message-ID: <48EB3E06.70100@alum.mit.edu>
URL: https://gitlist.dev/e/48EB3E06.70100%40alum.mit.edu
In-Reply-To: <gcfcrg$ubc$1@ger.gmane.org>

```
Jakub Narebski wrote:
> 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, 2008-10-07 15:55

Subject: Re: files missing after converting a cvs repository to git
Message-ID: <799406d60810070855y53cf5191m111ce8f5380f96c6@mail.gmail.com>
URL: https://gitlist.dev/e/799406d60810070855y53cf5191m111ce8f5380f96c6%40mail.gmail.com
In-Reply-To: <48EAFCEF.8030907@op5.se>

```
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

```

## Adam Mercer, 2008-10-07 15:58

Subject: Re: files missing after converting a cvs repository to git
Message-ID: <799406d60810070858peb97434p9c9fb0c1128dc8e9@mail.gmail.com>
URL: https://gitlist.dev/e/799406d60810070858peb97434p9c9fb0c1128dc8e9%40mail.gmail.com
In-Reply-To: <48EB3E06.70100@alum.mit.edu>

```
On Tue, Oct 7, 2008 at 05:46, Michael Haggerty <mhagger@alum.mit.edu> wrote:
> Jakub Narebski 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).

Thanks, I'll look into this for creating the final git repos.

Cheers

Adam

```

## Andreas Ericsson, 2008-10-08 06:16

Subject: Re: files missing after converting a cvs repository to git
Message-ID: <48EC5058.5020509@op5.se>
URL: https://gitlist.dev/e/48EC5058.5020509%40op5.se
In-Reply-To: <799406d60810070855y53cf5191m111ce8f5380f96c6@mail.gmail.com>

```
Adam Mercer wrote:
> 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

```
