summaryrefslogtreecommitdiff
path: root/Biz/Ide/hooks/post-checkout
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-02-09 18:13:40 -0500
committerBen Sima <ben@bsima.me>2022-02-09 18:16:26 -0500
commitf664669439c0f005e3579d1c67b4ebd9fa24de36 (patch)
treeb2eadfc5ad5aab3452285da6c23e4f601fcdd334 /Biz/Ide/hooks/post-checkout
parentf21e2920872fdf3c92dc815d51d6da032d157fea (diff)
Move git hooks to own folder
Instead of symlinking, just set the local git config.
Diffstat (limited to 'Biz/Ide/hooks/post-checkout')
-rwxr-xr-xBiz/Ide/hooks/post-checkout14
1 files changed, 14 insertions, 0 deletions
diff --git a/Biz/Ide/hooks/post-checkout b/Biz/Ide/hooks/post-checkout
new file mode 100755
index 0000000..95b35cd
--- /dev/null
+++ b/Biz/Ide/hooks/post-checkout
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+set -e
+init_tags=$BIZ_ROOT/Biz/Ide/init_tags.sh
+old=$1
+new=$2
+# filter out only the changed haskell files
+changed=($(git diff --diff-filter=d --name-only $old $new -- '*.hs'))
+if [[ ! -r tags ]]
+then
+ $init_tags
+elif [[ ${#changed[@]} -gt 0 ]]
+then
+ $init_tags $changed
+fi