hiiro 0.1.323 → 0.1.324

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0e6f5a6312065c5ed74198ae2c2eb9e2a00b313a716946c920722805908ecf
4
- data.tar.gz: 88a43b3e4225ef3ce0d99b7eeb7f31d0aa3b4adc521ea7563d31f3ef4bed203c
3
+ metadata.gz: 8d7b8a9088b7ae585db2f967e3f7d367c0688572813a11d808e02e84342a9941
4
+ data.tar.gz: d1d081a1bc46a10ea66e05c218d0565fa371329059201da4d0186c068dd42b88
5
5
  SHA512:
6
- metadata.gz: b79f44eab5cd1d65e6fe231242cd82492d280356d5ca571ec3d012b0b36c5d06e21b1d914bd37a6b7a98b1ad7f108e2fbefcffb127ff6efa19fa1c869e449410
7
- data.tar.gz: ddf1662f78450f2167db30dba65f582a5cf863ca123c69dc5a7be66917f3741bc179f7e6437970914b17714bd78c3776b7509d8fc226e7bf83a5103d53f4930d
6
+ metadata.gz: d43cbe1509a538af912d16e0bb80a9ce157d6596e6c2cfd8fffdf2b1366efa17957e8400d73867fe7b4f8af9b15b08fc0eeba61927f9a17fd4edb9c4d4a5f9f1
7
+ data.tar.gz: 4b0975a073a1cbe785ca3ea18df72afb7488168b33c430b28393d52c9d4ef1d90540f5da6dd6bf94900fb6c3c822cbbb737f446f9169297257abbd996b61cc65
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.324] - 2026-04-02
4
+
5
+ ### Added
6
+ - `h pr status [ref...]` — query multiple PRs or pinned PRs; outputs number, title, state, check summary, and URL for each
7
+ - `h wtree branch [paths...]` — show branch for each worktree, or query specific worktree paths; resolves relative paths using task context
8
+
9
+ ### Changed
10
+ - Pass `cwd` context to `h-wtree` via `Hiiro.run` for proper path resolution in nested environments
11
+
3
12
  ## [0.1.323] - 2026-04-01
4
13
 
5
14
  ### Changed
data/bin/h-pr CHANGED
@@ -282,34 +282,44 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
282
282
  end
283
283
 
284
284
  add_subcmd(:status) do |*status_args|
285
- raw = `gh pr view --json 'number,title,state,url,statusCheckRollup' 2>&1`
286
- if $?.exitstatus != 0
287
- puts raw.strip
288
- next
289
- end
285
+ refs = status_args.empty? ? [nil] : status_args
286
+ pinned = pinned_manager.load_pinned
290
287
 
291
- pr = JSON.parse(raw)
292
- checks = pr['statusCheckRollup'] || []
288
+ refs.each do |ref|
289
+ pr_number = ref ? resolve(:pr, ref) : nil
293
290
 
294
- counts = Hash.new(0)
295
- checks.each do |c|
296
- result = c['__typename'] == 'CheckRun' ? (c['conclusion'] || c['status']) : c['state']
297
- counts[result.to_s.upcase] += 1
298
- end
291
+ cmd = ['gh', 'pr', 'view', '--json', 'number,title,state,url,statusCheckRollup']
292
+ cmd << pr_number.to_s if pr_number
293
+ raw = `#{cmd.join(' ')} 2>&1`
294
+ if $?.exitstatus != 0
295
+ puts raw.strip
296
+ next
297
+ end
299
298
 
300
- if counts.empty?
301
- summary = 'no checks'
302
- else
303
- order = ['FAILURE', 'ERROR', 'TIMED_OUT', 'CANCELLED', 'ACTION_REQUIRED', 'PENDING', 'IN_PROGRESS', 'QUEUED', 'SUCCESS', 'SKIPPED', 'NEUTRAL']
304
- parts = order.filter_map { |s| "#{counts[s]} #{s.downcase}" if counts[s] > 0 }
305
- summary = parts.join(', ')
306
- end
299
+ pr = JSON.parse(raw)
300
+ checks = pr['statusCheckRollup'] || []
301
+
302
+ counts = Hash.new(0)
303
+ checks.each do |c|
304
+ result = c['__typename'] == 'CheckRun' ? (c['conclusion'] || c['status']) : c['state']
305
+ counts[result.to_s.upcase] += 1
306
+ end
307
307
 
308
- puts "##{pr['number']}"
309
- puts pr['title']
310
- puts pr['state'].downcase
311
- puts summary
312
- puts pr['url']
308
+ if counts.empty?
309
+ summary = 'no checks'
310
+ else
311
+ order = %w[FAILURE ERROR TIMED_OUT CANCELLED ACTION_REQUIRED PENDING IN_PROGRESS QUEUED SUCCESS SKIPPED NEUTRAL]
312
+ parts = order.filter_map { |s| "#{counts[s]} #{s.downcase}" if counts[s] > 0 }
313
+ summary = parts.join(', ')
314
+ end
315
+
316
+ puts "##{pr['number']}"
317
+ puts pr['title']
318
+ puts pr['state'].downcase
319
+ puts summary
320
+ puts pr['url']
321
+ puts if refs.length > 1
322
+ end
313
323
  end
314
324
 
315
325
  add_subcmd(:update) do |*update_args|
data/bin/h-wtree CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'hiiro'
4
4
  require 'shellwords'
5
5
 
6
- Hiiro.run(*ARGV) do
6
+ Hiiro.run(*ARGV, cwd: Dir.pwd) do
7
7
  add_subcmd(:ls) { |*args| system('git', 'worktree', 'list', *args) }
8
8
  add_subcmd(:list) { |*args| run_subcmd(:ls, *args) }
9
9
  add_subcmd(:add) { |*args| system('git', 'worktree', 'add', *args) }
@@ -68,6 +68,35 @@ Hiiro.run(*ARGV) do
68
68
  end
69
69
  end
70
70
 
71
+ add_subcmd(:branch) do |*paths|
72
+ if paths.empty?
73
+ # No paths given — print branch for each worktree
74
+ output = `git worktree list`.strip
75
+ if output.empty?
76
+ STDERR.puts "No worktrees found"
77
+ next
78
+ end
79
+ output.split("\n").each do |line|
80
+ parts = line.split
81
+ path = parts[0]
82
+ branch = parts[2]&.gsub(/[\[\]]/, '') || parts[1]
83
+ puts "#{path}\t#{branch}"
84
+ end
85
+ else
86
+ # Resolve each given path and print its branch
87
+ cwd = get_value(:cwd) || Dir.pwd
88
+ paths.each do |path|
89
+ resolved = File.expand_path(path, cwd)
90
+ branch = Dir.chdir(resolved) { `git rev-parse --abbrev-ref HEAD`.strip } rescue nil
91
+ if branch
92
+ puts paths.size > 1 ? "#{resolved}\t#{branch}" : branch
93
+ else
94
+ STDERR.puts "#{resolved}: not a git worktree or error reading branch"
95
+ end
96
+ end
97
+ end
98
+ end
99
+
71
100
  add_subcmd(:copy) do |*args|
72
101
  output = `git worktree list`.strip
73
102
 
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.323"
2
+ VERSION = "0.1.324"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.323
4
+ version: 0.1.324
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota