{"thread":{"id":"33876","subject":"[PATCH 0/6] t5000: add test for pax extended header generation","startedAt":"2013-05-20T09:58:23Z","lastAt":"2013-05-20T22:48:25Z","messageCount":15,"participants":["René Scharfe","Eric Sunshine","Marty Landman","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"217965","messageId":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":null,"subject":"[PATCH 0/6] t5000: add test for pax extended header generation","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:23Z","receivedAt":"2013-05-20T09:58:23Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"This series adds a test that exercises git archive's pax header code.\nIt checks for tar versions that don't support pax headers and works\naround their deficiency.\n\nThe first five patches are cleanups and refactorings to centralize\ntar calls into a helper function.  The last patch adds the workaround\nat this central place and a file to the test archive whose name is too\nlong to fit into the path field of a standard tar header, making a pax\nextended header necessary.\n\nRené Scharfe (6):\n  t5000: integrate export-subst tests into regular tests\n  t5000, t5003: create directories for extracted files lazily\n  t5000: factor out check_tar\n  t5000: use check_tar for prefix test\n  t5000: simplify tar-tree tests\n  t5000: test long filenames\n\n t/t5000-tar-tree.sh    | 160 +++++++++++++++++++++++++------------------------\n t/t5000/pax.tar        | Bin 0 -> 10240 bytes\n t/t5003-archive-zip.sh |   2 +-\n 3 files changed, 84 insertions(+), 78 deletions(-)\n create mode 100644 t/t5000/pax.tar\n\n-- \n1.8.2.3\n"},{"id":"217969","messageId":"1369043909-59207-2-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"[PATCH 1/6] t5000: integrate export-subst tests into regular tests","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:24Z","receivedAt":"2013-05-20T09:58:24Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Instead of creating extra archives for testing substitutions, set the\nattribute export-subst and overwrite the marked file with the expected\n(expanded) content right between commiting and archiving.  Thus\nplaceholder expansion based on the committed content is performed with\neach archive creation and the comparision with the contents of directory\na yields the correct result.  We can then remove the special tests for\nexport-subst.\n\nSigned-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n t/t5000-tar-tree.sh | 38 ++++++--------------------------------\n 1 file changed, 6 insertions(+), 32 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 3fbd366..68b5698 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -62,6 +62,12 @@ test_expect_success \\\n      git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE=\"2005-05-27 22:00:00\" \\\n      git commit-tree $treeid </dev/null)'\n \n+test_expect_success 'setup export-subst' '\n+\techo \"substfile?\" export-subst >>.git/info/attributes &&\n+\tgit log --max-count=1 \"--pretty=format:A${SUBSTFORMAT}O\" HEAD \\\n+\t\t>a/substfile1\n+'\n+\n test_expect_success \\\n     'create bare clone' \\\n     'git clone --bare . bare.git &&\n@@ -148,38 +154,6 @@ test_expect_success \\\n     'validate file contents with prefix' \\\n     'diff -r a c/prefix/a'\n \n-test_expect_success \\\n-    'create archives with substfiles' \\\n-    'cp .git/info/attributes .git/info/attributes.before &&\n-     echo \"substfile?\" export-subst >>.git/info/attributes &&\n-     git archive HEAD >f.tar &&\n-     git archive --prefix=prefix/ HEAD >g.tar &&\n-     mv .git/info/attributes.before .git/info/attributes'\n-\n-test_expect_success \\\n-    'extract substfiles' \\\n-    '(mkdir f && cd f && \"$TAR\" xf -) <f.tar'\n-\n-test_expect_success \\\n-     'validate substfile contents' \\\n-     'git log --max-count=1 \"--pretty=format:A${SUBSTFORMAT}O\" HEAD \\\n-      >f/a/substfile1.expected &&\n-      test_cmp f/a/substfile1.expected f/a/substfile1 &&\n-      test_cmp a/substfile2 f/a/substfile2\n-'\n-\n-test_expect_success \\\n-    'extract substfiles from archive with prefix' \\\n-    '(mkdir g && cd g && \"$TAR\" xf -) <g.tar'\n-\n-test_expect_success \\\n-     'validate substfile contents from archive with prefix' \\\n-     'git log --max-count=1 \"--pretty=format:A${SUBSTFORMAT}O\" HEAD \\\n-      >g/prefix/a/substfile1.expected &&\n-      test_cmp g/prefix/a/substfile1.expected g/prefix/a/substfile1 &&\n-      test_cmp a/substfile2 g/prefix/a/substfile2\n-'\n-\n test_expect_success 'git archive with --output, override inferred format' '\n \tgit archive --format=tar --output=d4.zip HEAD &&\n \ttest_cmp b.tar d4.zip\n-- \n1.8.2.3\n"},{"id":"217970","messageId":"1369043909-59207-3-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"[PATCH 2/6] t5000, t5003: create directories for extracted files lazily","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:25Z","receivedAt":"2013-05-20T09:58:25Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Create the directories b and c just before they are needed instead of\nup front.  For t5003 it turns out we don't need them at all.  For t5000\nit makes the coming modifications easier.\n\nSigned-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n t/t5000-tar-tree.sh    | 6 +++---\n t/t5003-archive-zip.sh | 2 +-\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 68b5698..41cd609 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -32,7 +32,7 @@ SUBSTFORMAT=%H%n\n \n test_expect_success \\\n     'populate workdir' \\\n-    'mkdir a b c &&\n+    'mkdir a &&\n      echo simple textfile >a/a &&\n      mkdir a/bin &&\n      cp /bin/sh a/bin &&\n@@ -126,7 +126,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'extract tar archive' \\\n-    '(cd b && \"$TAR\" xf -) <b.tar'\n+    '(mkdir b && cd b && \"$TAR\" xf -) <b.tar'\n \n test_expect_success \\\n     'validate filenames' \\\n@@ -143,7 +143,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'extract tar archive with prefix' \\\n-    '(cd c && \"$TAR\" xf -) <c.tar'\n+    '(mkdir c && cd c && \"$TAR\" xf -) <c.tar'\n \n test_expect_success \\\n     'validate filenames with prefix' \\\ndiff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh\nindex 4e7b05d..c72f71e 100755\n--- a/t/t5003-archive-zip.sh\n+++ b/t/t5003-archive-zip.sh\n@@ -37,7 +37,7 @@ check_zip() {\n \n test_expect_success \\\n     'populate workdir' \\\n-    'mkdir a b c &&\n+    'mkdir a &&\n      echo simple textfile >a/a &&\n      mkdir a/bin &&\n      cp /bin/sh a/bin &&\n-- \n1.8.2.3\n"},{"id":"217967","messageId":"1369043909-59207-4-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"[PATCH 3/6] t5000: factor out check_tar","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:26Z","receivedAt":"2013-05-20T09:58:26Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Create a helper function that extracts a tar archive and checks its\ncontents, modelled after check_zip in t5003.\n\nSigned-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------\n 1 file changed, 22 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 41cd609..8337a1f 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}\n \n SUBSTFORMAT=%H%n\n \n+check_tar() {\n+\ttarfile=$1.tar\n+\tlistfile=$1.lst\n+\tdir=$1\n+\tdir_with_prefix=$dir/$2\n+\n+\ttest_expect_success ' extract tar archive' '\n+\t\t(mkdir $dir && cd $dir && \"$TAR\" xf -) <$tarfile\n+\t'\n+\n+\ttest_expect_success ' validate filenames' '\n+\t\t(cd ${dir_with_prefix}a && find .) | sort >$listfile &&\n+\t\ttest_cmp a.lst $listfile\n+\t'\n+\n+\ttest_expect_success ' validate file contents' '\n+\t\tdiff -r a ${dir_with_prefix}a\n+\t'\n+}\n+\n test_expect_success \\\n     'populate workdir' \\\n     'mkdir a &&\n@@ -81,6 +101,8 @@ test_expect_success \\\n     'git archive' \\\n     'git archive HEAD >b.tar'\n \n+check_tar b\n+\n test_expect_success \\\n     'git tar-tree' \\\n     'git tar-tree HEAD >b2.tar'\n@@ -125,19 +147,6 @@ test_expect_success \\\n      test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n \n test_expect_success \\\n-    'extract tar archive' \\\n-    '(mkdir b && cd b && \"$TAR\" xf -) <b.tar'\n-\n-test_expect_success \\\n-    'validate filenames' \\\n-    '(cd b/a && find .) | sort >b.lst &&\n-     test_cmp a.lst b.lst'\n-\n-test_expect_success \\\n-    'validate file contents' \\\n-    'diff -r a b/a'\n-\n-test_expect_success \\\n     'git tar-tree with prefix' \\\n     'git tar-tree HEAD prefix >c.tar'\n \n-- \n1.8.2.3\n"},{"id":"217968","messageId":"1369043909-59207-5-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"[PATCH 4/6] t5000: use check_tar for prefix test","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:27Z","receivedAt":"2013-05-20T09:58:27Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Perform the full range of checks against all archived files instead of\nlooking only at the file type of a few of them.  Also add a test of a\ngit archive with a prefix ending in with a slash, i.e. adding a full\ndirectory level.\n\nSigned-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n t/t5000-tar-tree.sh | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 8337a1f..5a9b570 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -103,6 +103,18 @@ test_expect_success \\\n \n check_tar b\n \n+test_expect_success 'git archive --prefix=prefix/' '\n+\tgit archive --prefix=prefix/ HEAD >with_prefix.tar\n+'\n+\n+check_tar with_prefix prefix/\n+\n+test_expect_success 'git-archive --prefix=olde-' '\n+\tgit archive --prefix=olde- HEAD >with_olde-prefix.tar\n+'\n+\n+check_tar with_olde-prefix olde-\n+\n test_expect_success \\\n     'git tar-tree' \\\n     'git tar-tree HEAD >b2.tar'\n@@ -180,18 +192,6 @@ test_expect_success 'clients cannot access unreachable commits' '\n \ttest_must_fail git archive --remote=. $sha1 >remote.tar\n '\n \n-test_expect_success 'git-archive --prefix=olde-' '\n-\tgit archive --prefix=olde- >h.tar HEAD &&\n-\t(\n-\t\tmkdir h &&\n-\t\tcd h &&\n-\t\t\"$TAR\" xf - <../h.tar\n-\t) &&\n-\ttest -d h/olde-a &&\n-\ttest -d h/olde-a/bin &&\n-\ttest -f h/olde-a/bin/sh\n-'\n-\n test_expect_success 'setup tar filters' '\n \tgit config tar.tar.foo.command \"tr ab ba\" &&\n \tgit config tar.bar.command \"tr ab ba\" &&\n-- \n1.8.2.3\n"},{"id":"217966","messageId":"1369043909-59207-6-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"[PATCH 5/6] t5000: simplify tar-tree tests","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:28Z","receivedAt":"2013-05-20T09:58:28Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Just compare the archives created by git tar-tree with the ones created\nusing git archive with the equivalent options, whose contents are\nchecked already, instead of extracting them again.\n\nSigned-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n t/t5000-tar-tree.sh | 31 ++++++++-----------------------\n 1 file changed, 8 insertions(+), 23 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 5a9b570..a1f35d2 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -115,14 +115,6 @@ test_expect_success 'git-archive --prefix=olde-' '\n \n check_tar with_olde-prefix olde-\n \n-test_expect_success \\\n-    'git tar-tree' \\\n-    'git tar-tree HEAD >b2.tar'\n-\n-test_expect_success \\\n-    'git archive vs. git tar-tree' \\\n-    'test_cmp b.tar b2.tar'\n-\n test_expect_success 'git archive on large files' '\n     test_config core.bigfilethreshold 1 &&\n     git archive HEAD >b3.tar &&\n@@ -158,22 +150,15 @@ test_expect_success \\\n     'git get-tar-commit-id <b.tar >b.commitid &&\n      test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n \n-test_expect_success \\\n-    'git tar-tree with prefix' \\\n-    'git tar-tree HEAD prefix >c.tar'\n-\n-test_expect_success \\\n-    'extract tar archive with prefix' \\\n-    '(mkdir c && cd c && \"$TAR\" xf -) <c.tar'\n-\n-test_expect_success \\\n-    'validate filenames with prefix' \\\n-    '(cd c/prefix/a && find .) | sort >c.lst &&\n-     test_cmp a.lst c.lst'\n+test_expect_success 'git tar-tree' '\n+\tgit tar-tree HEAD >tar-tree.tar &&\n+\ttest_cmp b.tar tar-tree.tar\n+'\n \n-test_expect_success \\\n-    'validate file contents with prefix' \\\n-    'diff -r a c/prefix/a'\n+test_expect_success 'git tar-tree with prefix' '\n+\tgit tar-tree HEAD prefix >tar-tree_with_prefix.tar &&\n+\ttest_cmp with_prefix.tar tar-tree_with_prefix.tar\n+'\n \n test_expect_success 'git archive with --output, override inferred format' '\n \tgit archive --format=tar --output=d4.zip HEAD &&\n-- \n1.8.2.3\n"},{"id":"217971","messageId":"1369043909-59207-7-git-send-email-rene.scharfe@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"[PATCH 6/6] t5000: test long filenames","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T09:58:29Z","receivedAt":"2013-05-20T09:58:29Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Add a file with a long name to the test archive in order to check\nentries with pax extended headers.  Also add a check for tar versions\nthat doen't understand this format.  Those versions should extract the\nheaders as a regular files.  Add code to check_tar() to interpret the\npath header if present, so that our tests work even with those tar\nversions.\n\nIt's important to use the fallback code only if needed to still be\nable to detect git archive errorously creating pax headers as regular\nfile entries (with a suitable tar version, of course).\n\nThe archive used to check for pax header support in tar was generated\nusing GNU tar 1.26 and its option --format=pax.\n\nTested successfully on NetBSD 6.1, which has a tar version lacking pax\nheader support.\n\nSigned-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n---\n t/t5000-tar-tree.sh |  46 ++++++++++++++++++++++++++++++++++++++++++++++\n t/t5000/pax.tar     | Bin 0 -> 10240 bytes\n 2 files changed, 46 insertions(+)\n create mode 100644 t/t5000/pax.tar\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex a1f35d2..c2023b1 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -30,6 +30,32 @@ GUNZIP=${GUNZIP:-gzip -d}\n \n SUBSTFORMAT=%H%n\n \n+test_lazy_prereq TAR_NEEDS_PAX_FALLBACK '\n+\t(\n+\t\tmkdir pax &&\n+\t\tcd pax &&\n+\t\t\"$TAR\" xf \"$TEST_DIRECTORY\"/t5000/pax.tar &&\n+\t\ttest -f PaxHeaders.1791/file\n+\t)\n+'\n+\n+get_pax_header() {\n+\tfile=$1\n+\theader=$2=\n+\n+\twhile read len rest\n+\tdo\n+\t\tif test \"$len\" = $(echo \"$len $rest\" | wc -c)\n+\t\tthen\n+\t\t\tcase \"$rest\" in\n+\t\t\t$header*)\n+\t\t\t\techo \"${rest#$header}\"\n+\t\t\t\t;;\n+\t\t\tesac\n+\t\tfi\n+\tdone <\"$file\"\n+}\n+\n check_tar() {\n \ttarfile=$1.tar\n \tlistfile=$1.lst\n@@ -40,6 +66,24 @@ check_tar() {\n \t\t(mkdir $dir && cd $dir && \"$TAR\" xf -) <$tarfile\n \t'\n \n+\ttest_expect_success TAR_NEEDS_PAX_FALLBACK ' interpret pax headers' '\n+\t\t(\n+\t\t\tcd $dir &&\n+\t\t\tfor header in *.paxheader\n+\t\t\tdo\n+\t\t\t\tdata=${header%.paxheader}.data &&\n+\t\t\t\tif test -h $data -o -e $data\n+\t\t\t\tthen\n+\t\t\t\t\tpath=$(get_pax_header $header path) &&\n+\t\t\t\t\tif test -n \"$path\"\n+\t\t\t\t\tthen\n+\t\t\t\t\t\tmv \"$data\" \"$path\"\n+\t\t\t\t\tfi\n+\t\t\t\tfi\n+\t\t\tdone\n+\t\t)\n+\t'\n+\n \ttest_expect_success ' validate filenames' '\n \t\t(cd ${dir_with_prefix}a && find .) | sort >$listfile &&\n \t\ttest_cmp a.lst $listfile\n@@ -54,6 +98,8 @@ test_expect_success \\\n     'populate workdir' \\\n     'mkdir a &&\n      echo simple textfile >a/a &&\n+     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n+     echo long filename >a/four$hundred &&\n      mkdir a/bin &&\n      cp /bin/sh a/bin &&\n      printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\ndiff --git a/t/t5000/pax.tar b/t/t5000/pax.tar\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..d91173714991fded560fcd6a8aaec6aa6ec7f5e8\nGIT binary patch\nliteral 10240\nzcmeIy%?g4*5Ww+0_Y^*X&3@?Sp?k+(L29F*2+YXGPl*s(6d@sk|6W#S)Sdakm@c<v\nzvkB!sRJT<7LN5=eb5OG`X;<!?>h^Yh?xL+x+Gv-HHCB5i+IVkN(#%@Lz{l>lx~$rg\nz2GWzmuipCRCcpUG2dyNR`g93vZSz%O3b*p9Sn-k>pDo&KIhx%KXMfulr%w}@f7;`7\nzyU`e%|L&jgG5=zmO1_@SxRf~Zp8x84t>bJTc^pGH_qWm2pU!{O2LS{SKmY**5I_I{\nl1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|00D->}cmml}KZ5`O\n\nliteral 0\nHcmV?d00001\n\n-- \n1.8.2.3\n"},{"id":"217976","messageId":"519A0C54.9090707@lsrfire.ath.cx","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"Re: [PATCH 0/6] t5000: add test for pax extended header generation","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T11:43:16Z","receivedAt":"2013-05-20T11:43:16Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.05.2013 11:58, schrieb René Scharfe:\n> This series adds a test that exercises git archive's pax header code.\n> It checks for tar versions that don't support pax headers and works\n> around their deficiency.\n>\n> The first five patches are cleanups and refactorings to centralize\n> tar calls into a helper function.  The last patch adds the workaround\n> at this central place and a file to the test archive whose name is too\n> long to fit into the path field of a standard tar header, making a pax\n> extended header necessary.\n\nForgot to mention that the last patch was prompted by Thomas' recent \ntest coverage patches.\n\nRené\n"},{"id":"217995","messageId":"CAPig+cQF=xRX+r0HwSafbBZuq0K6uaakDV9-MVve9QhECEs04g@mail.gmail.com","threadId":"33876","inReplyTo":"1369043909-59207-2-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"Re: [PATCH 1/6] t5000: integrate export-subst tests into regular tests","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-20T19:53:21Z","receivedAt":"2013-05-20T19:53:21Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 20, 2013 at 5:58 AM, René Scharfe\n<rene.scharfe@lsrfire.ath.cx> wrote:\n> Instead of creating extra archives for testing substitutions, set the\n> attribute export-subst and overwrite the marked file with the expected\n> (expanded) content right between commiting and archiving.  Thus\n> placeholder expansion based on the committed content is performed with\n> each archive creation and the comparision with the contents of directory\n\ns/comparision/comparison/\n\n> a yields the correct result.  We can then remove the special tests for\n> export-subst.\n>\n> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n"},{"id":"217996","messageId":"CAPig+cSPV08=LcQ4vziE5+HmN3LtBVp7F4mb83--Mub_e2A7qw@mail.gmail.com","threadId":"33876","inReplyTo":"1369043909-59207-4-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"Re: [PATCH 3/6] t5000: factor out check_tar","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-20T19:54:36Z","receivedAt":"2013-05-20T19:54:36Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 20, 2013 at 5:58 AM, René Scharfe\n<rene.scharfe@lsrfire.ath.cx> wrote:\n> Create a helper function that extracts a tar archive and checks its\n> contents, modelled after check_zip in t5003.\n>\n> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>\n> ---\n>  t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------\n>  1 file changed, 22 insertions(+), 13 deletions(-)\n>\n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index 41cd609..8337a1f 100755\n> --- a/t/t5000-tar-tree.sh\n> +++ b/t/t5000-tar-tree.sh\n> @@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}\n>\n>  SUBSTFORMAT=%H%n\n>\n> +check_tar() {\n> +       tarfile=$1.tar\n> +       listfile=$1.lst\n> +       dir=$1\n> +       dir_with_prefix=$dir/$2\n> +\n> +       test_expect_success ' extract tar archive' '\n\ns/' extract/'extract/\n\n> +               (mkdir $dir && cd $dir && \"$TAR\" xf -) <$tarfile\n> +       '\n> +\n> +       test_expect_success ' validate filenames' '\n\ns/' validate/'validate/\n\n> +               (cd ${dir_with_prefix}a && find .) | sort >$listfile &&\n> +               test_cmp a.lst $listfile\n> +       '\n> +\n> +       test_expect_success ' validate file contents' '\n\ns/' validate/'validate/\n\n> +               diff -r a ${dir_with_prefix}a\n> +       '\n> +}\n> +\n>  test_expect_success \\\n>      'populate workdir' \\\n>      'mkdir a &&\n> @@ -81,6 +101,8 @@ test_expect_success \\\n>      'git archive' \\\n>      'git archive HEAD >b.tar'\n>\n> +check_tar b\n> +\n>  test_expect_success \\\n>      'git tar-tree' \\\n>      'git tar-tree HEAD >b2.tar'\n> @@ -125,19 +147,6 @@ test_expect_success \\\n>       test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n>\n>  test_expect_success \\\n> -    'extract tar archive' \\\n> -    '(mkdir b && cd b && \"$TAR\" xf -) <b.tar'\n> -\n> -test_expect_success \\\n> -    'validate filenames' \\\n> -    '(cd b/a && find .) | sort >b.lst &&\n> -     test_cmp a.lst b.lst'\n> -\n> -test_expect_success \\\n> -    'validate file contents' \\\n> -    'diff -r a b/a'\n> -\n> -test_expect_success \\\n>      'git tar-tree with prefix' \\\n>      'git tar-tree HEAD prefix >c.tar'\n>\n> --\n> 1.8.2.3\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"217997","messageId":"CAPig+cTitT9Z+2pxeNh3dXi4b7X738qpkUnEmTi2yvQoCPtHqA@mail.gmail.com","threadId":"33876","inReplyTo":"1369043909-59207-7-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"Re: [PATCH 6/6] t5000: test long filenames","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-20T19:55:38Z","receivedAt":"2013-05-20T19:55:38Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, May 20, 2013 at 5:58 AM, René Scharfe\n<rene.scharfe@lsrfire.ath.cx> wrote:\n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index a1f35d2..c2023b1 100755\n> --- a/t/t5000-tar-tree.sh\n> +++ b/t/t5000-tar-tree.sh\n> @@ -40,6 +66,24 @@ check_tar() {\n>                 (mkdir $dir && cd $dir && \"$TAR\" xf -) <$tarfile\n>         '\n>\n> +       test_expect_success TAR_NEEDS_PAX_FALLBACK ' interpret pax headers' '\n\ns/' interpret/'interpret/\n\n> +               (\n> +                       cd $dir &&\n> +                       for header in *.paxheader\n> +                       do\n> +                               data=${header%.paxheader}.data &&\n> +                               if test -h $data -o -e $data\n> +                               then\n> +                                       path=$(get_pax_header $header path) &&\n> +                                       if test -n \"$path\"\n> +                                       then\n> +                                               mv \"$data\" \"$path\"\n> +                                       fi\n> +                               fi\n> +                       done\n> +               )\n> +       '\n> +\n>         test_expect_success ' validate filenames' '\n>                 (cd ${dir_with_prefix}a && find .) | sort >$listfile &&\n>                 test_cmp a.lst $listfile\n> @@ -54,6 +98,8 @@ test_expect_success \\\n>      'populate workdir' \\\n>      'mkdir a &&\n>       echo simple textfile >a/a &&\n> +     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n> +     echo long filename >a/four$hundred &&\n>       mkdir a/bin &&\n>       cp /bin/sh a/bin &&\n>       printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n> diff --git a/t/t5000/pax.tar b/t/t5000/pax.tar\n> new file mode 100644\n> index 0000000000000000000000000000000000000000..d91173714991fded560fcd6a8aaec6aa6ec7f5e8\n> GIT binary patch\n> literal 10240\n> zcmeIy%?g4*5Ww+0_Y^*X&3@?Sp?k+(L29F*2+YXGPl*s(6d@sk|6W#S)Sdakm@c<v\n> zvkB!sRJT<7LN5=eb5OG`X;<!?>h^Yh?xL+x+Gv-HHCB5i+IVkN(#%@Lz{l>lx~$rg\n> z2GWzmuipCRCcpUG2dyNR`g93vZSz%O3b*p9Sn-k>pDo&KIhx%KXMfulr%w}@f7;`7\n> zyU`e%|L&jgG5=zmO1_@SxRf~Zp8x84t>bJTc^pGH_qWm2pU!{O2LS{SKmY**5I_I{\n> l1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|00D->}cmml}KZ5`O\n>\n> literal 0\n> HcmV?d00001\n"},{"id":"217998","messageId":"F6.11.20878.E218A915@hrndva-omtalb.mail.rr.com","threadId":"33876","inReplyTo":"CAPig+cTitT9Z+2pxeNh3dXi4b7X738qpkUnEmTi2yvQoCPtHqA@mail.gmail.com","subject":"(unknown)","fromName":"Marty Landman","fromEmail":"mlandman@hvc.rr.com","sentAt":"2013-05-20T20:01:49Z","receivedAt":"2013-05-20T20:01:49Z","isPatch":false,"sender":{"key":"mlandman@hvc.rr.com","avatar":null},"body":"unsubscribe git\n"},{"id":"217999","messageId":"519A861C.4070505@lsrfire.ath.cx","threadId":"33876","inReplyTo":"CAPig+cQF=xRX+r0HwSafbBZuq0K6uaakDV9-MVve9QhECEs04g@mail.gmail.com","subject":"Re: [PATCH 1/6] t5000: integrate export-subst tests into regular tests","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T20:22:52Z","receivedAt":"2013-05-20T20:22:52Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.05.2013 21:53, schrieb Eric Sunshine:\n> On Mon, May 20, 2013 at 5:58 AM, René Scharfe\n> <rene.scharfe@lsrfire.ath.cx> wrote:\n>> Instead of creating extra archives for testing substitutions, set the\n>> attribute export-subst and overwrite the marked file with the expected\n>> (expanded) content right between commiting and archiving.  Thus\n\ns/commiting/committing/\n\n>> placeholder expansion based on the committed content is performed with\n>> each archive creation and the comparision with the contents of directory\n>\n> s/comparision/comparison/\n\nMy spelling is getting worse and worse.\n\nRené\n"},{"id":"218000","messageId":"519A8620.4070602@lsrfire.ath.cx","threadId":"33876","inReplyTo":"CAPig+cSPV08=LcQ4vziE5+HmN3LtBVp7F4mb83--Mub_e2A7qw@mail.gmail.com","subject":"Re: [PATCH 3/6] t5000: factor out check_tar","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2013-05-20T20:22:56Z","receivedAt":"2013-05-20T20:22:56Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 20.05.2013 21:54, schrieb Eric Sunshine:\n> On Mon, May 20, 2013 at 5:58 AM, René Scharfe\n> <rene.scharfe@lsrfire.ath.cx> wrote:\n>> +check_tar() {\n>> +       tarfile=$1.tar\n>> +       listfile=$1.lst\n>> +       dir=$1\n>> +       dir_with_prefix=$dir/$2\n>> +\n>> +       test_expect_success ' extract tar archive' '\n>\n> s/' extract/'extract/\n\nIt might be a bit hackish, but I added that single space here and in the \nthree other cases intentionally in order to designate sub-tests.\n\nRené\n"},{"id":"218015","messageId":"7vr4h1s1xi.fsf@alter.siamese.dyndns.org","threadId":"33876","inReplyTo":"1369043909-59207-1-git-send-email-rene.scharfe@lsrfire.ath.cx","subject":"Re: [PATCH 0/6] t5000: add test for pax extended header generation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-20T22:48:25Z","receivedAt":"2013-05-20T22:48:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, will queue.\n"}]}