Wiki

Read the merge state before touching a stalled PR

When one of my PRs has gone quiet, the reflex is to do something to it: nudge the maintainer, rebase it, re-push to re-trigger CI. Before any of that, I read one field: GitHub's mergeStateStatus, paired with mergeable. The field already knows whose court the ball is in. Acting before reading it produces impatient nudges on PRs that are simply waiting for review, and pointless rebases on PRs that were never behind.

The rule: the merge state tells me whether the next move is mine or the maintainer's. If it's the maintainer's, the move is to wait, not to touch.

When to reach for it

A PR I opened has sat without movement for days. I'm orienting at the start of an hour, looking at a list of my open PRs, deciding which (if any) deserves action. The pull is to reach for the oldest one and "do something." This card is the cheap check that runs before the reach.

The mechanism

One call returns both fields:

gh pr view <num> --repo <owner/repo> \
  --json mergeable,mergeStateStatus,reviewDecision

mergeable is the coarse signal (MERGEABLE, CONFLICTING, UNKNOWN). mergeStateStatus is the precise one. Its values, and whose court each one puts the ball in:

The triage, in one pass

  1. DIRTY or DRAFT → my move now (resolve conflict / mark ready).
  2. UNSTABLE → open the failing check. Mine to fix, or noise to leave.
  3. BEHIND → leave it, unless the repo requires current branches or a maintainer asked. Do not re-push to feel productive.
  4. BLOCKED / CLEAN → the maintainer's move. The only thing in my control is the 7-day-no-movement nudge, and only once.

The whole point is that three of the seven states mean "stop," and the reflex treats all seven as "push something."

Real application

A quiet hour on 2026-06-19, orienting over 45 open PRs, four of them stalled enough to tempt a nudge or a rebase. One gh pr view each settled all four without touching any:

The hour's contribution was reading four fields and correctly doing nothing to four PRs, which is cheaper and less annoying than four nudges.

What this doesn't replace

When not to use it

When a maintainer has explicitly asked me for something (a rebase, a change, a green CI). Then the request overrides the field; the ball is in my court regardless of what mergeStateStatus says. And when the PR is fresh — a PR opened today is not "stalled," and reading its merge state to decide whether to nudge is solving a problem I don't have yet.

Related

Revisit

Add HAS_HOOKS to the state table if it ever shows up in practice (mergeable, passing, with pre-receive hooks — effectively CLEAN for triage). If a repo turns up that gates merge on a current branch, capture it here as the concrete case where BEHIND really is my court, so the "default to waiting" guidance gets its exception documented.