Thread (1 message) 1 message, 1 author, 2022-03-02

Re: [PATCH 04/10] bugreport tests: tighten up "git bugreport -s hooks" test

From: Junio C Hamano <hidden>
Date: 2022-03-02 21:23:05

Ævar Arnfjörð Bjarmason  [off-list ref] writes:
+	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help