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

Re: [PATCH 1/1] t5319: use 'test-tool path-utils' instead of 'ls -l'

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 2, 2019, 12:06 UTC
Message-ID
<nycvar.QRO.7.76.6.1907021202000.48@tvgsbejvaqbjf.bet>
In-Reply-To
<fec75453eb3e4c286f84c538c142c3da02f75826.1561986978.git.gitgitgadget@gmail.com>
Hi Stolee,
On Mon, 1 Jul 2019, Derrick Stolee via GitGitGadget wrote:
Show 6 quoted lines
> From: Derrick Stolee <dstolee@microsoft.com>
>
> Using 'ls -l' and parsing the columns to find file sizes is
> problematic when the platform could report the owner as a name
> with spaces. Instead, use the 'test-tool path-utils file-size'
> command to list only the sizes.
Thank you!
Show 10 quoted lines
> diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
> index 79bfaeafa9..c72ca04399 100755
> --- a/t/t5319-multi-pack-index.sh
> +++ b/t/t5319-multi-pack-index.sh
> @@ -443,7 +443,7 @@ test_expect_success 'repack with minimum size does not alter existing packs' '
>  		touch -m -t 201901010002 .git/objects/pack/pack-B* &&
>  		touch -m -t 201901010003 .git/objects/pack/pack-A* &&
>  		ls .git/objects/pack >expect &&
> -		MINSIZE=$(ls -l .git/objects/pack/*pack | awk "{print \$5;}" | sort -n | head -n 1) &&
> +		MINSIZE=$(test-tool path-utils file-size .git/objects/pack/*pack | sort -n | head -n 1) &&
You know, we could also add a `--show-minimum` option...
Show 6 quoted lines
> @@ -455,7 +455,7 @@ test_expect_success 'repack creates a new pack' '
>  		cd dup &&
>  		ls .git/objects/pack/*idx >idx-list &&
>  		test_line_count = 5 idx-list &&
> -		THIRD_SMALLEST_SIZE=$(ls -l .git/objects/pack/*pack | awk "{print \$5;}" | sort -n | head -n 3 | tail -n 1) &&
> +		THIRD_SMALLEST_SIZE=$(test-tool path-utils file-size .git/objects/pack/*pack | sort -n | head -n 3 | tail -n 1) &&
I guess the `--show-minimum` option is no longer such a smart idea ;-)

Patch looks good, thanks for working on this, Dscho

Show 6 quoted lines
>  		BATCH_SIZE=$(($THIRD_SMALLEST_SIZE + 1)) &&
>  		git multi-pack-index repack --batch-size=$BATCH_SIZE &&
>  		ls .git/objects/pack/*idx >idx-list &&
> --
> gitgitgadget
>
Previous: Derrick Stolee via GitGitGadgetNext: Junio C Hamano
Message 3 of 4 in “Fix test bug with spaces in file owner”
  1. 0/1 Fix test bug with spaces in file ownerDerrick Stolee via GitGitGadget, Jul 1, 2019
  2. 1/1 t5319: use 'test-tool path-utils' instead of 'ls -l'Derrick Stolee via GitGitGadget, Jul 1, 2019
  3. Johannes SchindelinJul 2, 2019
  4. Junio C HamanoJul 2, 2019

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.