hiiro 0.1.322 → 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: e9afb3fb676cd088cb19aeeaa944954a58fa3b10de8b9bbcd5e320ddcba8ee51
4
- data.tar.gz: 1566f46fdbb10c362ecd8a6b7418350720c432d5822b9682464dc6336f73eb98
3
+ metadata.gz: 8d7b8a9088b7ae585db2f967e3f7d367c0688572813a11d808e02e84342a9941
4
+ data.tar.gz: d1d081a1bc46a10ea66e05c218d0565fa371329059201da4d0186c068dd42b88
5
5
  SHA512:
6
- metadata.gz: 84565259d3a19aae0295a8fa8d5adca7b28d5d834962a39a8d9965eb99ec5130d9e7c4a24bb44b1965e915f0c8bed9f56b9639c0370611f546849e55f431dcf7
7
- data.tar.gz: fc8c1f1d6ea48a3399d3a7a1187800b96982b2aff2918753f31dd2fcc2aa2c4ea64395cf4cae3467b7cd5d554fa9e9e75b29ec23e268a850c0f147f89b93b7b5
6
+ metadata.gz: d43cbe1509a538af912d16e0bb80a9ce157d6596e6c2cfd8fffdf2b1366efa17957e8400d73867fe7b4f8af9b15b08fc0eeba61927f9a17fd4edb9c4d4a5f9f1
7
+ data.tar.gz: 4b0975a073a1cbe785ca3ea18df72afb7488168b33c430b28393d52c9d4ef1d90540f5da6dd6bf94900fb6c3c822cbbb737f446f9169297257abbd996b61cc65
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
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
+
12
+ ## [0.1.323] - 2026-04-01
13
+
14
+ ### Changed
15
+ - Simplify `h pr ls` status refresh logic: always call `refresh_all_status` with `force:` parameter instead of conditional block
16
+ - Add optional `verbose:` parameter to `refresh_all_status` to control "already checked" message output
17
+ - Update `h pr update` to pass `verbose: true` when refreshing active PR status
18
+
3
19
  ## [0.1.322] - 2026-04-01
4
20
 
5
21
  ### Changed
data/bin/h-pr CHANGED
@@ -242,13 +242,8 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
242
242
  pinned = pinned_manager.load_pinned
243
243
  next puts "No tracked PRs" if pinned.empty?
244
244
 
245
- if opts.update
246
- active = pinned.select(&:active?)
247
- puts "Updating status for #{active.length} active PR(s)..."
248
- pinned_manager.refresh_all_status(pinned, force: true)
249
- pinned_manager.save_pinned(pinned)
250
- puts
251
- end
245
+ pinned_manager.refresh_all_status(pinned, force: opts.update)
246
+ pinned_manager.save_pinned(pinned)
252
247
 
253
248
  results = pinned_manager.apply_filters(pinned, opts)
254
249
 
@@ -287,34 +282,44 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
287
282
  end
288
283
 
289
284
  add_subcmd(:status) do |*status_args|
290
- raw = `gh pr view --json 'number,title,state,url,statusCheckRollup' 2>&1`
291
- if $?.exitstatus != 0
292
- puts raw.strip
293
- next
294
- end
285
+ refs = status_args.empty? ? [nil] : status_args
286
+ pinned = pinned_manager.load_pinned
295
287
 
296
- pr = JSON.parse(raw)
297
- checks = pr['statusCheckRollup'] || []
288
+ refs.each do |ref|
289
+ pr_number = ref ? resolve(:pr, ref) : nil
298
290
 
299
- counts = Hash.new(0)
300
- checks.each do |c|
301
- result = c['__typename'] == 'CheckRun' ? (c['conclusion'] || c['status']) : c['state']
302
- counts[result.to_s.upcase] += 1
303
- 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
304
298
 
305
- if counts.empty?
306
- summary = 'no checks'
307
- else
308
- order = ['FAILURE', 'ERROR', 'TIMED_OUT', 'CANCELLED', 'ACTION_REQUIRED', 'PENDING', 'IN_PROGRESS', 'QUEUED', 'SUCCESS', 'SKIPPED', 'NEUTRAL']
309
- parts = order.filter_map { |s| "#{counts[s]} #{s.downcase}" if counts[s] > 0 }
310
- summary = parts.join(', ')
311
- 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
312
307
 
313
- puts "##{pr['number']}"
314
- puts pr['title']
315
- puts pr['state'].downcase
316
- puts summary
317
- 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
318
323
  end
319
324
 
320
325
  add_subcmd(:update) do |*update_args|
@@ -334,7 +339,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
334
339
 
335
340
  active = pinned.select(&:active?)
336
341
  puts "Updating status for #{active.length} active PR(s) (#{pinned.length - active.length} closed/merged skipped)..."
337
- pinned_manager.refresh_all_status(pinned, force: opts.force_update)
342
+ pinned_manager.refresh_all_status(pinned, force: opts.force_update, verbose: true)
338
343
  pinned_manager.save_pinned(pinned)
339
344
  puts "Done."
340
345
 
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
 
@@ -271,11 +271,11 @@ class Hiiro
271
271
  result
272
272
  end
273
273
 
274
- def refresh_all_status(prs, force: false)
274
+ def refresh_all_status(prs, force: false, verbose: false)
275
275
  prs_to_refresh = prs.select { |pr| pr.active? && needs_refresh?(pr, force: force) }
276
276
 
277
277
  if prs_to_refresh.empty?
278
- puts "All PRs recently checked (within last 2 minutes). Use -U to force update." unless force
278
+ puts "All PRs recently checked (within last 2 minutes). Use -U to force update." if verbose
279
279
  return prs
280
280
  end
281
281
 
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.322"
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.322
4
+ version: 0.1.324
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota