Re: Converted a CVS repo to git, results a bit odd

Michael Haggerty <[email protected]> Tue, 27 Nov 2012 08:01:07 +0100
Newsgroups gmane.comp.version-control.subversion.cvs2svn.user
Message-ID <[email protected]>
On 11/27/2012 04:13 AM, Kevin O'Gorman wrote:
> I took a CVS repo from sourceforge, converted to git using the non-bare
> git repo instructions.
> 
> Everything seems to be there, but...   There's a directory named CVSROOT
> that shows up along with the good stuff when I do "git checkout".
> 
> What's odd: gitk does not see this, but if I "git rm -r CVSROOT", git
> removes it so it must have know it was there.
> 
> Now some parts of this make sense, in that the CVSROOT directory was
> there in the repo that I pulled off of Sourceforge.  I don't think I
> need it.  But why does git disagree with gitk?  Is it something cvs2git did?

cvs2git doesn't do anything special with CVSROOT, so I don't know why
the contents of your checkout would differ from what gitk lists.
Perhaps the CVSROOT directory already existed in the directory (i.e., it
was not actually part of the git checkout).  Perhaps you are confused
about some aspect of git or gitk.  We would need more information to be
able to diagnose the situation.

Regarding CVSROOT directories in general:

A CVS repository has a CVSROOT directory in which some CVS metadata is
stored.  (This is not to be confused with the $CVSROOT environment
variable which points to the location of the repository.)  Some of the
files in CVSROOT are versioned using the same "rcsfile" format as is
used to record versions of your source code.

Usually a CVS repository is structured so that the CVSROOT is one
directory up from the real source code, like

    $CVSROOT/CVSROOT
    $CVSROOT/my-project/Makefile
    $CVSROOT/my-project/main.c

If, with this repository layout, you tell cvs2git to convert from the
directory $CVSROOT, then the resulting git repo will have CVSROOT and
my-project directories at the top level.  This is not what you want.
Instead, tell cvs2git to convert from the directory $CVSROOT/my-project;
that way the resulting git repository will have neither a CVSROOT nor a
my-project directory, but rather the files Makefile and main.c at the
top level.

If, on the other hand, you have (unwisely) stored your project files at
the top level of the CVS repository, like

    $CVSROOT/CVSROOT
    $CVSROOT/Makefile
    $CVSROOT/main.c

, and you tell cvs2git to convert from the directory $CVSROOT, then the
CVSROOT directory will be included in the output git repository.  This
is also not what you want.  The easiest way to fix this problem is to
make a copy of the CVS repository and then rearrange its contents to
look like the earlier example (untested):

    mkdir /tmp/repo-copy
    cp -r $CVSROOT /tmp/repo-copy/my-project
    mv /tmp/repo-copy/my-project/CVSROOT /tmp/repo-copy/

and then convert from the "my-project" directory of the copy:

    cvs2git [...] /tmp/repo-copy/my-project

Michael

-- 
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1670&dsMessageId=3031220

To unsubscribe from this discussion, e-mail: [[email protected]].