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

Re: [PATCH] tests: consolidate the `file_size` function into `test-lib-functions.sh`

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 7, 2020, 01:23 UTC
Message-ID
<20201107012345.GD6252@camp.crustytoothpaste.net>
In-Reply-To
<pull.780.git.1604711577662.gitgitgadget@gmail.com>
On 2020-11-07 at 01:12:57, Johannes Schindelin via GitGitGadget wrote:
Show 11 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> In 8de7eeb54b6 (compression: unify pack.compression configuration
> parsing, 2016-11-15), we introduced identical copies of the `file_size`
> helper into three test scripts, with the plan to eventually consolidate
> them into a single copy.
> 
> Let's do that, and adjust the function name to adhere to the `test_*`
> naming convention.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

This seems reasonable. For a moment, I was going to ask why we didn't just use test -s, but then I remembered that test -s doesn't have that behavior, Perl's -s does, and you replaced that with the helper for efficiency on Windows.

I looked at the patch and it seemed pretty straightforward.
Show 6 quoted lines
>     tests: consolidate the file_size function into test-lib-functions.sh
> 
>     My ulterior motive with this patch is not even to address that old
>     concern, but to avoid having to exclude the code comments from the
>     upcoming master -> main rename (because those code comments talk about
>     git/git's main branch, which is called master).
Also a good reason.  Why modify code when you can just delete it?
-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: Johannes Schindelin via GitGitGadget
Message 2 of 2 in “tests: consolidate the `file_size` function into `test-lib-functions.sh`”
  1. tests: consolidate the `file_size` function into `test-lib-functions.sh`Johannes Schindelin via GitGitGadget, Nov 7, 2020
  2. brian m. carlsonNov 7, 2020

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.