From 02ace544bc28cf285aaf6865f2031b8d8ef43868 Mon Sep 17 00:00:00 2001 From: damocles Date: Thu, 21 May 2026 23:47:18 +0200 Subject: [PATCH] hive-forge: restore issue-edit verb lost in rebase --- nix/packages/hive-forge-tools.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/nix/packages/hive-forge-tools.nix b/nix/packages/hive-forge-tools.nix index 66290bc..5ddffc1 100644 --- a/nix/packages/hive-forge-tools.nix +++ b/nix/packages/hive-forge-tools.nix @@ -278,6 +278,33 @@ pkgs.writeShellApplication { | jq -r '.html_url' } + cmd_issue_edit() { + # issue-edit [--title ] [--body <body>] [--state open|closed] [repo] + # Edit an issue's title, body, or state. Only provided fields are changed. + if [ $# -lt 1 ]; then echo "usage: hive-forge issue-edit <number> [--title <title>] [--body <body>] [--state open|closed] [repo]" >&2; exit 1; fi + local _n="$1"; shift + local _title="" _body="" _state="" _repo="$HIVE_FORGE_REPO" + while [ $# -gt 0 ]; do + case "$1" in + --title) _title="$2"; shift 2 ;; + --body) _body="$2"; shift 2 ;; + --state) _state="$2"; shift 2 ;; + *) _repo="$1"; shift ;; + esac + done + local _payload + _payload=$(jq -n \ + --arg title "$_title" \ + --arg body "$_body" \ + --arg state "$_state" \ + '{} | + if $title != "" then . + {title:$title} else . end | + if $body != "" then . + {body:$body} else . end | + if $state != "" then . + {state:$state} else . end') + forge_patch "$FORGE_API/repos/$_repo/issues/$_n" "$_payload" \ + | jq '{number,title,state}' + } + cmd_attach_issue() { # attach-issue <number> <file> [repo] # Upload a file as an attachment to an issue. Prints the download URL. @@ -358,6 +385,7 @@ pkgs.writeShellApplication { view) cmd_view "$@" ;; issue) cmd_issue "$@" ;; issue-create) cmd_issue_create "$@" ;; + issue-edit) cmd_issue_edit "$@" ;; pr) cmd_pr "$@" ;; pr-create) cmd_pr_create "$@" ;; comment) cmd_comment "$@" ;;