{"thread":{"id":"17100","subject":"[PATCH] git-svn: add --authors-file test","startedAt":"2009-01-11T23:44:07Z","lastAt":"2009-01-12T05:40:03Z","messageCount":2,"participants":["Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"100033","messageId":"20090111234406.GA22763@yp-box.dyndns.org","threadId":"17100","inReplyTo":null,"subject":"[PATCH] git-svn: add --authors-file test","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-01-11T23:44:07Z","receivedAt":"2009-01-11T23:44:07Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"I'm not sure how often this functionality is used, but in case\nit's not, having an extra test here will help catch breakage\nsooner.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n\n  This was posted over a year ago and forgotten about.  Updated and\n  cleaned up a bit to work with the new test suite.\n\n t/t9130-git-svn-authors-file.sh |   94 +++++++++++++++++++++++++++++++++++++++\n 1 files changed, 94 insertions(+), 0 deletions(-)\n create mode 100755 t/t9130-git-svn-authors-file.sh\n\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nnew file mode 100755\nindex 0000000..b8fb277\n--- /dev/null\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -0,0 +1,94 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Eric Wong\n+#\n+\n+test_description='git svn authors file tests'\n+\n+. ./lib-git-svn.sh\n+\n+cat > svn-authors <<EOF\n+aa = AAAAAAA AAAAAAA <aa@example.com>\n+bb = BBBBBBB BBBBBBB <bb@example.com>\n+EOF\n+\n+test_expect_success 'setup svnrepo' '\n+\tfor i in aa bb cc dd\n+\tdo\n+\t\tsvn mkdir -m $i --username $i \"$svnrepo\"/$i\n+\tdone\n+\t'\n+\n+test_expect_success 'start import with incomplete authors file' '\n+\t! git svn clone --authors-file=svn-authors \"$svnrepo\" x\n+\t'\n+\n+test_expect_success 'imported 2 revisions successfully' '\n+\t(\n+\t\tcd x\n+\t\ttest \"`git rev-list refs/remotes/git-svn | wc -l`\" -eq 2 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n+\t\t  grep \"^author BBBBBBB BBBBBBB <bb@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n+\t\t  grep \"^author AAAAAAA AAAAAAA <aa@example\\.com> \"\n+\t)\n+\t'\n+\n+cat >> svn-authors <<EOF\n+cc = CCCCCCC CCCCCCC <cc@example.com>\n+dd = DDDDDDD DDDDDDD <dd@example.com>\n+EOF\n+\n+test_expect_success 'continues to import once authors have been added' '\n+\t(\n+\t\tcd x\n+\t\tgit svn fetch --authors-file=../svn-authors &&\n+\t\ttest \"`git rev-list refs/remotes/git-svn | wc -l`\" -eq 4 &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn | \\\n+\t\t  grep \"^author DDDDDDD DDDDDDD <dd@example\\.com> \" &&\n+\t\tgit rev-list -1 --pretty=raw refs/remotes/git-svn~1 | \\\n+\t\t  grep \"^author CCCCCCC CCCCCCC <cc@example\\.com> \"\n+\t)\n+\t'\n+\n+test_expect_success 'authors-file against globs' '\n+\tsvn mkdir -m globs --username aa \\\n+\t  \"$svnrepo\"/aa/trunk \"$svnrepo\"/aa/branches \"$svnrepo\"/aa/tags &&\n+\tgit svn clone --authors-file=svn-authors -s \"$svnrepo\"/aa aa-work &&\n+\tfor i in bb ee cc\n+\tdo\n+\t\tbranch=\"aa/branches/$i\"\n+\t\tsvn mkdir -m \"$branch\" --username $i \"$svnrepo/$branch\"\n+\tdone\n+\t'\n+\n+test_expect_success 'fetch fails on ee' '\n+\t( cd aa-work && ! git svn fetch --authors-file=../svn-authors )\n+\t'\n+\n+tmp_config_get () {\n+\tGIT_CONFIG=.git/svn/.metadata git config --get \"$1\"\n+}\n+\n+test_expect_success 'failure happened without negative side effects' '\n+\t(\n+\t\tcd aa-work &&\n+\t\ttest 6 -eq \"`tmp_config_get svn-remote.svn.branches-maxRev`\" &&\n+\t\ttest 6 -eq \"`tmp_config_get svn-remote.svn.tags-maxRev`\"\n+\t)\n+\t'\n+\n+cat >> svn-authors <<EOF\n+ee = EEEEEEE EEEEEEE <ee@example.com>\n+EOF\n+\n+test_expect_success 'fetch continues after authors-file is fixed' '\n+\t(\n+\t\tcd aa-work &&\n+\t\tgit svn fetch --authors-file=../svn-authors &&\n+\t\ttest 8 -eq \"`tmp_config_get svn-remote.svn.branches-maxRev`\" &&\n+\t\ttest 8 -eq \"`tmp_config_get svn-remote.svn.tags-maxRev`\"\n+\t)\n+\t'\n+\n+test_done\n-- \nEric Wong\n"},{"id":"100072","messageId":"7vwsd1jd58.fsf@gitster.siamese.dyndns.org","threadId":"17100","inReplyTo":"20090111234406.GA22763@yp-box.dyndns.org","subject":"Re: [PATCH] git-svn: add --authors-file test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-12T05:40:03Z","receivedAt":"2009-01-12T05:40:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> I'm not sure how often this functionality is used, but in case\n> it's not, having an extra test here will help catch breakage\n> sooner.\n>\n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n> ---\n>\n>   This was posted over a year ago and forgotten about.  Updated and\n>   cleaned up a bit to work with the new test suite.\n\nThanks.\n"}]}