Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily Shaffer <emilyshaffer@google.com>2020-05-08 03:53:57 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-08 04:25:04 +0300
commit788a776069bffcbb7d0dd9b70d521826f97285b7 (patch)
tree556b2c3461ec7e58ab527bd2708cd46957fa90d8 /t/t0091-bugreport.sh
parent8f0e9843bdf82b04591416367bee3817991e0722 (diff)
bugreport: collect list of populated hooks
Occasionally a failure a user is seeing may be related to a specific hook which is being run, perhaps without the user realizing. While the contents of hooks can be sensitive - containing user data or process information specific to the user's organization - simply knowing that a hook is being run at a certain stage can help us to understand whether something is going wrong. Without a definitive list of hook names within the code, we compile our own list from the documentation. This is likely prone to bitrot, but designing a single source of truth for acceptable hooks is too much overhead for this small change to the bugreport tool. Signed-off-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0091-bugreport.sh')
-rwxr-xr-xt/t0091-bugreport.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t0091-bugreport.sh b/t/t0091-bugreport.sh
index 2e73658a5c..526304ff95 100755
--- a/t/t0091-bugreport.sh
+++ b/t/t0091-bugreport.sh
@@ -57,5 +57,20 @@ test_expect_success 'can create leading directories outside of a git dir' '
nongit git bugreport -o foo/bar/baz
'
+test_expect_success 'indicates populated hooks' '
+ test_when_finished rm git-bugreport-hooks.txt &&
+ test_when_finished rm -fr .git/hooks &&
+ rm -fr .git/hooks &&
+ mkdir .git/hooks &&
+ for hook in applypatch-msg prepare-commit-msg.sample
+ do
+ write_script ".git/hooks/$hook" <<-EOF || return 1
+ echo "hook $hook exists"
+ EOF
+ done &&
+ git bugreport -s hooks &&
+ grep applypatch-msg git-bugreport-hooks.txt &&
+ ! grep prepare-commit-msg git-bugreport-hooks.txt
+'
test_done