git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] t5000: add test for pax extended header generation
@ 2013-05-20  9:58 René Scharfe
  2013-05-20  9:58 ` [PATCH 1/6] t5000: integrate export-subst tests into regular tests René Scharfe
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

This series adds a test that exercises git archive's pax header code.
It checks for tar versions that don't support pax headers and works
around their deficiency.

The first five patches are cleanups and refactorings to centralize
tar calls into a helper function.  The last patch adds the workaround
at this central place and a file to the test archive whose name is too
long to fit into the path field of a standard tar header, making a pax
extended header necessary.

René Scharfe (6):
  t5000: integrate export-subst tests into regular tests
  t5000, t5003: create directories for extracted files lazily
  t5000: factor out check_tar
  t5000: use check_tar for prefix test
  t5000: simplify tar-tree tests
  t5000: test long filenames

 t/t5000-tar-tree.sh    | 160 +++++++++++++++++++++++++------------------------
 t/t5000/pax.tar        | Bin 0 -> 10240 bytes
 t/t5003-archive-zip.sh |   2 +-
 3 files changed, 84 insertions(+), 78 deletions(-)
 create mode 100644 t/t5000/pax.tar

-- 
1.8.2.3

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

* [PATCH 1/6] t5000: integrate export-subst tests into regular tests
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
@ 2013-05-20  9:58 ` René Scharfe
  2013-05-20 19:53   ` Eric Sunshine
  2013-05-20  9:58 ` [PATCH 2/6] t5000, t5003: create directories for extracted files lazily René Scharfe
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

Instead of creating extra archives for testing substitutions, set the
attribute export-subst and overwrite the marked file with the expected
(expanded) content right between commiting and archiving.  Thus
placeholder expansion based on the committed content is performed with
each archive creation and the comparision with the contents of directory
a yields the correct result.  We can then remove the special tests for
export-subst.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 38 ++++++--------------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 3fbd366..68b5698 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -62,6 +62,12 @@ test_expect_success \
      git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
      git commit-tree $treeid </dev/null)'
 
+test_expect_success 'setup export-subst' '
+	echo "substfile?" export-subst >>.git/info/attributes &&
+	git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
+		>a/substfile1
+'
+
 test_expect_success \
     'create bare clone' \
     'git clone --bare . bare.git &&
@@ -148,38 +154,6 @@ test_expect_success \
     'validate file contents with prefix' \
     'diff -r a c/prefix/a'
 
-test_expect_success \
-    'create archives with substfiles' \
-    'cp .git/info/attributes .git/info/attributes.before &&
-     echo "substfile?" export-subst >>.git/info/attributes &&
-     git archive HEAD >f.tar &&
-     git archive --prefix=prefix/ HEAD >g.tar &&
-     mv .git/info/attributes.before .git/info/attributes'
-
-test_expect_success \
-    'extract substfiles' \
-    '(mkdir f && cd f && "$TAR" xf -) <f.tar'
-
-test_expect_success \
-     'validate substfile contents' \
-     'git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
-      >f/a/substfile1.expected &&
-      test_cmp f/a/substfile1.expected f/a/substfile1 &&
-      test_cmp a/substfile2 f/a/substfile2
-'
-
-test_expect_success \
-    'extract substfiles from archive with prefix' \
-    '(mkdir g && cd g && "$TAR" xf -) <g.tar'
-
-test_expect_success \
-     'validate substfile contents from archive with prefix' \
-     'git log --max-count=1 "--pretty=format:A${SUBSTFORMAT}O" HEAD \
-      >g/prefix/a/substfile1.expected &&
-      test_cmp g/prefix/a/substfile1.expected g/prefix/a/substfile1 &&
-      test_cmp a/substfile2 g/prefix/a/substfile2
-'
-
 test_expect_success 'git archive with --output, override inferred format' '
 	git archive --format=tar --output=d4.zip HEAD &&
 	test_cmp b.tar d4.zip
-- 
1.8.2.3

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

