summaryrefslogtreecommitdiff
path: root/Biz/Ide/hooks/post-checkout.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/Ide/hooks/post-checkout.sh')
-rwxr-xr-xBiz/Ide/hooks/post-checkout.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/Biz/Ide/hooks/post-checkout.sh b/Biz/Ide/hooks/post-checkout.sh
new file mode 100755
index 0000000..e4a0d67
--- /dev/null
+++ b/Biz/Ide/hooks/post-checkout.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+set -e
+mktags=${CODEROOT:?}/Biz/Ide/mktags.sh
+old=$1
+new=$2
+# filter out only the changed haskell files
+mapfile -t changed < <(git diff --diff-filter=d --name-only "$old" "$new" -- '*.hs')
+if [[ ! -r tags ]] || [[ ! -r TAGS ]]
+then
+ $mktags "$CODEROOT"/**/*
+elif [[ ${#changed[@]} -gt 0 ]]
+then
+ $mktags "${changed[@]}"
+fi
+direnv reload
+## START BRANCHLESS CONFIG
+
+git branchless hook post-checkout "$@"
+## END BRANCHLESS CONFIG