git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t6041: do not compress backup tar file

From
Junio C Hamano <gitster@pobox.com>
Date
May 9, 2016, 18:46 UTC
Message-ID
<xmqq8tzjul0p.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1462813748-27538-1-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 22 quoted lines
> diff --git a/t/t6041-bisect-submodule.sh b/t/t6041-bisect-submodule.sh
> index c6b7aa6..62b8a2e 100755
> --- a/t/t6041-bisect-submodule.sh
> +++ b/t/t6041-bisect-submodule.sh
> @@ -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 &&

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?
Previous: Armin KunaschikNext: Stefan Beller
Message 3 of 4 in “t6041: do not compress backup tar file”
  1. t6041: do not compress backup tar fileStefan Beller, May 9, 2016
  2. Armin KunaschikMay 9, 2016
  3. Junio C HamanoMay 9, 2016
  4. Stefan BellerMay 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.