Skip to contentSkip to conversation

t6041: do not compress backup tar file

PATCH In review Stefan Beller 3 participants 4 messages Jun 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t6041: do not compress backup tar file

The test uses the 'z' option, i.e. "compress the output while at it", which is GNUism and not portable.

---

Thanks Armin for reporting these GNUism!
Are there any more? (So we can do these patches as a series instead of one by one:)

developed on top of origin/sb/z-is-gnutar-ism

Thanks,
Stefan

 t/t6041-bisect-submodule.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
t/t6041-bisect-submodule.sh +2 -2
index c6b7aa6..62b8a2e 100755
@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'
 git_bisect () {
 	git status -su >expect &&
 	ls -1pR * >>expect &&
-	tar czf "$TRASH_DIRECTORY/tmp.tgz" * &&
+	tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
 	GOOD=$(git rev-parse --verify HEAD) &&
 	git checkout "$1" &&
 	echo "foo" >bar &&
@@ -20,7 +20,7 @@ git_bisect () {
 	git bisect start &&
 	git bisect good $GOOD &&
 	rm -rf * &&
-	tar xzf "$TRASH_DIRECTORY/tmp.tgz" &&
+	tar xf "$TRASH_DIRECTORY/tmp.tar" &&
 	git status -su >actual &&
 	ls -1pR * >>actual &&
 	test_cmp expect actual &&
Signature · 1 line
2.8.0.37.g63b3e6f.dirty
#1 lore raw

Hi Stefan,

I'm currently in the process of skipping through the failed tests on my AIX box. There are more tests which require GNU tools like mktemp (t7610-mergetool.sh) or readlink (t7800-difftool.sh).
But I don't have a solution or workaround for these two.
But at least there are not more failing compressed tar tests :-)

Thanks,
Armin

Quoted 15 lines · Stefan Beller

The test uses the 'z' option, i.e. "compress the output while at it", which is GNUism and not portable.

---

Thanks Armin for reporting these GNUism!
Are there any more? (So we can do these patches as a series instead of one by one:)

developed on top of origin/sb/z-is-gnutar-ism

Thanks,
Stefan

#2 lore raw
In reply to Stefan Beller
Quoted 14 lines · Stefan Beller
t/t6041-bisect-submodule.sh +1 -1
index c6b7aa6..62b8a2e 100755
@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'
 git_bisect () {
 	git status -su >expect &&
 	ls -1pR * >>expect &&
-	tar czf "$TRASH_DIRECTORY/tmp.tgz" * &&
+	tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
 	GOOD=$(git rev-parse --verify HEAD) &&
 	git checkout "$1" &&
 	echo "foo" >bar &&

t/t6041-bisect-submodule.sh git_bisect () { · line 26

Quoted 8 lines
t/t6041-bisect-submodule.sh +1 -1
@@ -20,7 +20,7 @@ git_bisect () {
 	git bisect start &&
 	git bisect good $GOOD &&
 	rm -rf * &&
-	tar xzf "$TRASH_DIRECTORY/tmp.tgz" &&
+	tar xf "$TRASH_DIRECTORY/tmp.tar" &&
 	git status -su >actual &&
 	ls -1pR * >>actual &&
 	test_cmp expect actual &&

While I am fine with taking this (and the other) change, which are the only sensible response to these bug reports, this makes me wonder two things and a half.

* Why do we even run "tar", especially without having a test_when_finished clean-up? Can't there be better ways to test this and the other one without creating a copy of everything in the test directory?

* Are we sure the trash directory contents is kept manageable size? I am primarily worried about this "we are not sure what we will be clobbering, so let's blindly tar up everything and restore it later" pattern spreading and people mistakenly use it in tests that simulate our behaviour on a huge blob with a sparse but gigantic file.

* Is an addition of 'test_snapshot $tarball *' and 'test_restore $tarball' pair too much unnecessary refactoring to cater to only two users of this "let's tar up everything" pattern, given that we want to _discourage_ use of this pattern in the longer term?

#3 lore raw

+ cc Jens as he authored both t6041 as well as t3513 in the series leading to ad25da009e2a3730 (2014-07-21, Merge branch 'jl/submodule-tests')

Quoted 29 lines · Junio C Hamano
Quoted 14 lines · Stefan Beller
t/t6041-bisect-submodule.sh +1 -1
index c6b7aa6..62b8a2e 100755
@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'
 git_bisect () {
      git status -su >expect &&
      ls -1pR * >>expect &&
-     tar czf "$TRASH_DIRECTORY/tmp.tgz" * &&
+     tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
      GOOD=$(git rev-parse --verify HEAD) &&
      git checkout "$1" &&
      echo "foo" >bar &&

t/t6041-bisect-submodule.sh git_bisect () { · line 26

Quoted 8 lines
t/t6041-bisect-submodule.sh +1 -1
@@ -20,7 +20,7 @@ git_bisect () {
      git bisect start &&
      git bisect good $GOOD &&
      rm -rf * &&
-     tar xzf "$TRASH_DIRECTORY/tmp.tgz" &&
+     tar xf "$TRASH_DIRECTORY/tmp.tar" &&
      git status -su >actual &&
      ls -1pR * >>actual &&
      test_cmp expect actual &&

While I am fine with taking this (and the other) change, which are the only sensible response to these bug reports, this makes me wonder two things and a half.

Quoted 4 lines

* Why do we even run "tar", especially without having a test_when_finished clean-up? Can't there be better ways to test this and the other one without creating a copy of everything in the test directory?

I think some of the submodule testing is a test machinery on its own. Any submodule test that is not in t74* follows the pattern to provide a short function for its testing and then call test_submodule_switch with some long option, e.g. KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1

I haven't attempted to look into these tests yet as they seem to test fundamentals ("submodules as files" in other commands), whereas I am more interested in some new features currently.

Quoted 2 lines

* Are we sure the trash directory contents is kept manageable size?

The testing in lib-submodule-update.sh do not seem to take care of these tarballs. And the small testing scripts do not either, but there we could inject a

    test_when_finished "rm ..."

snippet IIUC.

Quoted 10 lines

I am primarily worried about this "we are not sure what we will be clobbering, so let's blindly tar up everything and restore it later" pattern spreading and people mistakenly use it in tests that simulate our behaviour on a huge blob with a sparse but gigantic file.

* Is an addition of 'test_snapshot $tarball *' and 'test_restore $tarball' pair too much unnecessary refactoring to cater to only two users of this "let's tar up everything" pattern, given that we want to _discourage_ use of this pattern in the longer term?

As said before, I did not yet dive into these test areas myself.

Quoted 1 line

From a birds eye, there was not a lot of discussion around that series

(as compared to submodule groups for example). Maybe I am missing prior or later series though.

http://thread.gmane.org/gmane.comp.version-control.git/251682

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html