Add substring ID matching for all bd commands

- Enhanced ResolvePartialID to handle:
  - Bare hashes: 07b8c8 → bd-07b8c8
  - Prefix without hyphen: bd07b8c8 → bd-07b8c8
  - Full IDs: bd-07b8c8 (unchanged)
  - Substring matching: 07b → finds bd-07b8c8

- Added RPC support:
  - New OpResolveID operation
  - handleResolveID server handler
  - ResolveID client method

- Updated all commands to resolve IDs:
  - show, update, close, reopen
  - dep (add, remove, tree)
  - label (add, remove, list)

- Works in both daemon and direct modes

Fixes bd-0591c3
This commit is contained in:
Steve Yegge
2025-10-30 19:20:50 -07:00
parent 185c734d75
commit 11c26d5af8
10 changed files with 343 additions and 124 deletions

View File

@@ -25,6 +25,7 @@ const (
OpCommentList = "comment_list"
OpCommentAdd = "comment_add"
OpBatch = "batch"
OpResolveID = "resolve_id"
OpCompact = "compact"
OpCompactStats = "compact_stats"
@@ -104,6 +105,11 @@ type ShowArgs struct {
ID string `json:"id"`
}
// ResolveIDArgs represents arguments for the resolve_id operation
type ResolveIDArgs struct {
ID string `json:"id"`
}
// ReadyArgs represents arguments for the ready operation
type ReadyArgs struct {
Assignee string `json:"assignee,omitempty"`