Skip to content

fix(scripts): keep the original author when a Co-authored-by already exists - #42

Closed
arv wants to merge 1 commit into
mainfrom
arv/sign-branch-keep-coauthor
Closed

arv wants to merge 1 commit into
mainfrom
arv/sign-branch-keep-coauthor

Conversation

@arv

@arv arv commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

sign-branch.sh adds the original author as a Co-authored-by: trailer with git interpret-trailers --if-exists doNothing. --if-exists matches on the trailer key alone, so when the commit message already has any Co-authored-by (an agent's, which is the common case for the commits this script exists to re-sign), the new trailer is skipped and the original author disappears from the rebuilt commit.

Switches to --if-exists addIfDifferent, which still skips an exact duplicate.

Checked with git interpret-trailers on a message that already carries Co-Authored-By: Claude <…>:

  • doNothing: only the Claude trailer remains
  • addIfDifferent: Claude trailer plus Co-authored-by: Paul Warren <…>
  • addIfDifferent with the same trailer already present: no duplicate

Found while signing rocicorp/mono#6683.

…exists

sign-branch.sh added the original author as a Co-authored-by trailer with
`git interpret-trailers --if-exists doNothing`. --if-exists matches on the
trailer key alone, so any existing Co-authored-by (an agent's, for example)
made it skip the new one and the original author was dropped from the
rebuilt commit. addIfDifferent still skips an exact duplicate.
@arv

arv commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #44.

@arv arv closed this Sep 28, 2026
auto-merge was automatically disabled September 28, 2026 15:00

Pull request was closed

@arv
arv deleted the arv/sign-branch-keep-coauthor branch September 28, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant