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 +4 -4
- data/CHANGELOG.md +9 -0
- data/bin/h-pr +34 -24
- data/bin/h-wtree +30 -1
- data/lib/hiiro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d7b8a9088b7ae585db2f967e3f7d367c0688572813a11d808e02e84342a9941
|
|
4
|
+
data.tar.gz: d1d081a1bc46a10ea66e05c218d0565fa371329059201da4d0186c068dd42b88
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
286
|
-
|
|
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
|
-
|
|
292
|
-
|
|
288
|
+
refs.each do |ref|
|
|
289
|
+
pr_number = ref ? resolve(:pr, ref) : nil
|
|
293
290
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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