BurningTimesAi/scripts/git-hooks/post-commit

22 lines
873 B
Bash

#!/bin/bash
# post-commit — commit 직후 sync_signal.sh update 자동 호출
#
# 목적 (2026-04-17 PD님 직접 지시 반영):
# "작업 완료 시 공유 문서 즉시 반영 + 시그널로 알림. push는 필요 시만."
# commit = "의미 있는 작업 완료" 단위이므로 commit 시점에 시그널 갱신하여
# 같은 PC 내 다른 세션이 다음 프롬프트에서 즉시 감지할 수 있도록 함.
#
# 설치 (자동): SessionStart hook이 `git config core.hooksPath scripts/git-hooks`
# 설정하므로 레포 clone 즉시 활성화.
#
# push와 무관 — commit만 해도 시그널 갱신됨. push는 PD님 지시·필요 시에만.
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
[ -z "$REPO_ROOT" ] && exit 0
SCRIPT="$REPO_ROOT/scripts/sync_signal.sh"
[ -x "$SCRIPT" ] || [ -f "$SCRIPT" ] || exit 0
bash "$SCRIPT" update
exit 0