Skip to content

Commit 8d10d30

Browse files
committed
docs: add pre-push checks for gpgsig and Claude committer identity
1 parent 76bf9df commit 8d10d30

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,26 @@ Fix any errors or warnings reported before proceeding with the commit.
2525
> `libdevmapper`, etc.) that may not be present in all dev environments. If they fail
2626
> solely due to missing system dependencies (not code errors), the CI pipeline will
2727
> serve as the authoritative check. `cargo fmt --check` must always pass locally.
28+
29+
## Pre-Push Checks
30+
31+
Before pushing, verify that no commits in the push carry a gpgsig header or a Claude committer identity:
32+
33+
```bash
34+
for sha in $(git log --format="%H" origin/$(git rev-parse --abbrev-ref HEAD)..HEAD 2>/dev/null); do
35+
git cat-file -p "$sha" | grep -q "^gpgsig" && echo "ERROR: commit $sha has gpgsig — rewrite with filter-branch before pushing" && exit 1
36+
git log -1 --format="%ce" "$sha" | grep -qi "anthropic" && echo "ERROR: commit $sha has Claude committer — rewrite with filter-branch before pushing" && exit 1
37+
done
38+
echo "Pre-push checks passed"
39+
```
40+
41+
If any commit fails, rewrite the committer with:
42+
43+
```bash
44+
git filter-branch -f --env-filter '
45+
if [ "$GIT_COMMITTER_EMAIL" = "noreply@anthropic.com" ]; then
46+
export GIT_COMMITTER_NAME="$(git config user.name)"
47+
export GIT_COMMITTER_EMAIL="$(git config user.email)"
48+
fi
49+
' <base-commit>..HEAD
50+
```

0 commit comments

Comments
 (0)