mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-26 19:12:12 -04:00
Add a "Resolving Conflicts in GitHub PRs" section to AGENTS.md with step-by-step instructions for force-fetching refs, rebasing, resolving lockfile conflicts, and verifying mergeability. Add shell/resolve-pr-conflicts.sh that automates the workflow: fetches metadata, force-updates the base ref, rebases, auto-resolves lockfile conflicts via pnpm install, force-pushes, and verifies the result.
28 lines
1.7 KiB
Fish
28 lines
1.7 KiB
Fish
# Worktree helper for fish.
|
|
# Add to your shell config:
|
|
# source /path/to/pnpm/shell/wt.fish
|
|
#
|
|
# Usage:
|
|
# wt <branch-name> — create a worktree for a branch and switch to it
|
|
# wt <pr-number> — create a worktree for a GitHub PR and switch to it
|
|
function wt
|
|
set -l dir (pnpm worktree:new $argv | tail -1)
|
|
or return 1
|
|
test -n "$dir" -a -d "$dir"; or return 1
|
|
cd $dir
|
|
|
|
# If the argument looks like a PR number, auto-start Claude to review it
|
|
if test (count $argv) -ge 1; and string match -qr '^\d+$' -- $argv[1]
|
|
set -l pr_number $argv[1]
|
|
claude --dangerously-skip-permissions "Review and fix PR #$pr_number. Steps:
|
|
1. Use gh to read the PR description, diff, and all review comments (both PR-level and inline).
|
|
2. Understand the intent of the PR and what each change does.
|
|
3. Resolve any conflicts with the base branch by running './shell/resolve-pr-conflicts.sh $pr_number'. This force-fetches the base branch (avoiding stale refs), rebases, and auto-resolves lockfile conflicts. If it prints MANUAL_RESOLUTION_NEEDED, read the listed conflicted files, resolve the conflict markers, run 'git add' on each resolved file, then run './shell/resolve-pr-conflicts.sh $pr_number --continue' to finish the rebase and push. Do NOT skip this step. Do NOT assume the branch is up to date.
|
|
4. Address every review comment — fix the code as requested or as appropriate.
|
|
5. Look for any other bugs, issues, or style problems in the changed code and fix those too.
|
|
6. Run the relevant tests to verify your fixes work (check CLAUDE.md for how to run tests).
|
|
7. Give me a summary of what you found and what you changed, including any conflicts you resolved.
|
|
Do NOT push. Leave all non-merge changes unstaged for me to review."
|
|
end
|
|
end
|