git-status-tree 3.3.0 → 3.5.0

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: 1b5f775e1ebd97220c6705c47a171091da213c9959c925ebef136ff5a5a29733
4
- data.tar.gz: 6c2d2dd1e7549110a29ce0abdd599b9c87a64aec3428a92ef06f927fa9e1a21c
3
+ metadata.gz: b0823206680a82016025ca4859cd9d0b7baf30ec61c51e2f5201f0dceeac9d20
4
+ data.tar.gz: 731c9421ae4eeffe679b3c65f2bc5816fe949aae33af6aa4082694eb8b133b66
5
5
  SHA512:
6
- metadata.gz: 063414646c8c96d17705a7db7cc380797bda2116e24e045876b14020ad854418cffcd6ddaf4a320ef7992245e8d4bb7de1b00632a51d557f0b76235881e305bd
7
- data.tar.gz: 7f3fcc689ce71d0221a2e0e640253c272437c2ab94210f5e6c6af4f45752538cd310b1fc11605f77f04f4f3fa0cfb8b381ac1478099f28dca3fc2124f50210ae
6
+ metadata.gz: 050262f9aa55d5768e1a63dfa199f035f2a3cb34d519bd1f703fd2e0405cdef23c5440449e46c3087f3349360107de5045ef60a07052a9d15667905136b56f52
7
+ data.tar.gz: cb498d741fbf7c4c2cf84475b0d69b0bf1857318e2ea45279dc5bc4fb54adcceb8e2fed576c66aa42e781de2cfdf7a9ba7be99a1686c4d77eb413740bd469aa7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.5.0
data/bin/git-status-tree CHANGED
@@ -18,6 +18,10 @@ parser = OptionParser.new do |opts|
18
18
  options[:collapse] = true
19
19
  end
20
20
 
21
+ opts.on('-u', '--untracked-files', 'Show untracked files in new directories') do
22
+ options[:untracked_files] = true
23
+ end
24
+
21
25
  opts.on('-v', '--version', 'Show version') do
22
26
  puts "git-status-tree #{GitStatusTree::VERSION}"
23
27
  exit 0
@@ -5,6 +5,7 @@ BIN_DIR=`pwd`
5
5
  popd > /dev/null
6
6
 
7
7
  git config --global status-tree.indent 4
8
+ git config --global status-tree.collapse false
8
9
  git config --global alias.tree "!exec $BIN_DIR/git-status-tree"
9
10
  echo '#############################'
10
11
  echo '# "git tree" has been added #'
@@ -12,8 +12,8 @@ class GitStatusTree
12
12
 
13
13
  def initialize(options = {})
14
14
  Node.indent = indent(options)
15
- Node.collapse_dirs = options[:collapse] || false
16
- @files = `git status --porcelain`.split("\n")
15
+ Node.collapse_dirs = collapse(options)
16
+ @files = `git status --porcelain#{untracked_files(options)}`.split("\n")
17
17
  @nodes = files.map { |file| Node.create_from_string file }
18
18
  @tree = nodes.reduce { |a, i| (a + i).nodes[0] }
19
19
  end
@@ -35,8 +35,25 @@ class GitStatusTree
35
35
  indent
36
36
  end
37
37
 
38
+ def collapse(options)
39
+ # Command line option takes precedence, then git config, then default (false)
40
+ return options[:collapse] if options.key?(:collapse)
41
+
42
+ config_collapse?
43
+ end
44
+
45
+ def untracked_files(options)
46
+ # Show untracked files in new directories, like `git status --untracked-files`
47
+ options[:untracked_files] ? ' --untracked-files=all' : ''
48
+ end
49
+
38
50
  def config
39
51
  config = `git config --global status-tree.indent`.strip
40
52
  config =~ /\A\d+\z/ ? config.to_i : nil
41
53
  end
54
+
55
+ def config_collapse?
56
+ config = `git config --global status-tree.collapse`.strip
57
+ config == 'true'
58
+ end
42
59
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-status-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wolfgang Teuber
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-03 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: git-status-tree is a command line tool that shows git repository changes
13
13
  in a file tree.
@@ -45,14 +45,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '3.3'
48
+ version: '3.4'
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
- rubygems_version: 3.6.2
55
+ rubygems_version: 3.6.9
56
56
  specification_version: 4
57
57
  summary: git status in file tree format
58
58
  test_files: []