git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cvs2git with modules?

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jun 17, 2008, 15:45 UTC
Message-ID
<4857DC0C.8060902@alum.mit.edu>
In-Reply-To
<63BEA5E623E09F4D92233FB12A9F794302389A59@emailmn.mqsoftware.com>

[I see you sent essentially the same question to both the git and the cvs2svn mailing lists. I am replying on the git list with bcc to the cvs2svn list. Followups please to git@vger.kernel.org.]

Kelly F. Hickel wrote:
Show 20 quoted lines
> I'm trying to use cvs2svn in cvs2git mode to convert a repo with a
> number of modules.  Can anyone tell me how to keep that module
> structure in the new git repo? So, if in cvs there are two modules,
> ModA and ModB, I want to see those two as top level directories in
> the git repo.
> 
> I've tried putting adding the projects in my options file as below,
> but it puts the files ModA/* and ModB/* at the top level in the git repo.
> 
> run_options.add_project(
>     r'/home/foo/cvsrepo/ModA,
>     trunk_path=ModA',
>     [...]
>     )
> 
> run_options.add_project(
>     r'/home/foo/cvsrepo/ModB,
>     trunk_path=ModB',
>     [...]
>     )

I assume that what you mean is that the CVS repository contains directories like ModA/a, ModA/b, ModB/c, and ModB/d, but the resulting git repository has only /a, /b, /c, and /d. That is because cvs2git completely ignores the trunk_path argument to add_project().

It is strange that the code allows you to add multiple projects, considering that the cvs2git documentation[1] states that cvs2git only supports converting single projects at a time. I guess I forgot to build that check in.

You can get the result you want by treating ModA and ModB not as two separate projects, but simply as two separate subdirectories within a bigger project; i.e.,

run_options.add_project(
    r'/home/foo/cvsrepo,
    [...]
    )

. This is assuming that ModA and ModB are the only subdirectories within /home/foo/cvsrepo/; otherwise, make a copy of your CVS repo and remove the other subdirectories from the copy before the conversion.

Please note that when cvs2git is run this way, it treats tags and branches as being global. If you tagged your projects simultaneously, then this is probably what you want. But if you tagged your projects separately, then tag names that happen to be the same across projects will be considered the same.

It would be possible to add cvs2git support for multiproject conversions, but I was under the impression that it doesn't make much sense to put multiple projects into a single git repository. But I'm a novice git user, so I could very well be wrong about that.

Michael
[1] http://cvs2svn.tigris.org/cvs2git.html
Previous: Kelly F. HickelNext: Geoffrey Irving
Message 2 of 4 in “cvs2git with modules?”
  1. Kelly F. HickelJun 17, 2008
  2. Michael HaggertyJun 17, 2008
  3. Geoffrey IrvingJun 17, 2008
  4. Geoffrey IrvingJun 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.