hiiro 0.1.237 → 0.1.238

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: 2f403ffbd18e6ebc9816c133f59c146c189f12038faf0719b9102128a39cd94d
4
+ data.tar.gz: a30190a4710d32bcaa5c318e4124bb492204247a6c5711dde208b109c7b9db7d
5
5
  SHA512:
6
- metadata.gz: bd23321769a10e3181d1e88ef9f6a953ff86fab5d4037e03058a55760ae22f64082e20a779f372a06d1f588909733a82ead732ce0d305f05873846913bc01937
7
- data.tar.gz: a67d8dbd70576be90258660e17708ecb86b0d823cbc10be838f05ddeb1fb1de307ec72b8d9d1247f96cbbbca2a0a5734beb89b0e39e53547663fbdd48ebdc570
6
+ metadata.gz: 5ef44a5db79101ffc2992f86743abf2c2fb6f7ab82cdc9cd212a2560b0bdb7a782c3fa71eb66a913dd92ba9086a7395696c15bdd8df33ec819a03b9a28aa4a6f
7
+ data.tar.gz: 89f5dd66dc8ded5d11f208eb91ca37ad0a764744bfe8ac4380814e6959024ff3948b79f556ccdcbcf77f32d468e4b045c8511329de4c0e6b6540643d49b13ac3
data/lib/hiiro/tasks.rb CHANGED
@@ -732,6 +732,63 @@ class Hiiro
732
732
  end
733
733
  end
734
734
 
735
+ h.add_subcmd(:sparse) do |*args|
736
+ opts = Hiiro::Options.parse(args) do
737
+ flag(:list, short: 'l', desc: 'list available sparse groups and their directories')
738
+ flag(:disable, short: 'd', desc: 'disable sparse checkout on the current task worktree')
739
+ end
740
+
741
+ if opts.list
742
+ groups = Hiiro::SparseGroups.load
743
+ if groups.empty?
744
+ puts "No sparse groups configured."
745
+ puts " Config: #{Hiiro::SparseGroups::FILE}"
746
+ next
747
+ end
748
+ puts "Sparse groups:"
749
+ groups.each do |name, dirs|
750
+ puts " #{name}"
751
+ Array(dirs).each { |d| puts " #{d}" }
752
+ end
753
+ next
754
+ end
755
+
756
+ task = tm.current_task
757
+ unless task
758
+ puts "Not in a task session"
759
+ next
760
+ end
761
+
762
+ tree = tm.environment.find_tree(task.tree_name)
763
+ path = tree&.path
764
+ unless path
765
+ puts "Could not find worktree path for task '#{task.name}'"
766
+ next
767
+ end
768
+
769
+ if opts.disable
770
+ Hiiro::Git.new(nil, path).disable_sparse_checkout(path)
771
+ puts "Disabled sparse checkout for '#{task.name}'"
772
+ next
773
+ end
774
+
775
+ group_names = opts.args
776
+ if group_names.empty?
777
+ current = `git -C #{Shellwords.shellescape(path)} sparse-checkout list 2>/dev/null`.strip
778
+ if current.empty?
779
+ puts "No sparse checkout active for '#{task.name}'."
780
+ puts " Usage: h task sparse <group> (e.g. h task sparse default)"
781
+ puts " Groups: h task sparse -l"
782
+ else
783
+ puts "Sparse checkout for '#{task.name}':"
784
+ current.split("\n").each { |d| puts " #{d}" }
785
+ end
786
+ next
787
+ end
788
+
789
+ tm.apply_sparse_checkout(path, group_names)
790
+ end
791
+
735
792
  h.add_subcmd(:start) do |*raw_args|
736
793
  opts = Hiiro::Options.parse(raw_args) do
737
794
  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.238"
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.238
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota