hiiro 0.1.237 → 0.1.239
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/lib/hiiro/tasks.rb +59 -0
- 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: 49a89f528721bce8e90b9d16c636699b1ea56aa635ac8cc405542e84f8f03a02
|
|
4
|
+
data.tar.gz: 576d71d1120411f76dc155cb11c088548009816fca3ea9a3950c750ccd182a81
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f16a209a289c0a606dc08010cb48e5a17f5d1df491ac23e1eb31085343856e405d427f6bcc02b645abc158d6ecb392b12939123c1f80ce9120762505fa084c1
|
|
7
|
+
data.tar.gz: 50428c767ea91a98a0eea9795978627b1ab54183ca3d20a3f41305968d00b993f520ab0186d8fdd73e60c1920f3bc25e0b7a30ae0fd1b21cf9161c49f1071896
|
data/lib/hiiro/tasks.rb
CHANGED
|
@@ -535,6 +535,8 @@ class Hiiro
|
|
|
535
535
|
end
|
|
536
536
|
end
|
|
537
537
|
|
|
538
|
+
public
|
|
539
|
+
|
|
538
540
|
def apply_sparse_checkout(path, group_names)
|
|
539
541
|
dirs = SparseGroups.dirs_for_groups(group_names)
|
|
540
542
|
if dirs.empty?
|
|
@@ -732,6 +734,63 @@ class Hiiro
|
|
|
732
734
|
end
|
|
733
735
|
end
|
|
734
736
|
|
|
737
|
+
h.add_subcmd(:sparse) do |*args|
|
|
738
|
+
opts = Hiiro::Options.parse(args) do
|
|
739
|
+
flag(:list, short: 'l', desc: 'list available sparse groups and their directories')
|
|
740
|
+
flag(:disable, short: 'd', desc: 'disable sparse checkout on the current task worktree')
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
if opts.list
|
|
744
|
+
groups = Hiiro::SparseGroups.load
|
|
745
|
+
if groups.empty?
|
|
746
|
+
puts "No sparse groups configured."
|
|
747
|
+
puts " Config: #{Hiiro::SparseGroups::FILE}"
|
|
748
|
+
next
|
|
749
|
+
end
|
|
750
|
+
puts "Sparse groups:"
|
|
751
|
+
groups.each do |name, dirs|
|
|
752
|
+
puts " #{name}"
|
|
753
|
+
Array(dirs).each { |d| puts " #{d}" }
|
|
754
|
+
end
|
|
755
|
+
next
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
task = tm.current_task
|
|
759
|
+
unless task
|
|
760
|
+
puts "Not in a task session"
|
|
761
|
+
next
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
tree = tm.environment.find_tree(task.tree_name)
|
|
765
|
+
path = tree&.path
|
|
766
|
+
unless path
|
|
767
|
+
puts "Could not find worktree path for task '#{task.name}'"
|
|
768
|
+
next
|
|
769
|
+
end
|
|
770
|
+
|
|
771
|
+
if opts.disable
|
|
772
|
+
Hiiro::Git.new(nil, path).disable_sparse_checkout(path)
|
|
773
|
+
puts "Disabled sparse checkout for '#{task.name}'"
|
|
774
|
+
next
|
|
775
|
+
end
|
|
776
|
+
|
|
777
|
+
group_names = opts.args
|
|
778
|
+
if group_names.empty?
|
|
779
|
+
current = `git -C #{Shellwords.shellescape(path)} sparse-checkout list 2>/dev/null`.strip
|
|
780
|
+
if current.empty?
|
|
781
|
+
puts "No sparse checkout active for '#{task.name}'."
|
|
782
|
+
puts " Usage: h task sparse <group> (e.g. h task sparse default)"
|
|
783
|
+
puts " Groups: h task sparse -l"
|
|
784
|
+
else
|
|
785
|
+
puts "Sparse checkout for '#{task.name}':"
|
|
786
|
+
current.split("\n").each { |d| puts " #{d}" }
|
|
787
|
+
end
|
|
788
|
+
next
|
|
789
|
+
end
|
|
790
|
+
|
|
791
|
+
tm.apply_sparse_checkout(path, group_names)
|
|
792
|
+
end
|
|
793
|
+
|
|
735
794
|
h.add_subcmd(:start) do |*raw_args|
|
|
736
795
|
opts = Hiiro::Options.parse(raw_args) do
|
|
737
796
|
option(:sparse, short: :s, desc: 'Sparse checkout group (may be repeated)', multi: true)
|
data/lib/hiiro/version.rb
CHANGED