Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: pr edit --base retargets a PR

Forgejo's issue edit endpoint (/issues/<n>) has no base field, so `pr edit`
could not retarget a stacked PR once its base merged. `--base <BRANCH>`
(non-empty) switches the edit onto PATCH /pulls/<n>, which carries `base`
alongside title/body/state/milestone. Without `--base`, `pr edit` is
unchanged and still goes through the issue endpoint.
This commit is contained in:
atlas 2026-10-13 03:37:49 +02:00 • committed by mara
commit 9e3a00825b
7 changed files with 348 additions and 27 deletions

View file

@ -480,7 +480,7 @@ PR-scoped commands: `pr <show|status|create|merge|reviews|assign-reviewer|commit
* `assign-reviewer` — Request (or withdraw with `--remove`) a review from a user
* `diff` — Print the PR's unified diff
* `view` — Show title + body + comments
* `edit` — Edit the PR's title / body / state / milestone. Fields you don't pass keep their current value
* `edit` — Edit the PR's title / body / state / milestone / base branch. Fields you don't pass keep their current value
* `comment` — Post a comment on the PR
* `comments` — List comments on the PR
* `close` — Close the PR
@ -653,7 +653,7 @@ Show title + body + comments
## `hive-forge pr edit`
Edit the PR's title / body / state / milestone. Fields you don't pass keep their current value
Edit the PR's title / body / state / milestone / base branch. Fields you don't pass keep their current value
**Usage:** `hive-forge pr edit [OPTIONS] <NUMBER>`
@ -671,6 +671,7 @@ Edit the PR's title / body / state / milestone. Fields you don't pass keep their
Possible values: `open`, `closed`
* `--milestone <MILESTONE>` — Milestone id (0 to unset)
* `--base <BRANCH>` — Retarget the PR onto this base branch (omit to leave unchanged)

View file

@ -67,6 +67,7 @@ hive-forge issue create --title "..." --body "..."
hive-forge issue create --title "..." --body "..." --label area/ops --label type/bug # repeatable
hive-forge issue edit 42 --title "new title"
hive-forge pr edit 42 --title "new title" # same edit, PR-kind-validated
hive-forge pr edit 42 --base main # retarget a stacked PR onto main
hive-forge pr 42 # PR metadata as JSON
hive-forge pr create --title "..." --head my-branch --push # also `git push forge my-branch`
hive-forge pr create --title "..." --head my-branch --label area/ops # repeatable, same as issue create