]> git.ekhem.eu.org Git - guix.git/commitdiff
[hooks] Allow git push from main project after merge.
authorJakub Czajka <jakub@ekhem.eu.org>
Mon, 20 Jul 2026 15:54:18 +0000 (15:54 +0000)
committerJakub Czajka <jakub@ekhem.eu.org>
Fri, 24 Jul 2026 09:12:32 +0000 (09:12 +0000)
.claude/hooks/create-worktree

index 06cefb7c3755f3298320404f604183e7a98c5957..fc47c70411ab76245972ccdf393fcb58c7624719 100755 (executable)
@@ -16,6 +16,17 @@ then
     exit 0
 fi
 
+# Exempt git push (needed from main project after merge).
+if echo "$stdin" \
+    | grep -q '"tool_name"[[:space:]]*:[[:space:]]*"Bash"'
+then
+    cmd=$(echo "$stdin" \
+        | sed -n 's/.*"command"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
+    case "$cmd" in
+        "git push"*) exit 0 ;;
+    esac
+fi
+
 # Deny if not in this session's worktree.
 if ! echo "$PWD" | grep -q "/worktrees/${CLAUDE_CODE_SESSION_ID}"
 then