[nexus] chore(01-02): install commit-msg hook and enable git rerere
- Add scripts/nexus-commit-msg-hook.sh (tracked source for hook) - Install hook at .git/hooks/commit-msg (executable) - Enable git rerere with autoupdate for automated conflict re-resolution
This commit is contained in:
parent
3e7848ede3
commit
f52e5eda55
1 changed files with 23 additions and 0 deletions
23
scripts/nexus-commit-msg-hook.sh
Executable file
23
scripts/nexus-commit-msg-hook.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
# Nexus fork: enforce [nexus] prefix on all fork commits
|
||||
# Allows upstream merge commits and rebase-generated commits through
|
||||
MSG_FILE="$1"
|
||||
FIRST_LINE=$(head -1 "$MSG_FILE")
|
||||
|
||||
# Skip merge commits (git generates these automatically during rebase/merge)
|
||||
if echo "$FIRST_LINE" | grep -qE "^Merge (branch|pull request|remote-tracking)"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Skip fixup/squash commits (used during interactive rebase)
|
||||
if echo "$FIRST_LINE" | grep -qE "^(fixup|squash)!"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Enforce [nexus] prefix
|
||||
if ! echo "$FIRST_LINE" | grep -qE "^\[nexus\]"; then
|
||||
echo "ERROR: Commit message must start with [nexus]"
|
||||
echo " Got: $FIRST_LINE"
|
||||
echo " Example: [nexus] feat: add branding package"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue