{"thread":{"id":"32600","subject":"[PATCH] t9605: test for cvsps commit ordering bug","startedAt":"2013-01-12T04:13:53Z","lastAt":"2013-01-12T04:13:53Z","messageCount":1,"participants":["Chris Rorvick"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"206572","messageId":"1357964033-24659-1-git-send-email-chris@rorvick.com","threadId":"32600","inReplyTo":null,"subject":"[PATCH] t9605: test for cvsps commit ordering bug","fromName":"Chris Rorvick","fromEmail":"chris@rorvick.com","sentAt":"2013-01-12T04:13:53Z","receivedAt":"2013-01-12T04:13:53Z","isPatch":true,"sender":{"key":"chris@rorvick.com","avatar":"https://avatars.githubusercontent.com/u/824726?v=4"},"body":"Import of a trivial CVS repository fails due to a cvsps bug.  Given the\nfollowing series of commits:\n\n    timestamp             a    b    c   message\n    -------------------  ---  ---  ---  -------\n    2012/12/12 21:09:39  1.1            changes are done\n    2012/12/12 21:09:44            1.1  changes\n    2012/12/12 21:09:46            1.2  changes\n    2012/12/12 21:09:50       1.1  1.3  changes are done\n\ncvsps mangles the commit ordering (edited for brevity):\n\n    ---------------------\n    PatchSet 1\n    Date: 2012/12/12 15:09:39\n    Log:\n    changes are done\n\n    Members:\n    \ta:INITIAL->1.1\n    \tb:INITIAL->1.1\n    \tc:1.2->1.3\n\n    ---------------------\n    PatchSet 2\n    Date: 2012/12/12 15:09:44\n    Log:\n    changes\n\n    Members:\n    \tc:INITIAL->1.1\n\n    ---------------------\n    PatchSet 3\n    Date: 2012/12/12 15:09:46\n    Log:\n    changes\n\n    Members:\n    \tc:1.1->1.2\n\nThis is seen in cvsps versions 2.x and up through at least 3.7.\n\nSigned-off-by: Chris Rorvick <chris@rorvick.com>\n---\n\nRan into this recently.  No branching and no \"criss cross\" timestamps,\njust lazy commit messages.  And it magically backed out a bug fix.\n\nThis applies on top of master.  With minor modifications I've tested it\nwith Eric's latest code and confirmed the bug still exists.\n\nChris\n\n t/t9605-cvsimport-commit-order.sh  | 25 +++++++++++++++\n t/t9605/cvsroot/.gitattributes     |  1 +\n t/t9605/cvsroot/CVSROOT/.gitignore |  2 ++\n t/t9605/cvsroot/module/a,v         | 24 +++++++++++++++\n t/t9605/cvsroot/module/b,v         | 24 +++++++++++++++\n t/t9605/cvsroot/module/c,v         | 62 ++++++++++++++++++++++++++++++++++++++\n 6 files changed, 138 insertions(+)\n create mode 100755 t/t9605-cvsimport-commit-order.sh\n create mode 100644 t/t9605/cvsroot/.gitattributes\n create mode 100644 t/t9605/cvsroot/CVSROOT/.gitignore\n create mode 100644 t/t9605/cvsroot/module/a,v\n create mode 100644 t/t9605/cvsroot/module/b,v\n create mode 100644 t/t9605/cvsroot/module/c,v\n\ndiff --git a/t/t9605-cvsimport-commit-order.sh b/t/t9605-cvsimport-commit-order.sh\nnew file mode 100755\nindex 0000000..ab4042e\n--- /dev/null\n+++ b/t/t9605-cvsimport-commit-order.sh\n@@ -0,0 +1,25 @@\n+#!/bin/sh\n+\n+test_description='git cvsimport commit order'\n+. ./lib-cvs.sh\n+\n+setup_cvs_test_repository t9605\n+\n+test_expect_success 'checkout with CVS' '\n+\n+\techo CVSROOT=$CVSROOT &&\n+\tcvs checkout -d module-cvs module\n+'\n+\n+test_expect_failure 'import into git (commit order mangled)' '\n+\n+\tgit cvsimport -R -a -p\"-x\" -C module-git module &&\n+\t(\n+\t\tcd module-git &&\n+\t\tgit merge origin\n+\t) &&\n+\ttest_cmp module-cvs/c module-git/c &&\n+false\n+'\n+\n+test_done\ndiff --git a/t/t9605/cvsroot/.gitattributes b/t/t9605/cvsroot/.gitattributes\nnew file mode 100644\nindex 0000000..562b12e\n--- /dev/null\n+++ b/t/t9605/cvsroot/.gitattributes\n@@ -0,0 +1 @@\n+* -whitespace\ndiff --git a/t/t9605/cvsroot/CVSROOT/.gitignore b/t/t9605/cvsroot/CVSROOT/.gitignore\nnew file mode 100644\nindex 0000000..3bb9b34\n--- /dev/null\n+++ b/t/t9605/cvsroot/CVSROOT/.gitignore\n@@ -0,0 +1,2 @@\n+history\n+val-tags\ndiff --git a/t/t9605/cvsroot/module/a,v b/t/t9605/cvsroot/module/a,v\nnew file mode 100644\nindex 0000000..6455911\n--- /dev/null\n+++ b/t/t9605/cvsroot/module/a,v\n@@ -0,0 +1,24 @@\n+head\t1.1;\n+access;\n+symbols;\n+locks; strict;\n+comment\t@# @;\n+\n+\n+1.1\n+date\t2012.12.12.21.09.39;\tauthor tester;\tstate Exp;\n+branches;\n+next\t;\n+\n+\n+desc\n+@@\n+\n+\n+1.1\n+log\n+@changes are done\n+@\n+text\n+@file a\n+@\ndiff --git a/t/t9605/cvsroot/module/b,v b/t/t9605/cvsroot/module/b,v\nnew file mode 100644\nindex 0000000..55545c8\n--- /dev/null\n+++ b/t/t9605/cvsroot/module/b,v\n@@ -0,0 +1,24 @@\n+head\t1.1;\n+access;\n+symbols;\n+locks; strict;\n+comment\t@# @;\n+\n+\n+1.1\n+date\t2012.12.12.21.09.50;\tauthor tester;\tstate Exp;\n+branches;\n+next\t;\n+\n+\n+desc\n+@@\n+\n+\n+1.1\n+log\n+@changes are done\n+@\n+text\n+@file b\n+@\ndiff --git a/t/t9605/cvsroot/module/c,v b/t/t9605/cvsroot/module/c,v\nnew file mode 100644\nindex 0000000..d3eac77\n--- /dev/null\n+++ b/t/t9605/cvsroot/module/c,v\n@@ -0,0 +1,62 @@\n+head\t1.3;\n+access;\n+symbols;\n+locks; strict;\n+comment\t@# @;\n+\n+\n+1.3\n+date\t2012.12.12.21.09.50;\tauthor tester;\tstate Exp;\n+branches;\n+next\t1.2;\n+\n+1.2\n+date\t2012.12.12.21.09.46;\tauthor tester;\tstate Exp;\n+branches;\n+next\t1.1;\n+\n+1.1\n+date\t2012.12.12.21.09.44;\tauthor tester;\tstate Exp;\n+branches;\n+next\t;\n+\n+\n+desc\n+@@\n+\n+\n+1.3\n+log\n+@changes are done\n+@\n+text\n+@file c\n+line two\n+line three\n+line four\n+line five\n+@\n+\n+\n+1.2\n+log\n+@changes\n+@\n+text\n+@d2 4\n+a5 4\n+line 2\n+line 3\n+line 4\n+line 5\n+@\n+\n+\n+1.1\n+log\n+@changes\n+@\n+text\n+@d2 4\n+@\n+\n-- \n1.8.1.rc3.335.g88a67d6\n"}]}