Re: [PATCH 04/10] bugreport tests: tighten up "git bugreport -s hooks" test
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 2, 2022, 21:22 UTC
- Message-ID
- <xmqqzgm8hwwc.fsf@gitster.g>
- In-Reply-To
- <patch-04.10-1da2efc9886-20220302T131859Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 13 quoted lines
> + write_script .git/hooks/applypatch-msg <<-\EOF && > + true > + EOF > + write_script .git/hooks/unknown-hook <<-\EOF && > + true > + EOF > git bugreport -s hooks && > + > grep applypatch-msg git-bugreport-hooks.txt && > - ! grep prepare-commit-msg git-bugreport-hooks.txt > + ! grep unknown-hook git-bugreport-hooks.txt && > + ! grep -F .sample git-bugreport-hooks.txt > '
The above is not wrong per-se, but because we control which hooks are and are not visible to "git bugreport" we run in this test, I wonder if we should do
git bugreport -s tmp && sed -ne '/^\[Enabled Hooks\]$/,/^$/p' git-bugreport-tmp.txt | sort >actual && sort >expect <<-\EOF && [Enabled Hooks] applypatch-msg EOF test_cmp expect actual
instead. It is not like checking the "git help -a" output for list of commands, which may grow or shrink as the system evolves.