Re: [GSoC][PATCH] t/t5000-tar-tree: add helper function
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 2, 2023, 23:19 UTC
- Message-ID
- <CAPig+cR+1bxgitSmJ47PxD=CPxJjMh5Vm+zRdVU8iEo9pvtutw@mail.gmail.com>
- In-Reply-To
- <CAPig+cTC4TUK2NXFmP6ymEYYjYAmCSd53dzFhKn0ido8x6uh1Q@mail.gmail.com>
On Thu, Feb 2, 2023 at 6:09 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> So, t5000 seems to be one of those relatively rare cases in which the > raw "test" command is more correct than the higher-level helper > functions.
By the way, although the change made by this patch is probably undesirable, if you would like to try a different submission, there is a bit of modernization that could be applied to t5000. In particular, the "archive and :(glob)" test does not match present-day style guidelines:
git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
cat >expect <<EOF &&
a/
a/bin/
a/bin/sh
EOF
test_cmp expect actualThese days, we would use `<<-EOF` rather than `<<EOF` to allow the here-doc body to be indented to the same depth as the `cat` command itself. Furthermore, we would use `\EOF` to indicate to the reader that no interpolation is expected within the body. Taken together, the final result would be:
git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
cat >expect <<-\EOF &&
a/
a/bin/
a/bin/sh
EOF
test_cmp expect actualBoth cleanups can be done via a single patch; the commit message should mention both modernizations.