Conversation
…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. (cherry picked from commit 5b673ec)
…included sign-branch.sh only looked at origin, so it could not sign a PR whose branch lives on a contributor's fork. It now also takes a PR number, #number or PR URL (needs gh): the head and base are resolved from the PR and fetched and pushed by URL, in origin's protocol, which works for a fork when the PR allows maintainer edits. --pr with no number picks from the ten most recently updated open PRs, the way no branch picks from recent branches. Everything after locating the branch is unchanged, except the push lease now names the full ref, since a URL has no remote-tracking ref for a short name.
This was referenced Sep 28, 2026
- Refuse a same-repo PR whose head is that repo's default branch (main into a release branch, say): branch mode already refused origin's default, but PR mode only compared the head to the base, which never matches. - --branch forces branch mode, for a branch whose name is all digits. - Build head/base URLs on the PR's host rather than github.com. - Read the PR fields unit-separated: tab is IFS whitespace, so an empty field shifted every later one. Die clearly when the head repo is gone. - --no-push only writes a local ref, so it no longer asks to force-push. - The PR picker shows owner:branch; $default is now $base_branch, since in PR mode it is the base branch, not a default branch.
Under bash 3.2 in a non-UTF-8 locale the first byte of "…" was read as part of the variable name, so "fetching $where…" died with an unbound variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits:
fix: keep the original author when a
Co-authored-byalready exists (was fix(scripts): keep the original author when a Co-authored-by already exists #42). The trailer was added withgit interpret-trailers --if-exists doNothing, and--if-existsmatches on the key alone, so any existingCo-authored-by(an agent's, the usual case here) dropped the original author from the rebuilt commit. NowaddIfDifferent, which still skips an exact duplicate.feat: sign a pull request, fork branches included (replaces feat(scripts): add sign-pr.sh to sign a PR by number, fork branches included #43, which added a separate
sign-pr.sh).sign-branch.shonly looked atorigin, so it could not sign a PR whose branch lives on a contributor's fork, e.g. fix(replicache): run a SQLite commit's statements one at a time mono#6683. It now also accepts:sign-branch.sh 6683,#6683, or the PR URL (needsgh). The head and base are resolved from the PR and fetched and pushed by URL, in origin's protocol; a fork works when the PR allows maintainer edits. Closed PRs and forks without maintainer edits are refused.sign-branch.sh --prwith no number: arrow-key picker over the ten most recently updated open PRs, like the existing branch picker.Everything after locating the branch is unchanged, except the push lease now names the full ref (
refs/heads/<branch>:<sha>), since a URL has no remote-tracking ref for a short name to resolve against. Suggested aliases are in the header, includingalias.sign-pr = !…/sign-branch.sh --pr.Dry runs (
--yes --no-push) from a mono checkout:#numberand URL: rebuildspawarren/mono:fix/send-client-schema-on-config-only-cookie, push command targets the fork URLgrgbkr/run-buffering-fallback): rebuilds both commits, as beforearv/mono-ci-commit-script): "already authored and signed by you"123,#123, pull URLs are PRs;arv/foo,12a3,1#2are branchesThe picker's key handling is the existing
menu(), unchanged; the PR list query was checked separately.