Re: [PATCH 3/4] test-lib-functions: add helper for trailing hash
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Dec 12, 2022, 14:10 UTC
- Message-ID
- <95b8bca3-51fc-7cbc-aa06-5de8b01e7021@github.com>
- In-Reply-To
- <221207.86zgby97bk.gmgdl@evledraar.gmail.com>
On 12/7/2022 5:27 PM, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
>
> On Wed, Dec 07 2022, Derrick Stolee via GitGitGadget wrote:
>
>> From: Derrick Stolee <derrickstolee@github.com>
>> [...]
>> +# Given a filename, extract its trailing hash as a hex string
>> +test_trailing_hash () {
>> + local file="$1" &&
>> + tail -c $(test_oid rawsz) "$file" | \
>> + test-tool hexdump | \
>
> You don't need the "\"'s here.Thanks.
Show 5 quoted lines
>> + sed "s/ //g" >> +} > > At the end of this series we have one test file using this > test_trailing_hash, can't we just add it to t1600-index.sh?
I imagine that it would be helpful to access the trailing hash for testing other file formats in the future. It certainly could have helped the incremental commit-graph work, so we could check that the filenames do match the trailing hashes.
Thanks, -Stolee