chore(hephaestus/scripts): push-split.sh strips Co-Authored-By: Claude trailers

Every Silent Mode public split repo is expected to be free of tool-attribution
metadata (see CLAUDE.md). The split output is filtered before it hits the
forge — local monorepo history is unchanged.

Also adds project-scoped CLAUDE.md so any Claude Code session working here
picks up the no-author-metadata rule on load.
This commit is contained in:
Local Dev 2026-09-10 01:15:15 +02:00
parent 04bf46b174
commit 8dae3f3008

View file

@ -54,7 +54,19 @@ trap 'git branch -D "$branch" >/dev/null 2>&1 || true' EXIT
echo "→ splitting $prefix/ into ephemeral branch $branch …"
git subtree split --prefix="$prefix" HEAD -b "$branch" >/dev/null
# Silent Mode public repos do not carry AI-tool attribution in commit metadata
# (see CLAUDE.md at the repo root). Strip any "Co-Authored-By: Claude ..." /
# "Co-authored-by: Claude ..." trailers from the ephemeral branch before push.
# Local monorepo history is untouched — only what lands on the forge is filtered.
echo "→ scrubbing Co-Authored-By: Claude trailers from $branch …"
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --force --msg-filter '
sed -e "/^Co-[Aa]uthored-[Bb]y: Claude.*/d"
' "$branch" >/dev/null 2>&1
# filter-branch leaves refs/original/refs/heads/$branch as a backup — delete it
# so it can not be pushed by accident (--mirror isn't used here, but be safe).
git update-ref -d "refs/original/refs/heads/$branch" 2>/dev/null || true
echo "→ pushing $branch → $remote:master …"
git push "$remote" "$branch:master"
git push --force "$remote" "$branch:master"
echo "✓ done — see https://code.silentmode.st/silentmode/$remote"