fcom 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e7928ac7aa3b85318f701ea1758c3d5ea6b66abedede5d30ffdde4a57e101d7
4
- data.tar.gz: eccc91bfb11cae5d9d5c624c8d402261e09e7ae1bd49815ad815411431926a88
3
+ metadata.gz: 30446e1913a3779d48541ca2eba42e1cb346fb6993a197e8fcb3a8d617537ff0
4
+ data.tar.gz: 294773a3c1487c403cfd1d66995e0a7137dd4f04f227c3a580953bf2969cfa0b
5
5
  SHA512:
6
- metadata.gz: 69d76ea1e442afcd6d9921745ec71a1e4b825dd4a1df8d172a925f61ae55d73729eac97153f2ba413001fc410a7e4e8291942ab83c68559d0c92e94f5c751abe
7
- data.tar.gz: bf57c916fba57fd8c2cb8cf522d369fce057b43b6b3d73492613d25657f7a3c693372a73968573aae8921bb569535a5650c510aaed782f061bec76d702f4a245
6
+ metadata.gz: 9f53da64af757b73ed331e9d60ec4943a76cb400d50762009ac0e23c57c53a3a0346f58a5ec51bf018244d65f4c1bb6d04360dbfbcc7f19c7c1d7ea80b21c98d
7
+ data.tar.gz: 0b275ce9c6a84b7693e9010916bf66ddd7b279d320bf78cb95f61ec2eda87be2ac83ca56d322304d1d8689aaa1844b05fc487d3452c800e7427561d6dbf14c66
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.12.1 (2024-08-05)
2
+ - **Performance fix:** only search over renames when a path is given.
3
+ - **Performance fix:** only follow renames as far back as the `--days` option (if provided).
4
+
1
5
  ## v0.12.0 (2024-07-21)
2
6
  - Default `--rg-options` to `--max-columns=2000`
3
7
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fcom (0.12.0)
4
+ fcom (0.12.1)
5
5
  activesupport (>= 6, < 8)
6
6
  memo_wise (>= 1.7, < 2)
7
7
  rainbow (>= 3.0, < 4)
@@ -48,11 +48,11 @@ GEM
48
48
  pry-byebug (3.10.1)
49
49
  byebug (~> 11.0)
50
50
  pry (>= 0.13, < 0.15)
51
- racc (1.8.0)
51
+ racc (1.8.1)
52
52
  rainbow (3.1.1)
53
53
  rake (13.2.1)
54
54
  regexp_parser (2.9.2)
55
- rexml (3.3.2)
55
+ rexml (3.3.4)
56
56
  strscan
57
57
  rspec (3.13.0)
58
58
  rspec-core (~> 3.13.0)
@@ -67,7 +67,7 @@ GEM
67
67
  diff-lcs (>= 1.2.0, < 2.0)
68
68
  rspec-support (~> 3.13.0)
69
69
  rspec-support (3.13.1)
70
- rubocop (1.65.0)
70
+ rubocop (1.65.1)
71
71
  json (~> 2.3)
72
72
  language_server-protocol (>= 3.17.0)
73
73
  parallel (~> 1.10)
@@ -78,7 +78,7 @@ GEM
78
78
  rubocop-ast (>= 1.31.1, < 2.0)
79
79
  ruby-progressbar (~> 1.7)
80
80
  unicode-display_width (>= 2.4.0, < 3.0)
81
- rubocop-ast (1.31.3)
81
+ rubocop-ast (1.32.0)
82
82
  parser (>= 3.3.1.0)
83
83
  rubocop-performance (1.21.1)
84
84
  rubocop (>= 1.48.1, < 2.0)
@@ -88,12 +88,12 @@ GEM
88
88
  rubocop-rspec (3.0.3)
89
89
  rubocop (~> 1.61)
90
90
  ruby-progressbar (1.13.0)
91
- runger_release_assistant (0.10.0)
91
+ runger_release_assistant (0.12.0)
92
92
  activesupport (>= 6, < 8)
93
93
  memo_wise (>= 1.7, < 2)
94
94
  rainbow (>= 3.0, < 4)
95
95
  slop (~> 4.8)
96
- runger_style (2.12.0)
96
+ runger_style (2.15.0)
97
97
  prism (>= 0.24.0)
98
98
  rubocop (>= 1.38.0, < 2)
99
99
  slop (4.10.1)
data/lib/fcom/querier.rb CHANGED
@@ -35,7 +35,7 @@ class Fcom::Querier
35
35
  --full-diff
36
36
  --no-textconv
37
37
  #{%(--author="#{author}") if author}
38
- #{"--since=#{days}.day" unless days.nil?}
38
+ #{days_limiter}
39
39
  #{commit}
40
40
  --
41
41
  #{path_at_commit}
@@ -101,13 +101,29 @@ class Fcom::Querier
101
101
 
102
102
  memo_wise \
103
103
  def renames
104
- `git log HEAD --format=%H --name-status --follow --diff-filter=R -- '#{path}'`.
105
- split(/\n(?=[0-9a-f]{40})/).
106
- to_h do |sha_and_name_info|
107
- sha_and_name_info.
108
- match(/(?<sha>[0-9a-f]{40})\n\nR\d+\s+(?<previous_name>\S+)?/).
109
- named_captures.
110
- values_at('sha', 'previous_name')
111
- end
104
+ if path == Fcom::ROOT_PATH
105
+ {}
106
+ else
107
+ command =
108
+ 'git log HEAD ' \
109
+ "--format=%H --name-status --follow --diff-filter=R #{days_limiter} " \
110
+ "-- '#{path}'"
111
+
112
+ `#{command}`.
113
+ split(/\n(?=[0-9a-f]{40})/).
114
+ to_h do |sha_and_name_info|
115
+ sha_and_name_info.
116
+ match(/(?<sha>[0-9a-f]{40})\n\nR\d+\s+(?<previous_name>\S+)?/).
117
+ named_captures.
118
+ values_at('sha', 'previous_name')
119
+ end
120
+ end
121
+ end
122
+
123
+ memo_wise \
124
+ def days_limiter
125
+ if days
126
+ "--since=#{days}.day"
127
+ end
112
128
  end
113
129
  end
data/lib/fcom/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  # rubocop:disable Style/StaticClass
4
4
  class Fcom
5
- VERSION = '0.12.0'
5
+ VERSION = '0.12.1'
6
6
  end
7
7
  # rubocop:enable Style/StaticClass
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
- rubygems_version: 3.5.15
149
+ rubygems_version: 3.5.16
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: CLI tool for parsing git history