mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
![Patrick Steinhardt](/assets/img/avatar_default.png)
The "check-chainlint" target runs automatically when running tests and
performs self-checks to verify that the chainlinter itself produces the
expected output. Originally, the chainlinter was implemented via sed,
but the infrastructure has been rewritten in fb41727b7e
(t: retire
unused chainlint.sed, 2022-09-01) to use a Perl script instead.
The rewrite caused some slight whitespace changes in the output that are
ultimately not of much importance. In order to be able to assert that
the actual chainlinter errors match our expectations we thus have to
ignore whitespace characters when diffing them. As the `-w` flag is not
in POSIX we try to use `git diff -w --no-index` before we fall back to
`diff -w -u`.
To accomodate for cases where the host system has no Git installation we
use the locally-compiled version of Git. This can result in problems
though when the Git project's repository is using extensions that the
locally-compiled version of Git doesn't understand. It will refuse to
run and thus cause the checks to fail.
Instead of improving the detection logic, fix our ".expect" files so
that we do not need any post-processing at all anymore. This allows us
to drop the `-w` flag when diffing so that we can always use diff(1)
now.
Note that we keep some of the post-processing of `chainlint.pl` output
intact to strip leading line numbers generated by the script. Having
these would cause a rippling effect whenever we add a new test that
sorts into the middle of existing tests and would require us to
renumerate all subsequent lines, which seems rather pointless.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
31 lines
331 B
Plaintext
31 lines
331 B
Plaintext
(
|
|
echo wobba \
|
|
gorgo snoot \
|
|
wafta snurb <<-EOF &&
|
|
quoth the raven,
|
|
nevermore...
|
|
EOF
|
|
|
|
cat <<EOF >bip ?!AMP?!
|
|
fish fly high
|
|
EOF
|
|
|
|
echo <<-\EOF >bop
|
|
gomez
|
|
morticia
|
|
wednesday
|
|
pugsly
|
|
EOF
|
|
) &&
|
|
(
|
|
cat <<-\ARBITRARY >bup &&
|
|
glink
|
|
FIZZ
|
|
ARBITRARY
|
|
cat <<-"ARBITRARY3" >bup3 &&
|
|
glink
|
|
FIZZ
|
|
ARBITRARY3
|
|
meep
|
|
)
|