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