git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] t9605: test for cvsps commit ordering bug
@ 2013-01-12  4:39 Chris Rorvick
  2013-12-15  0:35 ` Eric S. Raymond
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Rorvick @ 2013-01-12  4:39 UTC (permalink / raw)
  To: git; +Cc: Eric S. Raymond, Chris Rorvick

Import of a trivial CVS repository fails due to a cvsps bug.  Given the
following series of commits:

    timestamp             a    b    c   message
    -------------------  ---  ---  ---  -------
    2012/12/12 21:09:39  1.1            changes are done
    2012/12/12 21:09:44            1.1  changes
    2012/12/12 21:09:46            1.2  changes
    2012/12/12 21:09:50       1.1  1.3  changes are done

cvsps mangles the commit ordering (edited for brevity):

    ---------------------
    PatchSet 1
    Date: 2012/12/12 15:09:39
    Log:
    changes are done

    Members:
    	a:INITIAL->1.1
    	b:INITIAL->1.1
    	c:1.2->1.3

    ---------------------
    PatchSet 2
    Date: 2012/12/12 15:09:44
    Log:
    changes

    Members:
    	c:INITIAL->1.1

    ---------------------
    PatchSet 3
    Date: 2012/12/12 15:09:46
    Log:
    changes

    Members:
    	c:1.1->1.2

This is seen in cvsps versions 2.x and up through at least 3.7.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
---

It actually does fail without the "&& false" at the end.  :-P  Sorry for
the noise.

 t/t9605-cvsimport-commit-order.sh  | 24 +++++++++++++++
 t/t9605/cvsroot/.gitattributes     |  1 +
 t/t9605/cvsroot/CVSROOT/.gitignore |  2 ++
 t/t9605/cvsroot/module/a,v         | 24 +++++++++++++++
 t/t9605/cvsroot/module/b,v         | 24 +++++++++++++++
 t/t9605/cvsroot/module/c,v         | 62 ++++++++++++++++++++++++++++++++++++++
 6 files changed, 137 insertions(+)
 create mode 100755 t/t9605-cvsimport-commit-order.sh
 create mode 100644 t/t9605/cvsroot/.gitattributes
 create mode 100644 t/t9605/cvsroot/CVSROOT/.gitignore
 create mode 100644 t/t9605/cvsroot/module/a,v
 create mode 100644 t/t9605/cvsroot/module/b,v
 create mode 100644 t/t9605/cvsroot/module/c,v

diff --git a/t/t9605-cvsimport-commit-order.sh b/t/t9605-cvsimport-commit-order.sh
new file mode 100755
index 0000000..86aafd1
--- /dev/null
+++ b/t/t9605-cvsimport-commit-order.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+test_description='git cvsimport commit order'
+. ./lib-cvs.sh
+
+setup_cvs_test_repository t9605
+
+test_expect_success 'checkout with CVS' '
+
+	echo CVSROOT=$CVSROOT &&
+	cvs checkout -d module-cvs module
+'
+
+test_expect_failure 'import into git (commit order mangled)' '
+
+	git cvsimport -R -a -p"-x" -C module-git module &&
+	(
+		cd module-git &&
+		git merge origin
+	) &&
+	test_cmp module-cvs/c module-git/c
+'
+
+test_done
diff --git a/t/t9605/cvsroot/.gitattributes b/t/t9605/cvsroot/.gitattributes
new file mode 100644
index 0000000..562b12e
--- /dev/null
+++ b/t/t9605/cvsroot/.gitattributes
@@ -0,0 +1 @@
+* -whitespace
diff --git a/t/t9605/cvsroot/CVSROOT/.gitignore b/t/t9605/cvsroot/CVSROOT/.gitignore
new file mode 100644
index 0000000..3bb9b34
--- /dev/null
+++ b/t/t9605/cvsroot/CVSROOT/.gitignore
@@ -0,0 +1,2 @@
+history
+val-tags
diff --git a/t/t9605/cvsroot/module/a,v b/t/t9605/cvsroot/module/a,v
new file mode 100644
index 0000000..6455911
--- /dev/null
+++ b/t/t9605/cvsroot/module/a,v
@@ -0,0 +1,24 @@
+head	1.1;
+access;
+symbols;
+locks; strict;
+comment	@# @;
+
+
+1.1
+date	2012.12.12.21.09.39;	author tester;	state Exp;
+branches;
+next	;
+
+
+desc
+@@
+
+
+1.1
+log
+@changes are done
+@
+text
+@file a
+@
diff --git a/t/t9605/cvsroot/module/b,v b/t/t9605/cvsroot/module/b,v
new file mode 100644
index 0000000..55545c8
--- /dev/null
+++ b/t/t9605/cvsroot/module/b,v
@@ -0,0 +1,24 @@
+head	1.1;
+access;
+symbols;
+locks; strict;
+comment	@# @;
+
+
+1.1
+date	2012.12.12.21.09.50;	author tester;	state Exp;
+branches;
+next	;
+
+
+desc
+@@
+
+
+1.1
+log
+@changes are done
+@
+text
+@file b
+@
diff --git a/t/t9605/cvsroot/module/c,v b/t/t9605/cvsroot/module/c,v
new file mode 100644
index 0000000..d3eac77
--- /dev/null
+++ b/t/t9605/cvsroot/module/c,v
@@ -0,0 +1,62 @@
+head	1.3;
+access;
+symbols;
+locks; strict;
+comment	@# @;
+
+
+1.3
+date	2012.12.12.21.09.50;	author tester;	state Exp;
+branches;
+next	1.2;
+
+1.2
+date	2012.12.12.21.09.46;	author tester;	state Exp;
+branches;
+next	1.1;
+
+1.1
+date	2012.12.12.21.09.44;	author tester;	state Exp;
+branches;
+next	;
+
+
+desc
+@@
+
+
+1.3
+log
+@changes are done
+@
+text
+@file c
+line two
+line three
+line four
+line five
+@
+
+
+1.2
+log
+@changes
+@
+text
+@d2 4
+a5 4
+line 2
+line 3
+line 4
+line 5
+@
+
+
+1.1
+log
+@changes
+@
+text
+@d2 4
+@
+
-- 
1.8.1.rc3.335.g88a67d6

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

* Re: [PATCH v2] t9605: test for cvsps commit ordering bug
  2013-01-12  4:39 [PATCH v2] t9605: test for cvsps commit ordering bug Chris Rorvick
@ 2013-12-15  0:35 ` Eric S. Raymond
  0 siblings, 0 replies; 2+ messages in thread
