Re: Runaway sed memory use in test on older sed+glibc (was "Re: [PATCH v6 1/3] test: add helper functions for git-bundle")
- From
Jeff King <peff@peff.net>
- Date
- May 27, 2021, 13:48 UTC
- Message-ID
- <YK+jGxlHHZ63o94N@coredump.intra.peff.net>
- In-Reply-To
- <87tumol4tg.fsf@evledraar.gmail.com>
On Thu, May 27, 2021 at 02:19:04PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 10 quoted lines
> Anyway, looking at this whole test file with fresh eyes this pattern > seems very strange. You duplicated most of test_commit with this > test_commit_setvar. It's a bit more verbosity but why not just use: > > test_commit ... > A=$(git rev-parse HEAD) > > Or teach test_commit a --rev-parse option or something and: > > A=$(test_commit ...)
The latter would be nice (and maybe even could be the default, as the stdout is usually just going to --verbose output anyway). But I don't think it works, because the $() is a subshell, so we lose the side effect of test_tick incrementing the timestamp counter.
I wasn't following this thread carefully, but your suggestion to just do "A=$(git rev-parse HEAD)" seems quite readable to me.
-Peff