Expand description
gw await command - Watch a specific PR to completion, then clean up.
await is the closing bookend of the workflow. Its irreducible job is to
watch the PR until it reaches a terminal state (merged or closed); the CI
wait and the post-merge cleanup are adjacent steps composed on top, each
toggleable by a flag.
The PR is identified by number, not by the current branch. This keeps a background watcher bound to one PR even if you switch branches (e.g. while working a stacked PR), and lets the post-merge cleanup target the PR’s own head branch rather than whatever happens to be checked out.
Phases:
- Wait for CI —
gh pr checks --watch(skip with--no-wait) - Watch for merge — poll the PR state every
--intervalseconds - On merge — notify, then
gw cleanup <head branch>(skip with--no-cleanup)
Environment-specific behavior stays in the user’s dotfiles, not the CLI:
--openopens the URL viaGW_OPEN_URL_CMD/OPEN_URL_CMD(seegw open)- the merge notification is delegated to
GW_NOTIFY_CMD(called as$GW_NOTIFY_CMD "<message>"), e.g. a script wrapping macOSosascript.
Functions§
- run
- Execute the
awaitcommand for a specific PR number