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

git-cvsimport doesn't quite work, wrt branches

From
Jim Meyering <jim@meyering.net>
Date
Jun 13, 2006, 16:41 UTC
Message-ID
<87irn5ovn6.fsf@rho.meyering.net>

Here's a test case that shows how git-cvsimport is misbehaving. The script below demonstrates the problem with git-1.3.3 as well as with 1.4.0.rc2.g5e3a6. As for cvsps, I'm using version 2.1.

The script creates a simple cvs module, with one file on the trunk, and one file on a branch, then runs git-cvsimport on that. The error is that the resulting git repository has both files on the branch.

FYI, this started when I tried to convert the GNU coreutils repository (which takes barely an hour with git-cvsimport -- very quick, for 45K revisions and 90MB of ,v files), but found that with a git-based working directory, not all files on the b5_9x branch showed up after `git checkout b5_9x' -- plus, there were some files there that didn't belong.

----------------------------- #!/bin/sh # Show that git-cvsimport doesn't quite work when # there is one file on a branch, and another on the trunk. # The resulting git repository has both files on the branch.

export PATH=/p/p/git/bin:$PATH
cvs='cvs -f -Q'

t=/tmp/.k rm -rf $t mkdir -p $t/git $t/cvs R=$t/repo $cvs -d $R init mkdir -p $R/m

cd $t/cvs $cvs -d $R co m cd m # Add a file on the trunk. touch on-trunk $cvs add on-trunk $cvs ci -m. on-trunk

# Add another file, but destined for a branch. touch on-br $cvs add on-br $cvs ci -m. on-br $cvs tag -b B on-br $cvs up -r B echo x > on-br $cvs ci -m. on-br # Back to trunk. $cvs up -A # Remove our only-on-branch file from the trunk. $cvs rm -f on-br $cvs ci -m. on-br

$cvs up -r B

cd $t/git && git-cvsimport -p -x -v -d $R m >& $t/import-log cd $t/git && git checkout B

cd $t

(cd cvs/m; ls -1 on-*) > cvs-files (cd git; git-ls-files|sort) > git-files

diff -u1 cvs-files git-files

# The problem: diff reports the following differences. # It should find none. # --- cvs-files 2006-06-13 17:48:47.000000000 +0200 # +++ git-files 2006-06-13 17:48:47.000000000 +0200 # @@ -1 +1,2 @@ # ./on-br # +./on-trunk

Next: Jakub Narebski
Message 1 of 10 in “git-cvsimport doesn't quite work, wrt branches”
  1. Jim MeyeringJun 13, 2006
  2. Jakub NarebskiJun 13, 2006
  3. Linus TorvaldsJun 13, 2006
  4. Keith PackardJun 13, 2006
  5. Martin LanghoffJun 13, 2006
  6. Keith PackardJun 13, 2006
  7. Martin LanghoffJun 14, 2006
  8. sfJun 14, 2006
  9. Yann DirsonJun 15, 2006
  10. Yann DirsonJun 13, 2006

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.