sync: auto-sync from GURU-5070 at 2026-06-08 07:42:44
Author: Mike Swanson Machine: GURU-5070 Timestamp: 2026-06-08 07:42:44
This commit is contained in:
@@ -323,6 +323,18 @@ if [ -n "$(git status --porcelain)" ]; then
|
||||
purge_garbled_paths
|
||||
git add -A
|
||||
|
||||
# Submodule-safe staging (Task 1): `git add -A` stages submodule gitlink (pointer)
|
||||
# changes. The parent's pinned commit intentionally lags the submodule's main, so
|
||||
# auto-committing the pointer bumps a possibly-stale gitlink. Unstage every submodule
|
||||
# gitlink unless the operator opted in with --with-submodules. This eliminates the
|
||||
# manual "detach submodule to its pin before /save" dance.
|
||||
if [ "${ADVANCE_SUBMODULES:-0}" != "1" ] && [ -f ".gitmodules" ]; then
|
||||
while IFS= read -r sm_path; do
|
||||
[ -n "$sm_path" ] || continue
|
||||
git reset -q HEAD -- "$sm_path" 2>/dev/null || true
|
||||
done < <(git config --file .gitmodules --get-regexp '^submodule\..*\.path$' | awk '{print $2}')
|
||||
fi
|
||||
|
||||
# Commit message (Co-Authored-By uses local git user if configured)
|
||||
COMMIT_MSG="sync: auto-sync from $MACHINE at $TIMESTAMP
|
||||
|
||||
@@ -331,10 +343,19 @@ Machine: $MACHINE
|
||||
Timestamp: $TIMESTAMP"
|
||||
|
||||
if git diff-index --quiet --cached HEAD -- 2>/dev/null; then
|
||||
echo -e "${GREEN}[OK]${NC} No stageable changes (submodule internal changes skipped)."
|
||||
echo -e "${GREEN}[OK]${NC} No stageable changes (submodule pointer + internal changes skipped)."
|
||||
else
|
||||
git commit -m "$COMMIT_MSG"
|
||||
echo -e "${GREEN}[OK]${NC} Committed."
|
||||
# Harness guard (Task 4): WARN-ONLY during rollout — logs footguns (conflict
|
||||
# markers, unencrypted sops, private-key material) to .claude/harness/guard.log
|
||||
# but does NOT block unless HARNESS_GUARD_FATAL=1. SKIP_HARNESS_GUARD=1 bypasses.
|
||||
GUARD_RC=0
|
||||
bash .claude/scripts/harness-guard.sh || GUARD_RC=$?
|
||||
if [ "$GUARD_RC" != "0" ]; then
|
||||
echo -e "${YELLOW}[WARNING]${NC} harness-guard blocked the commit (HARNESS_GUARD_FATAL set). Staged changes left in place; set SKIP_HARNESS_GUARD=1 to override."
|
||||
else
|
||||
git commit -m "$COMMIT_MSG"
|
||||
echo -e "${GREEN}[OK]${NC} Committed."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo -e "${GREEN}[OK]${NC} No local changes to commit."
|
||||
|
||||
Reference in New Issue
Block a user