You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(strip): make strip_for_main.sh work mid-merge + align safety lists
Two issues surfaced when attempting Task 28 (develop → main strip
merge) of the M-sec plan:
1. strip_for_main.sh could never actually run the documented flow.
The header comment said:
git merge develop --no-commit
./scripts/strip_for_main.sh
git add -A && git commit
But the script's dirty-tree guard (git diff --quiet HEAD) refused
to run on the dirty post-merge tree, so step 2 always aborted.
Fix: detect mid-merge state via $GIT_DIR/MERGE_HEAD presence.
When IN_MERGE=1, skip the dirty-tree guard (the dirty tree is
expected) and have strip_path use 'git rm -rf --ignore-unmatch'
so modify/delete conflicts are resolved (deleted AND staged) in
a single step. Outside a merge, the guard still fires — stripping
on top of unrelated edits would mix commits.
Critical invariant preserved: the 'refuses to run on develop'
guard still fires no matter what mode or merge state. develop
is the source of dev artifacts; the script must never touch it.
2. Two defense layers had drifted:
- strip_for_main.sh had 'adr', .githooks/pre-commit didn't
- neither had '.vscode' (editor settings, Snyk IDE prefs etc.)
Both lists now agree: 12 strip paths in each. Added an explicit
comment in pre-commit telling future editors to keep both in sync.
Verified locally:
- go build ./cmd/broker ./cmd/aactl: OK
- go test -short ./...: 15/15 packages PASS
- golangci-lint run ./...: clean
- ./scripts/strip_for_main.sh --dry-run (from develop): 12 paths
listed including new .vscode entry
0 commit comments