Repository navigation
Merge niceties: strip agent co-authors, Open revert PR (#1531) - #1537
Conversation
…rge (#1531) New setting stripAgentCoauthors (default off, Settings > Git). When on, squash merges via gh (thread PR merge and the PR workspace merge) pass a --body rebuilt from the PR commits with Co-authored-by lines that name an AI agent removed; human co-authors stay. Matching lives in the pure electron/coauthors.js helper. The local thread merge already commits with a fixed -m message, so it never carried trailers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Agents panel shows "Open revert PR" once a thread PR is MERGED. git:prRevert (electron/revertPr.js) branches revert-pr-N off the latest origin/<base> in a temp worktree, reverts the merge commit (-m 1 for a true merge, plain revert for a squash/rebase commit, picked by parent count), pushes, and opens Revert "<title>" via gh pr create, referencing the original PR. On any failure (conflict, push, gh) it removes the temp worktree, the local branch and the pushed branch, and reports the reason in-band. The user checkout is never touched. The new PR URL opens in the browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 951844b824
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const isMerge = parents.stdout.trim().split(/\s+/).length > 2; | ||
| const reverted = await gitTryAsync( | ||
| wt, | ||
| isMerge ? ["revert", "--no-edit", "-m", "1", sha] : ["revert", "--no-edit", sha], |
There was a problem hiding this comment.
Revert every commit from a rebase merge
When a PR containing multiple commits was merged with GitHub's rebase method, mergeCommit.oid identifies only the resulting tip commit, while rebase merging adds every PR commit to the base individually (GitHub documentation). This git revert therefore undoes only the last rebased commit, yet opens a PR claiming to revert the entire PR and leaves all earlier changes in place. Revert the full PR commit set or its combined patch instead of only this SHA.
Useful? React with 👍 / 👎.
| const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "solenta-revert-")); | ||
| const wt = path.join(tmp, "wt"); |
There was a problem hiding this comment.
Create the temporary worktree inside WSL
On Windows when project.path is a supported WSL UNC path, gitTryAsync launches Git inside the distro, but this worktree path comes from the Windows host's os.tmpdir(). The resolver in electron/worktrees-git.js only translates arguments that are themselves WSL UNC paths, so git worktree add receives a Windows path that is not the same location inside WSL and subsequent commands cannot operate on the created worktree. Allocate the temporary directory within the distro and retain a corresponding UNC path, as the existing WSL worktree helpers do.
Useful? React with 👍 / 👎.
Part of #1531.
Strip agent co-authors (setting
stripAgentCoauthors, off by default; in the Git settings pane)gh pr mergedropsCo-authored-by:trailers that name an AI agent:[bot]accounts, noreply or agent-named mailboxes at agent vendors, and agent-named noreply addresses. Human co-authors are kept.Open revert PR
origin/<base>, using-m 1for true merge commits. It then pushesrevert-pr-<N>, opensRevert "<title>"and opens the new PR's URL.Tests are in
electron/test/coauthors.test.jsandelectron/test/revert-pr.test.js(temp repo,ghstubbed), plustest/environmentCards.test.tsx.Note: this PR and the Misc PR (custom model prices) both add a setting on the same lines of
electron/test/budget-spend.test.js, so whichever lands second needs a small rebase.🤖 Generated with Claude Code