fcom 1.0.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +2 -2
- data/README.md +3 -5
- data/lib/fcom/options_helpers.rb +0 -4
- data/lib/fcom/parser.rb +9 -5
- data/lib/fcom/querier.rb +8 -7
- data/lib/fcom/version.rb +1 -1
- data/lib/fcom.rb +0 -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: 4a056a9aab3e0ea48cc82af0c6d3c296ca8497d3c144e37961b1db241ddc92e2
|
|
4
|
+
data.tar.gz: b27fa969ce900aa5c19fe0d818cc0728b1e43c108419baa40ba226121fcadfe8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c197afe0ccab572607fe42ca4ca723260eb8540bc3b18bd31a6cdc2aa2e35738400ae2d3c14dae4c0fa36a5a062eca4c4c03726599dfd3ec1c9651aee2153a3
|
|
7
|
+
data.tar.gz: c1503d963d3e9c5c4b8c508c1afc22fcdb08eb6cc095503245a56ea1d66da9fa644939d95ab5144f03106530aa7133d4383085a786b74dddbfc3341b8101de1f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
## Unreleased
|
|
2
2
|
[no unreleased changes yet]
|
|
3
3
|
|
|
4
|
+
## v1.1.0 (2026-08-28)
|
|
5
|
+
- Don't include Git patch metadata as matching lines.
|
|
6
|
+
- Remove the hidden `--development` option. Use `bundle exec ruby exe/fcom` for development searches.
|
|
7
|
+
|
|
8
|
+
## v1.0.1 (2026-08-28)
|
|
9
|
+
- Don't include commits or files whose matches are only in diff context lines.
|
|
10
|
+
|
|
4
11
|
## v1.0.0 (2026-08-28)
|
|
5
12
|
- **BREAKING CHANGE:** interpret search strings as regular expressions by default. Use `-F`/`--fixed-strings` to search for fixed strings.
|
|
6
13
|
|
data/Gemfile.lock
CHANGED
|
@@ -10,7 +10,7 @@ GIT
|
|
|
10
10
|
PATH
|
|
11
11
|
remote: .
|
|
12
12
|
specs:
|
|
13
|
-
fcom (1.
|
|
13
|
+
fcom (1.1.0)
|
|
14
14
|
activesupport (>= 6)
|
|
15
15
|
memo_wise (>= 1.7)
|
|
16
16
|
rainbow (>= 3.0)
|
|
@@ -177,7 +177,7 @@ CHECKSUMS
|
|
|
177
177
|
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
|
|
178
178
|
drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
|
|
179
179
|
erb (6.0.7) sha256=c5ca6dc25b0ef974a44dc8f59fe847577122483b1968a38dec305c60bf91ee92
|
|
180
|
-
fcom (1.
|
|
180
|
+
fcom (1.1.0)
|
|
181
181
|
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
|
|
182
182
|
io-console (0.9.2) sha256=efa74f891dd03c0939a931dfc6e74c2813d904763d456ea9762b0525e748db08
|
|
183
183
|
irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
|
data/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
This is a CLI tool that I use to parse the git history of a repo.
|
|
6
6
|
|
|
7
|
-
For example, if I use `fcom` to search this repo with `fcom
|
|
7
|
+
For example, if I use `fcom` to search this repo with `fcom 'rename.?\b' --commits 2 --author "David Runger"`, I get this output:
|
|
8
8
|
|
|
9
|
-

|
|
10
10
|
|
|
11
11
|
## Table of Contents
|
|
12
12
|
|
|
@@ -108,9 +108,7 @@ The performance of `fcom`'s querying and parsing of git history can significantl
|
|
|
108
108
|
|
|
109
109
|
## Development
|
|
110
110
|
|
|
111
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run
|
|
112
|
-
the tests. You can also run `bin/console` for an interactive prompt that will allow you to
|
|
113
|
-
experiment.
|
|
111
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. To run a search using the local executable, use `bundle exec ruby exe/fcom`, for example `bundle exec ruby exe/fcom 'rename.?\b' --commits 2`. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
114
112
|
|
|
115
113
|
To install this gem onto your local machine, run (in this repository's root directory):
|
|
116
114
|
|
data/lib/fcom/options_helpers.rb
CHANGED
data/lib/fcom/parser.rb
CHANGED
|
@@ -14,13 +14,15 @@ class Fcom::Parser
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def parse
|
|
17
|
-
expression_to_match =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
expression_to_match =
|
|
18
|
+
if fixed_strings?
|
|
19
|
+
Regexp.escape(search_string).gsub('\\ ', ' ')
|
|
20
|
+
else
|
|
21
|
+
search_string
|
|
22
|
+
end
|
|
21
23
|
regex =
|
|
22
24
|
Regexp.new(
|
|
23
|
-
"(
|
|
25
|
+
"\\A(?:[+-]\\s?.*(?:#{expression_to_match}).*|Omitted long (?:matching )?line)",
|
|
24
26
|
ignore_case? ? Regexp::IGNORECASE : nil,
|
|
25
27
|
)
|
|
26
28
|
|
|
@@ -43,6 +45,8 @@ class Fcom::Parser
|
|
|
43
45
|
when old_filename == new_filename then old_filename
|
|
44
46
|
else "#{old_filename} --> #{new_filename}"
|
|
45
47
|
end
|
|
48
|
+
elsif line.match?(%r{\A(?:---|\+\+\+) })
|
|
49
|
+
next
|
|
46
50
|
elsif line.match?(regex) && (filename.blank? || path_match?(filename))
|
|
47
51
|
if previous_commit
|
|
48
52
|
title, sha, author, date = previous_commit.split('|')
|
data/lib/fcom/querier.rb
CHANGED
|
@@ -16,10 +16,12 @@ class Fcom::Querier
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def query
|
|
19
|
-
expression_to_match =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
expression_to_match =
|
|
20
|
+
if fixed_strings?
|
|
21
|
+
Regexp.escape(search_string).gsub('\\ ', ' ')
|
|
22
|
+
else
|
|
23
|
+
search_string
|
|
24
|
+
end
|
|
23
25
|
|
|
24
26
|
if expression_to_match.nil? || expression_to_match.empty?
|
|
25
27
|
puts('provide expression to match as first argument')
|
|
@@ -92,6 +94,7 @@ class Fcom::Querier
|
|
|
92
94
|
git log
|
|
93
95
|
--format="commit %s|%H|%an|%cr (%ci)"
|
|
94
96
|
--patch
|
|
97
|
+
--unified=0
|
|
95
98
|
--full-diff
|
|
96
99
|
--diff-algorithm=default
|
|
97
100
|
--topo-order
|
|
@@ -113,9 +116,7 @@ class Fcom::Querier
|
|
|
113
116
|
#{@options[:rg_options]}
|
|
114
117
|
|
|
|
115
118
|
|
|
116
|
-
#{
|
|
117
|
-
File.join(__dir__, '../../exe/')
|
|
118
|
-
end}fcom #{quote}#{search_string}#{quote}
|
|
119
|
+
fcom #{quote}#{search_string}#{quote}
|
|
119
120
|
#{if days
|
|
120
121
|
"--days #{days}"
|
|
121
122
|
end}
|
data/lib/fcom/version.rb
CHANGED
data/lib/fcom.rb
CHANGED
|
@@ -79,7 +79,6 @@ class Fcom
|
|
|
79
79
|
)
|
|
80
80
|
options.bool('--debug', 'print debugging info', default: false)
|
|
81
81
|
options.bool('--parse-mode', 'whether we are in parse mode', default: false, help: false)
|
|
82
|
-
options.bool('--development', 'use local `fcom` executable', default: false, help: false)
|
|
83
82
|
end
|
|
84
83
|
end
|
|
85
84
|
end
|