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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b4988e7f5ab4be2b903187c815ec22bea49c3817c69b9520390758d5eb16ee0
4
- data.tar.gz: d16582776302c496a387791be6dfb3424fb6c669af6efbcf38f25c555feb3e88
3
+ metadata.gz: 49a89f528721bce8e90b9d16c636699b1ea56aa635ac8cc405542e84f8f03a02
4
+ data.tar.gz: 576d71d1120411f76dc155cb11c088548009816fca3ea9a3950c750ccd182a81
5
5
  SHA512:
6
- metadata.gz: bd23321769a10e3181d1e88ef9f6a953ff86fab5d4037e03058a55760ae22f64082e20a779f372a06d1f588909733a82ead732ce0d305f05873846913bc01937
7
- data.tar.gz: a67d8dbd70576be90258660e17708ecb86b0d823cbc10be838f05ddeb1fb1de307ec72b8d9d1247f96cbbbca2a0a5734beb89b0e39e53547663fbdd48ebdc570
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
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.237"
2
+ VERSION = "0.1.239"
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.237
4
+ version: 0.1.239
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota