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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54c08eaf4c06c0d65d9b829cf88206a0d25688a0397437a7836d1cfc638cd80c
4
- data.tar.gz: c27ea916068ede38ac90fb4edcabd69a56c5a05021c4f62f63fc1dfab03451c8
3
+ metadata.gz: 4a056a9aab3e0ea48cc82af0c6d3c296ca8497d3c144e37961b1db241ddc92e2
4
+ data.tar.gz: b27fa969ce900aa5c19fe0d818cc0728b1e43c108419baa40ba226121fcadfe8
5
5
  SHA512:
6
- metadata.gz: 403933bb82c011b46e7f37e23b95ae574186d8caf8e5ba568303648974e99a48b3adec5db3573e26e060e1c25ed746084312edc74d52c39ccc05bf4233262866
7
- data.tar.gz: 71b7c9699ac233c2d648fe46af0b00f507605ed78be6e1e9880edb93f20d91162c751e8405ef85d75b1e392b70a95ee5baec196c6bc5ad9df97687c045b03bfb
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.0.0)
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.0.0)
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 "line.(green|red)" --repo davidrunger/fcom`, I get this output:
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
- ![](https://s3.amazonaws.com/screens.davidrunger.com/2019-12-28-20-50-09-oect2(1).png)
9
+ ![fcom screenshot](https://david-runger-public-uploads.s3.us-east-1.amazonaws.com/fcom-screenshot.png)
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
 
@@ -32,10 +32,6 @@ module Fcom::OptionsHelpers
32
32
  @options.debug?
33
33
  end
34
34
 
35
- def development?
36
- @options.development?
37
- end
38
-
39
35
  def repo
40
36
  @options[:repo]
41
37
  end
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 = search_string
18
- if fixed_strings?
19
- expression_to_match = Regexp.escape(expression_to_match).gsub('\\ ', ' ')
20
- end
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
- "((\\+|-)\\s?.*#{expression_to_match}.*|Omitted long (matching )?line)",
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 = search_string
20
- if fixed_strings?
21
- expression_to_match = Regexp.escape(expression_to_match).gsub('\\ ', ' ')
22
- end
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
- #{if development?
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  # rubocop:disable-next Style/StaticClass
4
4
  class Fcom
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.0'
6
6
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Runger