hiiro 0.1.269 → 0.1.270
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 +1 -1
- data/bin/h-branch +3 -0
- data/bin/h-sparse +128 -0
- data/lib/hiiro/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f1d28f0107940fe6255205f31ae4293acbcfc81463f89d842212a9b10363bb0
|
|
4
|
+
data.tar.gz: 1f47347f56f43b346a3a1168ebd423280cdde45151067eb3b08929dfa76424d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e97db54794ca0f8a731503973fa353f9ca4af8048f09604aa91f5c44a4ef419ed1261e921d390e00a0ad9a12613cf80a155960714f4cd9b2c1e5c558cef3ff63
|
|
7
|
+
data.tar.gz: 502d0bdab8d536f5c0c9d207b798f789428403a329c8b4ca5a4b56f9748852959371b421d05f552fa6762d56dfb27130c87fe29d5b1ad47422d942a6a9675a9f
|
data/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Invalid API key · Please run /login
|
data/bin/h-branch
CHANGED
|
@@ -76,9 +76,11 @@ class BranchManager
|
|
|
76
76
|
def build_entry(branch_name)
|
|
77
77
|
current_task = Hiiro::Environment.current&.task rescue nil
|
|
78
78
|
tmux_info = capture_tmux_info
|
|
79
|
+
sha = `git rev-parse HEAD 2>/dev/null`.strip
|
|
79
80
|
|
|
80
81
|
{
|
|
81
82
|
name: branch_name,
|
|
83
|
+
sha: sha.empty? ? nil : sha,
|
|
82
84
|
worktree: current_task&.tree_name,
|
|
83
85
|
task: current_task&.name,
|
|
84
86
|
tmux: tmux_info
|
|
@@ -97,6 +99,7 @@ class BranchManager
|
|
|
97
99
|
|
|
98
100
|
def show_entry(entry)
|
|
99
101
|
puts " Branch: #{entry[:name]}"
|
|
102
|
+
puts " SHA: #{entry[:sha] || '(unknown)'}"
|
|
100
103
|
puts " Task: #{entry[:task] || '(none)'}"
|
|
101
104
|
puts " Worktree: #{entry[:worktree] || '(none)'}"
|
|
102
105
|
if entry[:tmux]
|
data/bin/h-sparse
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'yaml'
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
require 'hiiro'
|
|
6
|
+
|
|
7
|
+
SPARSE_FILE = File.join(Dir.home, '.config', 'hiiro', 'sparse_groups.yml')
|
|
8
|
+
|
|
9
|
+
def load_groups
|
|
10
|
+
return {} unless File.exist?(SPARSE_FILE)
|
|
11
|
+
YAML.safe_load_file(SPARSE_FILE) || {}
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def save_groups(groups)
|
|
15
|
+
FileUtils.mkdir_p(File.dirname(SPARSE_FILE))
|
|
16
|
+
File.write(SPARSE_FILE, groups.to_yaml)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Hiiro.run(*ARGV) {
|
|
20
|
+
add_subcmd(:config) {
|
|
21
|
+
edit_files(SPARSE_FILE)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
add_subcmd(:ls) { |group_name=nil|
|
|
25
|
+
groups = load_groups
|
|
26
|
+
|
|
27
|
+
if groups.empty?
|
|
28
|
+
puts "No sparse groups configured."
|
|
29
|
+
puts "Edit #{SPARSE_FILE} with: h sparse config"
|
|
30
|
+
next
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
if group_name
|
|
34
|
+
match = groups.keys.find { |k| k == group_name } ||
|
|
35
|
+
groups.keys.find { |k| k.start_with?(group_name) } ||
|
|
36
|
+
groups.keys.find { |k| k.include?(group_name) }
|
|
37
|
+
|
|
38
|
+
unless match
|
|
39
|
+
puts "Group '#{group_name}' not found."
|
|
40
|
+
puts
|
|
41
|
+
puts "Available groups: #{groups.keys.join(', ')}"
|
|
42
|
+
next
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
puts "#{match}:"
|
|
46
|
+
Array(groups[match]).each { |path| puts " #{path}" }
|
|
47
|
+
else
|
|
48
|
+
max_len = groups.keys.map(&:length).max
|
|
49
|
+
groups.each do |name, paths|
|
|
50
|
+
puts format(" %-#{max_len}s (%d paths)", name, Array(paths).length)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
add_subcmd(:list) { |*args| run_subcmd(:ls, *args) }
|
|
56
|
+
|
|
57
|
+
add_subcmd(:add) { |group_name=nil, *paths|
|
|
58
|
+
if group_name.nil? || paths.empty?
|
|
59
|
+
puts "Usage: h sparse add <group> <path> [path...]"
|
|
60
|
+
next
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
groups = load_groups
|
|
64
|
+
existing = Array(groups[group_name])
|
|
65
|
+
added = []
|
|
66
|
+
|
|
67
|
+
paths.each do |path|
|
|
68
|
+
if existing.include?(path)
|
|
69
|
+
puts " already in '#{group_name}': #{path}"
|
|
70
|
+
else
|
|
71
|
+
existing << path
|
|
72
|
+
added << path
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if added.any?
|
|
77
|
+
groups[group_name] = existing
|
|
78
|
+
save_groups(groups)
|
|
79
|
+
puts "Added to '#{group_name}':"
|
|
80
|
+
added.each { |p| puts " #{p}" }
|
|
81
|
+
end
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
add_subcmd(:rm) { |group_name=nil, *paths|
|
|
85
|
+
if group_name.nil?
|
|
86
|
+
puts "Usage: h sparse rm <group> [path...]"
|
|
87
|
+
next
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
groups = load_groups
|
|
91
|
+
|
|
92
|
+
unless groups.key?(group_name)
|
|
93
|
+
puts "Group '#{group_name}' not found."
|
|
94
|
+
puts
|
|
95
|
+
puts "Available groups: #{groups.keys.join(', ')}"
|
|
96
|
+
next
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if paths.empty?
|
|
100
|
+
groups.delete(group_name)
|
|
101
|
+
save_groups(groups)
|
|
102
|
+
puts "Removed group '#{group_name}'"
|
|
103
|
+
else
|
|
104
|
+
existing = Array(groups[group_name])
|
|
105
|
+
removed = []
|
|
106
|
+
not_found = []
|
|
107
|
+
|
|
108
|
+
paths.each do |path|
|
|
109
|
+
if existing.delete(path)
|
|
110
|
+
removed << path
|
|
111
|
+
else
|
|
112
|
+
not_found << path
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
not_found.each { |p| puts " not found in '#{group_name}': #{p}" }
|
|
117
|
+
|
|
118
|
+
if removed.any?
|
|
119
|
+
groups[group_name] = existing
|
|
120
|
+
save_groups(groups)
|
|
121
|
+
puts "Removed from '#{group_name}':"
|
|
122
|
+
removed.each { |p| puts " #{p}" }
|
|
123
|
+
puts "(#{existing.length} paths remaining)" if existing.any?
|
|
124
|
+
puts "(group is now empty — run 'h sparse rm #{group_name}' to delete it)" if existing.empty?
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
}
|
|
128
|
+
}
|
data/lib/hiiro/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.1.270
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joshua Toyota
|
|
@@ -117,6 +117,7 @@ files:
|
|
|
117
117
|
- bin/h-project
|
|
118
118
|
- bin/h-session
|
|
119
119
|
- bin/h-sha
|
|
120
|
+
- bin/h-sparse
|
|
120
121
|
- bin/h-title
|
|
121
122
|
- bin/h-todo
|
|
122
123
|
- bin/h-window
|