* [PATCH 2/6] t5000, t5003: create directories for extracted files lazily
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
  2013-05-20  9:58 ` [PATCH 1/6] t5000: integrate export-subst tests into regular tests René Scharfe
@ 2013-05-20  9:58 ` René Scharfe
  2013-05-20  9:58 ` [PATCH 3/6] t5000: factor out check_tar René Scharfe
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

Create the directories b and c just before they are needed instead of
up front.  For t5003 it turns out we don't need them at all.  For t5000
it makes the coming modifications easier.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh    | 6 +++---
 t/t5003-archive-zip.sh | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 68b5698..41cd609 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -32,7 +32,7 @@ SUBSTFORMAT=%H%n
 
 test_expect_success \
     'populate workdir' \
-    'mkdir a b c &&
+    'mkdir a &&
      echo simple textfile >a/a &&
      mkdir a/bin &&
      cp /bin/sh a/bin &&
@@ -126,7 +126,7 @@ test_expect_success \
 
 test_expect_success \
     'extract tar archive' \
-    '(cd b && "$TAR" xf -) <b.tar'
+    '(mkdir b && cd b && "$TAR" xf -) <b.tar'
 
 test_expect_success \
     'validate filenames' \
@@ -143,7 +143,7 @@ test_expect_success \
 
 test_expect_success \
     'extract tar archive with prefix' \
-    '(cd c && "$TAR" xf -) <c.tar'
+    '(mkdir c && cd c && "$TAR" xf -) <c.tar'
 
 test_expect_success \
     'validate filenames with prefix' \
diff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh
index 4e7b05d..c72f71e 100755
--- a/t/t5003-archive-zip.sh
+++ b/t/t5003-archive-zip.sh
@@ -37,7 +37,7 @@ check_zip() {
 
 test_expect_success \
     'populate workdir' \
-    'mkdir a b c &&
+    'mkdir a &&
      echo simple textfile >a/a &&
      mkdir a/bin &&
      cp /bin/sh a/bin &&
-- 
1.8.2.3

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

* [PATCH 3/6] t5000: factor out check_tar
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
  2013-05-20  9:58 ` [PATCH 1/6] t5000: integrate export-subst tests into regular tests René Scharfe
  2013-05-20  9:58 ` [PATCH 2/6] t5000, t5003: create directories for extracted files lazily René Scharfe
@ 2013-05-20  9:58 ` René Scharfe
  2013-05-20 19:54   ` Eric Sunshine
  2013-05-20  9:58 ` [PATCH 4/6] t5000: use check_tar for prefix test René Scharfe
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

Create a helper function that extracts a tar archive and checks its
contents, modelled after check_zip in t5003.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 41cd609..8337a1f 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}
 
 SUBSTFORMAT=%H%n
 
+check_tar() {
+	tarfile=$1.tar
+	listfile=$1.lst
+	dir=$1
+	dir_with_prefix=$dir/$2
+
+	test_expect_success ' extract tar archive' '
+		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
+	'
+
+	test_expect_success ' validate filenames' '
+		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
+		test_cmp a.lst $listfile
+	'
+
+	test_expect_success ' validate file contents' '
+		diff -r a ${dir_with_prefix}a
+	'
+}
+
 test_expect_success \
     'populate workdir' \
     'mkdir a &&
@@ -81,6 +101,8 @@ test_expect_success \
     'git archive' \
     'git archive HEAD >b.tar'
 
+check_tar b
+
 test_expect_success \
     'git tar-tree' \
     'git tar-tree HEAD >b2.tar'
@@ -125,19 +147,6 @@ test_expect_success \
      test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
 
 test_expect_success \
-    'extract tar archive' \
-    '(mkdir b && cd b && "$TAR" xf -) <b.tar'
-
-test_expect_success \
-    'validate filenames' \
-    '(cd b/a && find .) | sort >b.lst &&
-     test_cmp a.lst b.lst'
-
-test_expect_success \
-    'validate file contents' \
-    'diff -r a b/a'
-
-test_expect_success \
     'git tar-tree with prefix' \
     'git tar-tree HEAD prefix >c.tar'
 
-- 
1.8.2.3

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

* [PATCH 4/6] t5000: use check_tar for prefix test
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
                   ` (2 preceding siblings ...)
  2013-05-20  9:58 ` [PATCH 3/6] t5000: factor out check_tar René Scharfe
@ 2013-05-20  9:58 ` René Scharfe
  2013-05-20  9:58 ` [PATCH 5/6] t5000: simplify tar-tree tests René Scharfe
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

Perform the full range of checks against all archived files instead of
looking only at the file type of a few of them.  Also add a test of a
git archive with a prefix ending in with a slash, i.e. adding a full
directory level.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 8337a1f..5a9b570 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -103,6 +103,18 @@ test_expect_success \
 
 check_tar b
 
+test_expect_success 'git archive --prefix=prefix/' '
+	git archive --prefix=prefix/ HEAD >with_prefix.tar
+'
+
+check_tar with_prefix prefix/
+
+test_expect_success 'git-archive --prefix=olde-' '
+	git archive --prefix=olde- HEAD >with_olde-prefix.tar
+'
+
+check_tar with_olde-prefix olde-
+
 test_expect_success \
     'git tar-tree' \
     'git tar-tree HEAD >b2.tar'
@@ -180,18 +192,6 @@ test_expect_success 'clients cannot access unreachable commits' '
 	test_must_fail git archive --remote=. $sha1 >remote.tar
 '
 
-test_expect_success 'git-archive --prefix=olde-' '
-	git archive --prefix=olde- >h.tar HEAD &&
-	(
-		mkdir h &&
-		cd h &&
-		"$TAR" xf - <../h.tar
-	) &&
-	test -d h/olde-a &&
-	test -d h/olde-a/bin &&
-	test -f h/olde-a/bin/sh
-'
-
 test_expect_success 'setup tar filters' '
 	git config tar.tar.foo.command "tr ab ba" &&
 	git config tar.bar.command "tr ab ba" &&
-- 
1.8.2.3

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

* [PATCH 5/6] t5000: simplify tar-tree tests
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
                   ` (3 preceding siblings ...)
  2013-05-20  9:58 ` [PATCH 4/6] t5000: use check_tar for prefix test René Scharfe
@ 2013-05-20  9:58 ` René Scharfe
  2013-05-20  9:58 ` [PATCH 6/6] t5000: test long filenames René Scharfe
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

Just compare the archives created by git tar-tree with the ones created
using git archive with the equivalent options, whose contents are
checked already, instead of extracting them again.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh | 31 ++++++++-----------------------
 1 file changed, 8 insertions(+), 23 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 5a9b570..a1f35d2 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -115,14 +115,6 @@ test_expect_success 'git-archive --prefix=olde-' '
 
 check_tar with_olde-prefix olde-
 
-test_expect_success \
-    'git tar-tree' \
-    'git tar-tree HEAD >b2.tar'
-
-test_expect_success \
-    'git archive vs. git tar-tree' \
-    'test_cmp b.tar b2.tar'
-
 test_expect_success 'git archive on large files' '
     test_config core.bigfilethreshold 1 &&
     git archive HEAD >b3.tar &&
@@ -158,22 +150,15 @@ test_expect_success \
     'git get-tar-commit-id <b.tar >b.commitid &&
      test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
 
-test_expect_success \
-    'git tar-tree with prefix' \
-    'git tar-tree HEAD prefix >c.tar'
-
-test_expect_success \
-    'extract tar archive with prefix' \
-    '(mkdir c && cd c && "$TAR" xf -) <c.tar'
-
-test_expect_success \
-    'validate filenames with prefix' \
-    '(cd c/prefix/a && find .) | sort >c.lst &&
-     test_cmp a.lst c.lst'
+test_expect_success 'git tar-tree' '
+	git tar-tree HEAD >tar-tree.tar &&
+	test_cmp b.tar tar-tree.tar
+'
 
-test_expect_success \
-    'validate file contents with prefix' \
-    'diff -r a c/prefix/a'
+test_expect_success 'git tar-tree with prefix' '
+	git tar-tree HEAD prefix >tar-tree_with_prefix.tar &&
+	test_cmp with_prefix.tar tar-tree_with_prefix.tar
+'
 
 test_expect_success 'git archive with --output, override inferred format' '
 	git archive --format=tar --output=d4.zip HEAD &&
-- 
1.8.2.3

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

* [PATCH 6/6] t5000: test long filenames
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
                   ` (4 preceding siblings ...)
  2013-05-20  9:58 ` [PATCH 5/6] t5000: simplify tar-tree tests René Scharfe
@ 2013-05-20  9:58 ` René Scharfe
  2013-05-20 19:55   ` Eric Sunshine
  2013-05-20 11:43 ` [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
  2013-05-20 22:48 ` Junio C Hamano
  7 siblings, 1 reply; 15+ messages in thread
From: René Scharfe @ 2013-05-20  9:58 UTC (permalink / raw)
  To: git

Add a file with a long name to the test archive in order to check
entries with pax extended headers.  Also add a check for tar versions
that doen't understand this format.  Those versions should extract the
headers as a regular files.  Add code to check_tar() to interpret the
path header if present, so that our tests work even with those tar
versions.

It's important to use the fallback code only if needed to still be
able to detect git archive errorously creating pax headers as regular
file entries (with a suitable tar version, of course).

The archive used to check for pax header support in tar was generated
using GNU tar 1.26 and its option --format=pax.

Tested successfully on NetBSD 6.1, which has a tar version lacking pax
header support.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 t/t5000-tar-tree.sh |  46 ++++++++++++++++++++++++++++++++++++++++++++++
 t/t5000/pax.tar     | Bin 0 -> 10240 bytes
 2 files changed, 46 insertions(+)
 create mode 100644 t/t5000/pax.tar

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index a1f35d2..c2023b1 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -30,6 +30,32 @@ GUNZIP=${GUNZIP:-gzip -d}
 
 SUBSTFORMAT=%H%n
 
+test_lazy_prereq TAR_NEEDS_PAX_FALLBACK '
+	(
+		mkdir pax &&
+		cd pax &&
+		"$TAR" xf "$TEST_DIRECTORY"/t5000/pax.tar &&
+		test -f PaxHeaders.1791/file
+	)
+'
+
+get_pax_header() {
+	file=$1
+	header=$2=
+
+	while read len rest
+	do
+		if test "$len" = $(echo "$len $rest" | wc -c)
+		then
+			case "$rest" in
+			$header*)
+				echo "${rest#$header}"
+				;;
+			esac
+		fi
+	done <"$file"
+}
+
 check_tar() {
 	tarfile=$1.tar
 	listfile=$1.lst
@@ -40,6 +66,24 @@ check_tar() {
 		(mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
 	'
 
+	test_expect_success TAR_NEEDS_PAX_FALLBACK ' interpret pax headers' '
+		(
+			cd $dir &&
+			for header in *.paxheader
+			do
+				data=${header%.paxheader}.data &&
+				if test -h $data -o -e $data
+				then
+					path=$(get_pax_header $header path) &&
+					if test -n "$path"
+					then
+						mv "$data" "$path"
+					fi
+				fi
+			done
+		)
+	'
+
 	test_expect_success ' validate filenames' '
 		(cd ${dir_with_prefix}a && find .) | sort >$listfile &&
 		test_cmp a.lst $listfile
@@ -54,6 +98,8 @@ test_expect_success \
     'populate workdir' \
     'mkdir a &&
      echo simple textfile >a/a &&
+     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
+     echo long filename >a/four$hundred &&
      mkdir a/bin &&
      cp /bin/sh a/bin &&
      printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
diff --git a/t/t5000/pax.tar b/t/t5000/pax.tar
new file mode 100644
index 0000000000000000000000000000000000000000..d91173714991fded560fcd6a8aaec6aa6ec7f5e8
GIT binary patch
literal 10240
zcmeIy%?g4*5Ww+0_Y^*X&3@?Sp?k+(L29F*2+YXGPl*s(6d@sk|6W#S)Sdakm@c<v
zvkB!sRJT<7LN5=eb5OG`X;<!?>h^Yh?xL+x+Gv-HHCB5i+IVkN(#%@Lz{l>lx~$rg
z2GWzmuipCRCcpUG2dyNR`g93vZSz%O3b*p9Sn-k>pDo&KIhx%KXMfulr%w}@f7;`7
zyU`e%|L&jgG5=zmO1_@SxRf~Zp8x84t>bJTc^pGH_qWm2pU!{O2LS{SKmY**5I_I{
l1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|00D->}cmml}KZ5`O

literal 0
HcmV?d00001

-- 
1.8.2.3

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

* Re: [PATCH 0/6] t5000: add test for pax extended header generation
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
                   ` (5 preceding siblings ...)
  2013-05-20  9:58 ` [PATCH 6/6] t5000: test long filenames René Scharfe
@ 2013-05-20 11:43 ` René Scharfe
  2013-05-20 22:48 ` Junio C Hamano
  7 siblings, 0 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20 11:43 UTC (permalink / raw)
  To: git; +Cc: Thomas Rast

Am 20.05.2013 11:58, schrieb René Scharfe:
> This series adds a test that exercises git archive's pax header code.
> It checks for tar versions that don't support pax headers and works
> around their deficiency.
>
> The first five patches are cleanups and refactorings to centralize
> tar calls into a helper function.  The last patch adds the workaround
> at this central place and a file to the test archive whose name is too
> long to fit into the path field of a standard tar header, making a pax
> extended header necessary.

Forgot to mention that the last patch was prompted by Thomas' recent 
test coverage patches.

René

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

* Re: [PATCH 1/6] t5000: integrate export-subst tests into regular tests
  2013-05-20  9:58 ` [PATCH 1/6] t5000: integrate export-subst tests into regular tests René Scharfe
@ 2013-05-20 19:53   ` Eric Sunshine
  2013-05-20 20:22     ` René Scharfe
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Sunshine @ 2013-05-20 19:53 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git List

On Mon, May 20, 2013 at 5:58 AM, René Scharfe
<rene.scharfe@lsrfire.ath.cx> wrote:
> Instead of creating extra archives for testing substitutions, set the
> attribute export-subst and overwrite the marked file with the expected
> (expanded) content right between commiting and archiving.  Thus
> placeholder expansion based on the committed content is performed with
> each archive creation and the comparision with the contents of directory

s/comparision/comparison/

> a yields the correct result.  We can then remove the special tests for
> export-subst.
>
> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>

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

* Re: [PATCH 3/6] t5000: factor out check_tar
  2013-05-20  9:58 ` [PATCH 3/6] t5000: factor out check_tar René Scharfe
@ 2013-05-20 19:54   ` Eric Sunshine
  2013-05-20 20:22     ` René Scharfe
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Sunshine @ 2013-05-20 19:54 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git List

On Mon, May 20, 2013 at 5:58 AM, René Scharfe
<rene.scharfe@lsrfire.ath.cx> wrote:
> Create a helper function that extracts a tar archive and checks its
> contents, modelled after check_zip in t5003.
>
> Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
> ---
>  t/t5000-tar-tree.sh | 35 ++++++++++++++++++++++-------------
>  1 file changed, 22 insertions(+), 13 deletions(-)
>
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index 41cd609..8337a1f 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -30,6 +30,26 @@ GUNZIP=${GUNZIP:-gzip -d}
>
>  SUBSTFORMAT=%H%n
>
> +check_tar() {
> +       tarfile=$1.tar
> +       listfile=$1.lst
> +       dir=$1
> +       dir_with_prefix=$dir/$2
> +
> +       test_expect_success ' extract tar archive' '

s/' extract/'extract/

> +               (mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
> +       '
> +
> +       test_expect_success ' validate filenames' '

s/' validate/'validate/

> +               (cd ${dir_with_prefix}a && find .) | sort >$listfile &&
> +               test_cmp a.lst $listfile
> +       '
> +
> +       test_expect_success ' validate file contents' '

s/' validate/'validate/

> +               diff -r a ${dir_with_prefix}a
> +       '
> +}
> +
>  test_expect_success \
>      'populate workdir' \
>      'mkdir a &&
> @@ -81,6 +101,8 @@ test_expect_success \
>      'git archive' \
>      'git archive HEAD >b.tar'
>
> +check_tar b
> +
>  test_expect_success \
>      'git tar-tree' \
>      'git tar-tree HEAD >b2.tar'
> @@ -125,19 +147,6 @@ test_expect_success \
>       test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
>
>  test_expect_success \
> -    'extract tar archive' \
> -    '(mkdir b && cd b && "$TAR" xf -) <b.tar'
> -
> -test_expect_success \
> -    'validate filenames' \
> -    '(cd b/a && find .) | sort >b.lst &&
> -     test_cmp a.lst b.lst'
> -
> -test_expect_success \
> -    'validate file contents' \
> -    'diff -r a b/a'
> -
> -test_expect_success \
>      'git tar-tree with prefix' \
>      'git tar-tree HEAD prefix >c.tar'
>
> --
> 1.8.2.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 6/6] t5000: test long filenames
  2013-05-20  9:58 ` [PATCH 6/6] t5000: test long filenames René Scharfe
@ 2013-05-20 19:55   ` Eric Sunshine
       [not found]     ` <CAPig+cTitT9Z+2pxeNh3dXi4b7X738qpkUnEmTi2yvQoCPtHqA@mail.g mail.com>
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Sunshine @ 2013-05-20 19:55 UTC (permalink / raw)
  To: René Scharfe; +Cc: Git List

On Mon, May 20, 2013 at 5:58 AM, René Scharfe
<rene.scharfe@lsrfire.ath.cx> wrote:
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index a1f35d2..c2023b1 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -40,6 +66,24 @@ check_tar() {
>                 (mkdir $dir && cd $dir && "$TAR" xf -) <$tarfile
>         '
>
> +       test_expect_success TAR_NEEDS_PAX_FALLBACK ' interpret pax headers' '

s/' interpret/'interpret/

> +               (
> +                       cd $dir &&
> +                       for header in *.paxheader
> +                       do
> +                               data=${header%.paxheader}.data &&
> +                               if test -h $data -o -e $data
> +                               then
> +                                       path=$(get_pax_header $header path) &&
> +                                       if test -n "$path"
> +                                       then
> +                                               mv "$data" "$path"
> +                                       fi
> +                               fi
> +                       done
> +               )
> +       '
> +
>         test_expect_success ' validate filenames' '
>                 (cd ${dir_with_prefix}a && find .) | sort >$listfile &&
>                 test_cmp a.lst $listfile
> @@ -54,6 +98,8 @@ test_expect_success \
>      'populate workdir' \
>      'mkdir a &&
>       echo simple textfile >a/a &&
> +     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
> +     echo long filename >a/four$hundred &&
>       mkdir a/bin &&
>       cp /bin/sh a/bin &&
>       printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
> diff --git a/t/t5000/pax.tar b/t/t5000/pax.tar
> new file mode 100644
> index 0000000000000000000000000000000000000000..d91173714991fded560fcd6a8aaec6aa6ec7f5e8
> GIT binary patch
> literal 10240
> zcmeIy%?g4*5Ww+0_Y^*X&3@?Sp?k+(L29F*2+YXGPl*s(6d@sk|6W#S)Sdakm@c<v
> zvkB!sRJT<7LN5=eb5OG`X;<!?>h^Yh?xL+x+Gv-HHCB5i+IVkN(#%@Lz{l>lx~$rg
> z2GWzmuipCRCcpUG2dyNR`g93vZSz%O3b*p9Sn-k>pDo&KIhx%KXMfulr%w}@f7;`7
> zyU`e%|L&jgG5=zmO1_@SxRf~Zp8x84t>bJTc^pGH_qWm2pU!{O2LS{SKmY**5I_I{
> l1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|00D->}cmml}KZ5`O
>
> literal 0
> HcmV?d00001

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

* (unknown), 
       [not found]     ` <CAPig+cTitT9Z+2pxeNh3dXi4b7X738qpkUnEmTi2yvQoCPtHqA@mail.g mail.com>
@ 2013-05-20 20:01       ` Marty Landman
  0 siblings, 0 replies; 15+ messages in thread
From: Marty Landman @ 2013-05-20 20:01 UTC (permalink / raw)
  To: Git List

unsubscribe git

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

* Re: [PATCH 1/6] t5000: integrate export-subst tests into regular tests
  2013-05-20 19:53   ` Eric Sunshine
@ 2013-05-20 20:22     ` René Scharfe
  0 siblings, 0 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20 20:22 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List

Am 20.05.2013 21:53, schrieb Eric Sunshine:
> On Mon, May 20, 2013 at 5:58 AM, René Scharfe
> <rene.scharfe@lsrfire.ath.cx> wrote:
>> Instead of creating extra archives for testing substitutions, set the
>> attribute export-subst and overwrite the marked file with the expected
>> (expanded) content right between commiting and archiving.  Thus

s/commiting/committing/

>> placeholder expansion based on the committed content is performed with
>> each archive creation and the comparision with the contents of directory
>
> s/comparision/comparison/

My spelling is getting worse and worse.

René

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

* Re: [PATCH 3/6] t5000: factor out check_tar
  2013-05-20 19:54   ` Eric Sunshine
@ 2013-05-20 20:22     ` René Scharfe
  0 siblings, 0 replies; 15+ messages in thread
From: René Scharfe @ 2013-05-20 20:22 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List

Am 20.05.2013 21:54, schrieb Eric Sunshine:
> On Mon, May 20, 2013 at 5:58 AM, René Scharfe
> <rene.scharfe@lsrfire.ath.cx> wrote:
>> +check_tar() {
>> +       tarfile=$1.tar
>> +       listfile=$1.lst
>> +       dir=$1
>> +       dir_with_prefix=$dir/$2
>> +
>> +       test_expect_success ' extract tar archive' '
>
> s/' extract/'extract/

It might be a bit hackish, but I added that single space here and in the 
three other cases intentionally in order to designate sub-tests.

René

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

* Re: [PATCH 0/6] t5000: add test for pax extended header generation
  2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
                   ` (6 preceding siblings ...)
  2013-05-20 11:43 ` [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
@ 2013-05-20 22:48 ` Junio C Hamano
  7 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2013-05-20 22:48 UTC (permalink / raw)
  To: René Scharfe; +Cc: git

Thanks, will queue.

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

end of thread, other threads:[~2013-05-20 22:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-20  9:58 [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
2013-05-20  9:58 ` [PATCH 1/6] t5000: integrate export-subst tests into regular tests René Scharfe
2013-05-20 19:53   ` Eric Sunshine
2013-05-20 20:22     ` René Scharfe
2013-05-20  9:58 ` [PATCH 2/6] t5000, t5003: create directories for extracted files lazily René Scharfe
2013-05-20  9:58 ` [PATCH 3/6] t5000: factor out check_tar René Scharfe
2013-05-20 19:54   ` Eric Sunshine
2013-05-20 20:22     ` René Scharfe
2013-05-20  9:58 ` [PATCH 4/6] t5000: use check_tar for prefix test René Scharfe
2013-05-20  9:58 ` [PATCH 5/6] t5000: simplify tar-tree tests René Scharfe
2013-05-20  9:58 ` [PATCH 6/6] t5000: test long filenames René Scharfe
2013-05-20 19:55   ` Eric Sunshine
     [not found]     ` <CAPig+cTitT9Z+2pxeNh3dXi4b7X738qpkUnEmTi2yvQoCPtHqA@mail.g mail.com>
2013-05-20 20:01       ` (unknown), Marty Landman
2013-05-20 11:43 ` [PATCH 0/6] t5000: add test for pax extended header generation René Scharfe
2013-05-20 22:48 ` Junio C Hamano

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