From: Eric S. Raymond @ 2013-12-15  0:35 UTC (permalink / raw)
  To: Chris Rorvick; +Cc: git

Replying to very old but newly relevant mail:

Chris Rorvick <chris@rorvick.com>:
> Import of a trivial CVS repository fails due to a cvsps bug.

The t9605 test you sent me is now part of cvs-fast-export's 
regression-test suite, along with suitably adapted versions of
t960[1-4] from the git tree.  Here is a summary of the results:

t9601:
|========================================================================
|                                            | cvsps    | cvs-fast-export
|import a module with a vendor branch        | Succeeds | Succeeds 
|check master out of git repository          | Succeeds | Succeeds 
|check a file imported once                  | Fails    | Succeeds 
|check a file imported twice                 | Succeeds | Succeeds 
|check a file imported then modified on HEAD | Succeeds | Succeeds 
|...imported, modified, then imported again  | Succeeds | Succeeds 
|check a file added to HEAD then imported    | Succeeds | Fails
| a vendor branch whose tag has been removed | Succeeds | Succeeds
|========================================================================

t9602:
|========================================================================
|                                            | cvsps    | cvs-fast-export
|import module                               | Succeeds | Succeeds 
|test branch master                          | Succeeds | Succeeds 
|test branch vendorbranch                    | Succeeds | Fails
|test_branch B_FROM_INITIALS                 | Fails    | Succeeds
|test_branch B_FROM_INITIALS_BUT_ONE         | Fails    | Fails
|test_branch B_MIXED                         | Fails    | Succeeds
|test_branch B_SPLI                          | Succeeds | Succeeds
|test branch vendortag                       | Fails    | Succeeds
|test tag T_ALL_INITIAL_FILES                | Succeeds | Succeeds
|test tag T_ALL_INITIAL_FILES_BUT_ONE        | Fails    | Fails
|test_tag T_MIXED                            | Fails    | Succeeds
|========================================================================

t9603:
	cvsps fails this test; cvs-fast-export succeeds.

t9604:
	cvsps and cvs-fast-export both succeed at this test.

t9605:
	cvsps fails this test; cvs-fast-export succeeds.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

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

end of thread, other threads:[~2013-12-15  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-12  4:39 [PATCH v2] t9605: test for cvsps commit ordering bug Chris Rorvick
2013-12-15  0:35 ` Eric S. Raymond

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).