From dfa1763e5e9132179cd57dff3b9ec05e83f15760 Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Thu, 2 Apr 2026 09:56:17 +0000 Subject: [PATCH] I author, agents generate code --- .gitignore | 1 + scripts/strip-coauthor.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 scripts/strip-coauthor.sh diff --git a/.gitignore b/.gitignore index 0d7e2ec..d6df0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # Dokku setup (may contain secrets) dokku-setup.sh /output/ +.claude/worktrees diff --git a/scripts/strip-coauthor.sh b/scripts/strip-coauthor.sh new file mode 100755 index 0000000..086d845 --- /dev/null +++ b/scripts/strip-coauthor.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Strip Co-Authored-By trailer lines from unpushed commits +# +# Usage: ./scripts/strip-coauthor.sh [base-ref] +# base-ref defaults to origin/main + +set -euo pipefail + +BASE="${1:-origin/main}" + +count=$(git log --grep="Co-Authored-By" --oneline "$BASE..HEAD" | wc -l) +if [ "$count" -eq 0 ]; then + echo "No commits with Co-Authored-By found in $BASE..HEAD" + exit 0 +fi + +echo "Rewriting $count commit(s) to strip Co-Authored-By lines..." + +git filter-branch -f --msg-filter ' + sed "/^Co-Authored-By:.*$/d" | sed -e :a -e "/^\n*$/{$d;N;ba;}" +' "$BASE..HEAD" + +remaining=$(git log --grep="Co-Authored-By" --oneline "$BASE..HEAD" | wc -l) +if [ "$remaining" -eq 0 ]; then + echo "Done. All Co-Authored-By lines removed." +else + echo "WARNING: $remaining commit(s) still contain Co-Authored-By lines." + exit 1 +fi