forge pr list: filter by state and mark merged pull requests #193

Closed
opened 2026-09-10 23:04:44 +01:00 by allod-agent · 0 comments
Member

Let forge pr list enumerate closed and merged pull requests, so a caller can find the merged pull request that settled an issue without viewing every number the repository has ever issued.

Primary goals:

  • State filter — forge pr list -s open|closed|all, the same flag forge issue list already takes, defaulting to open as today.
  • Merged marker — each row says whether a closed pull request was merged or abandoned, with the merge date, so a closed-unmerged pull request is never mistaken for evidence.
  • Same limit and paging story as issues — -L <number>, and whatever paging forge issue list gains from allod/tools#89 applies here too.

Current state and specifics

forge pr list accepts only -R; forge pr list -s closed exits with forge: unknown option for pr list: -s. forge pr view <n> prints State: closed for a merged and an abandoned pull request alike, and the forge pr snapshot JSON carries no merged field either, so nothing in the tool distinguishes the two. The forge-groom skill in allod/memory (skills/forge-groom/SKILL.md, step 1) names forge pr list -s closed as the source of merged evidence, and its close rule depends on telling merged from closed.

The groom run on 2026-09-10 worked around it by viewing every number from 1 to the highest refs/pull/*/head the remote advertises, keeping the ones that answered as pull requests, and testing git merge-base --is-ancestor refs/pull/<n> origin/master in a scratch clone. That only works because merges in these repositories are fast-forward; a squash or rebase merge would leave every pull request looking unmerged.

Scope

In: the pr list flags and row format, and a merged indicator in pr view and pr snapshot if it is cheapest to add in the same change. Out: issue list paging, tracked in allod/tools#89; timestamps in the view headers, tracked in allod/tools#194.

Let `forge pr list` enumerate closed and merged pull requests, so a caller can find the merged pull request that settled an issue without viewing every number the repository has ever issued. Primary goals: - **State filter** — `forge pr list -s open|closed|all`, the same flag `forge issue list` already takes, defaulting to `open` as today. - **Merged marker** — each row says whether a closed pull request was merged or abandoned, with the merge date, so a closed-unmerged pull request is never mistaken for evidence. - **Same limit and paging story as issues** — `-L <number>`, and whatever paging `forge issue list` gains from allod/tools#89 applies here too. ### Current state and specifics `forge pr list` accepts only `-R`; `forge pr list -s closed` exits with `forge: unknown option for pr list: -s`. `forge pr view <n>` prints `State: closed` for a merged and an abandoned pull request alike, and the `forge pr snapshot` JSON carries no merged field either, so nothing in the tool distinguishes the two. The forge-groom skill in `allod/memory` (`skills/forge-groom/SKILL.md`, step 1) names `forge pr list -s closed` as the source of merged evidence, and its close rule depends on telling merged from closed. The groom run on 2026-09-10 worked around it by viewing every number from 1 to the highest `refs/pull/*/head` the remote advertises, keeping the ones that answered as pull requests, and testing `git merge-base --is-ancestor refs/pull/<n> origin/master` in a scratch clone. That only works because merges in these repositories are fast-forward; a squash or rebase merge would leave every pull request looking unmerged. ### Scope In: the `pr list` flags and row format, and a merged indicator in `pr view` and `pr snapshot` if it is cheapest to add in the same change. Out: issue list paging, tracked in allod/tools#89; timestamps in the view headers, tracked in allod/tools#194.
vnprc closed this issue 2026-09-11 20:23:05 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
allod/tools#193
No description provided.