docs(agents): a cherry-pick keeps its source's author, and the check is per own commit (improvise-1xfb.3)
The wrapper's contract drops cherry-pick, because git ignores GIT_AUTHOR_NAME there, and rule 8's cherry-pick -x should keep who wrote the commit. A new case asserts it. The pre-push check now asks that every commit you made names your actor, since a stacked or cherry-picked commit keeps its own author. Answers the Codex P2 and the review on PR #310. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
committed by
Edward Langley
parent
256057b7f8
commit
0539fb37ac
+1
-1
@@ -5,7 +5,7 @@ set -euo pipefail
|
||||
|
||||
if [ -z "${BEADS_ACTOR:-}" ]; then
|
||||
echo 'agent-git: BEADS_ACTOR is unset; refusing to author as the owner' >&2
|
||||
echo 'usage: BEADS_ACTOR=<actor> scripts/agent-git commit|merge|cherry-pick ...' >&2
|
||||
echo 'usage: BEADS_ACTOR=<actor> scripts/agent-git commit|merge ...' >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
@@ -50,6 +50,12 @@ BEADS_ACTOR=agent-a1 "$RUN" merge -q --no-edit side
|
||||
same "a merge commit is authored by the agent" 'Claude (agent-a1)' "$(git log -1 --format=%an)"
|
||||
same "the merge has two parents" 2 "$(git log -1 --format=%P | wc -w | tr -d ' ')"
|
||||
|
||||
# A cherry-pick keeps its source's author, whatever the wrapper sets.
|
||||
git checkout -q -b pick "$base"
|
||||
BEADS_ACTOR=agent-a1 "$RUN" cherry-pick -x --allow-empty "$(git rev-parse side)" > /dev/null 2>&1
|
||||
same "a cherry-pick keeps its source's author" 'Claude (agent-b2)' "$(git log -1 --format=%an)"
|
||||
git checkout -q -
|
||||
|
||||
# git's own failure is passed through, not swallowed.
|
||||
BEADS_ACTOR=agent-a1 "$RUN" commit -q -m nothing-staged > /dev/null 2>&1
|
||||
rc=$?
|
||||
|
||||
Reference in New Issue
Block a user