git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-cvsimport doesn't quite work, wrt branches
@ 2006-06-13 16:41 Jim Meyering
  2006-06-13 17:06 ` Jakub Narebski
  2006-06-13 17:20 ` Linus Torvalds
  0 siblings, 2 replies; 10+ messages in thread
From: Jim Meyering @ 2006-06-13 16:41 UTC (permalink / raw)
  To: git; +Cc: Matthias Urlichs

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-06-15  7:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-13 16:41 git-cvsimport doesn't quite work, wrt branches Jim Meyering
2006-06-13 17:06 ` Jakub Narebski
2006-06-13 17:20 ` Linus Torvalds
2006-06-13 18:46   ` Keith Packard
2006-06-13 22:55     ` Martin Langhoff
2006-06-13 23:30       ` Keith Packard
2006-06-14  1:56         ` Martin Langhoff
2006-06-14  9:37       ` sf
2006-06-15  7:18     ` Yann Dirson
2006-06-13 21:13   ` Yann Dirson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).