git_fame 2.5.3 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -1,249 +1,220 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_fame
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linus Oleander
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-12 00:00:00.000000000 Z
11
+ date: 2021-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: progressbar
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.0
19
+ version: '7.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.21.0
26
+ version: '7.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: trollop
28
+ name: dry-initializer
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.2
33
+ version: '3.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.2
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: hirb
42
+ name: dry-struct
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.7.3
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.7.3
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: scrub_rb
56
+ name: dry-types
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.1
61
+ version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.1
68
+ version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: memoist
70
+ name: neatjson
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.14.0
75
+ version: '0.9'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.14.0
82
+ version: '0.9'
83
83
  - !ruby/object:Gem::Dependency
84
- name: method_profiler
84
+ name: rugged
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 2.0.1
89
+ version: '1.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 2.0.1
96
+ version: '1.0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rspec
98
+ name: tty-box
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 3.4.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 3.4.0
111
- - !ruby/object:Gem::Dependency
112
- name: rspec-collection_matchers
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: 1.1.2
118
- type: :development
103
+ version: '0.5'
104
+ type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
- version: 1.1.2
110
+ version: '0.5'
125
111
  - !ruby/object:Gem::Dependency
126
- name: rake
112
+ name: tty-option
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - "~>"
130
116
  - !ruby/object:Gem::Version
131
- version: 10.4.2
132
- type: :development
117
+ version: '0.2'
118
+ type: :runtime
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
- version: 10.4.2
124
+ version: '0.2'
139
125
  - !ruby/object:Gem::Dependency
140
- name: coveralls
126
+ name: tty-screen
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: 0.8.1
146
- type: :development
131
+ version: '0.5'
132
+ type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
- version: 0.8.1
138
+ version: '0.5'
153
139
  - !ruby/object:Gem::Dependency
154
- name: json
140
+ name: tty-spinner
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - "~>"
158
144
  - !ruby/object:Gem::Version
159
- version: 1.8.3
160
- type: :development
145
+ version: '0.9'
146
+ type: :runtime
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
150
  - - "~>"
165
151
  - !ruby/object:Gem::Version
166
- version: 1.8.3
152
+ version: '0.9'
167
153
  - !ruby/object:Gem::Dependency
168
- name: tins
154
+ name: tty-table
169
155
  requirement: !ruby/object:Gem::Requirement
170
156
  requirements:
171
- - - "~>"
157
+ - - ">="
172
158
  - !ruby/object:Gem::Version
173
- version: 1.6.0
174
- type: :development
159
+ version: 0.10.0
160
+ type: :runtime
175
161
  prerelease: false
176
162
  version_requirements: !ruby/object:Gem::Requirement
177
163
  requirements:
178
- - - "~>"
164
+ - - ">="
179
165
  - !ruby/object:Gem::Version
180
- version: 1.6.0
166
+ version: 0.10.0
181
167
  - !ruby/object:Gem::Dependency
182
- name: term-ansicolor
168
+ name: zeitwerk
183
169
  requirement: !ruby/object:Gem::Requirement
184
170
  requirements:
185
171
  - - "~>"
186
172
  - !ruby/object:Gem::Version
187
- version: 1.3.2
188
- type: :development
173
+ version: '2.0'
174
+ type: :runtime
189
175
  prerelease: false
190
176
  version_requirements: !ruby/object:Gem::Requirement
191
177
  requirements:
192
178
  - - "~>"
193
179
  - !ruby/object:Gem::Version
194
- version: 1.3.2
195
- - !ruby/object:Gem::Dependency
196
- name: colorize
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- description: A command-line tool that helps you summarize and pretty-print collaborators
210
- in a git repository based on contributions
180
+ version: '2.0'
181
+ description: |
182
+ A command-line tool that helps you summarize and
183
+ pretty-print collaborators in a git repository
184
+ based on contributions
185
+
186
+ Generates stats like:
187
+ - Number of files changed by a user
188
+ - Number of commits by user
189
+ - Lines of code by a user'
211
190
  email:
212
- - linus@oleander.nu
191
+ - oleander@users.noreply.github.com
213
192
  executables:
214
193
  - git-fame
215
194
  extensions: []
216
195
  extra_rdoc_files: []
217
196
  files:
218
- - ".gitignore"
219
- - ".gitmodules"
220
- - ".rspec"
221
- - ".travis.yml"
222
- - Gemfile
223
- - LICENSE
224
- - README.md
225
- - Rakefile
226
- - bin/git-fame
227
- - git_fame.gemspec
197
+ - exe/git-fame
228
198
  - lib/git_fame.rb
229
199
  - lib/git_fame/author.rb
230
200
  - lib/git_fame/base.rb
231
- - lib/git_fame/blame_parser.rb
232
- - lib/git_fame/commit_range.rb
233
- - lib/git_fame/errors.rb
234
- - lib/git_fame/file.rb
235
- - lib/git_fame/helper.rb
201
+ - lib/git_fame/collector.rb
202
+ - lib/git_fame/command.rb
203
+ - lib/git_fame/contribution.rb
204
+ - lib/git_fame/diff.rb
205
+ - lib/git_fame/error.rb
206
+ - lib/git_fame/extension.rb
207
+ - lib/git_fame/filter.rb
208
+ - lib/git_fame/render.rb
209
+ - lib/git_fame/render/extension.rb
236
210
  - lib/git_fame/result.rb
237
- - lib/git_fame/silent_progressbar.rb
211
+ - lib/git_fame/types.rb
238
212
  - lib/git_fame/version.rb
239
- - spec/bin_spec.rb
240
- - spec/git_fame_spec.rb
241
- - spec/spec_helper.rb
242
- - spec/support/startup.rb
243
- homepage: http://oleander.io/git-fame-rb
213
+ homepage: https://github.com/oleander/git-fame-rb
244
214
  licenses: []
245
- metadata: {}
246
- post_install_message:
215
+ metadata:
216
+ rubygems_mfa_required: 'true'
217
+ post_install_message:
247
218
  rdoc_options: []
248
219
  require_paths:
249
220
  - lib
@@ -251,23 +222,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
251
222
  requirements:
252
223
  - - ">="
253
224
  - !ruby/object:Gem::Version
254
- version: 1.9.2
225
+ version: 2.7.0
255
226
  required_rubygems_version: !ruby/object:Gem::Requirement
256
227
  requirements:
257
228
  - - ">="
258
229
  - !ruby/object:Gem::Version
259
230
  version: '0'
260
231
  requirements: []
261
- rubyforge_project:
262
- rubygems_version: 2.5.1
263
- signing_key:
232
+ rubygems_version: 3.3.3
233
+ signing_key:
264
234
  specification_version: 4
265
- summary: 'git-fame is a command-line tool that helps you summarize and pretty-print
235
+ summary: git-fame is a command-line tool that helps you summarize and pretty-print
266
236
  collaborators in a git repository based on contributions. A Ruby wrapper for git-blame
267
- if you will. Generates stats like: - Number of files changed by a user - Number
268
- of commits by user - Lines of code by a user'
269
- test_files:
270
- - spec/bin_spec.rb
271
- - spec/git_fame_spec.rb
272
- - spec/spec_helper.rb
273
- - spec/support/startup.rb
237
+ if you will.
238
+ test_files: []
data/.gitignore DELETED
@@ -1,20 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .byebug_history
19
- .tags
20
- .tags1
data/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "spec/fixtures/gash"]
2
- path = spec/fixtures/gash
3
- url = https://github.com/water/gash.git
data/.rspec DELETED
@@ -1,7 +0,0 @@
1
- --color
2
- -I lib
3
- -I spec
4
- --require spec_helper
5
- --exclude-pattern spec/fixtures/**/*_spec.rb
6
- --tty
7
- --format documentation
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.1
4
- - 2.2.0
5
- - 2.1.0
6
- - 2.0.0
7
- - 1.9.3
8
- script:
9
- - bundle exec rspec spec
10
- notifications:
11
- webhooks:
12
- urls:
13
- - https://webhooks.gitter.im/e/e2b034ea2dbc919b02f7
14
- on_success: change
15
- on_failure: change
16
- on_start: false
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in git_fame.gemspec
4
- gemspec
data/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2012 Linus Oleander
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md DELETED
@@ -1,140 +0,0 @@
1
- # git-fame
2
- [![Gem](https://img.shields.io/gem/dt/git_fame.svg)](https://rubygems.org/gems/git_fame)
3
- [![Gitter](https://img.shields.io/gitter/room/oleander/git-fame-rb.svg)](https://gitter.im/oleander/git-fame-rb)
4
- [![Travis](https://img.shields.io/travis/oleander/git-fame-rb.svg)](https://travis-ci.org/oleander/git-fame-rb)
5
- [![Coveralls](https://img.shields.io/coveralls/oleander/git-fame-rb.svg)](https://coveralls.io/github/oleander/git-fame-rb)
6
- [![My personal webpage](https://img.shields.io/badge/me-oleander.io-blue.svg)](http://oleander.io)
7
-
8
- `git-fame` is a command-line tool that helps you summarize and pretty-print collaborators in a git repository based on contributions.
9
-
10
- ## Example output
11
-
12
- Statistics generated from this git repository using `git fame .`
13
-
14
- ```
15
- Statistics based on master
16
- Active files: 21
17
- Active lines: 967
18
- Total commits: 109
19
-
20
- Note: Files matching MIME type image, binary has been ignored
21
-
22
- +----------------+-----+---------+-------+---------------------+
23
- | name | loc | commits | files | distribution (%) |
24
- +----------------+-----+---------+-------+---------------------+
25
- | Linus Oleander | 914 | 106 | 21 | 94.5 / 97.2 / 100.0 |
26
- | f1yegor | 47 | 2 | 7 | 4.9 / 1.8 / 33.3 |
27
- | David Selassie | 6 | 1 | 2 | 0.6 / 0.9 / 9.5 |
28
- +----------------+-----+---------+-------+---------------------+
29
- ```
30
-
31
- ## Installation
32
-
33
- `[sudo] gem install git_fame`
34
-
35
- ## Usage
36
-
37
- ### Command-line
38
-
39
- From a git repository run `git fame .`
40
-
41
- #### Options
42
-
43
- - `git fame --by-type` Group line counts by file extension (i.e. .rb, .erb, .yml). See the *by type* section below.
44
- - `git fame --exclude=path1/*,path2/*` Comma separated, [glob](https://en.wikipedia.org/wiki/Glob_(programming)) file path to exclude.
45
- - `git fame --include=path1/*,path2/*` Comma separated, [glob](https://en.wikipedia.org/wiki/Glob_(programming)) file path to include.
46
- - `git fame --sort=loc` Order table by `loc`. Available options are: `loc`, `files` and `commits`. Default is `loc`.
47
- - `git fame --hide-progressbar` Hide progressbar.
48
- - `git fame --whitespace` Ignore whitespace changes when blaming files. [More about git blame and whitespace](https://coderwall.com/p/x8xbnq/git-don-t-blame-people-for-changing-whitespaces-or-moving-code).
49
- - `git fame --repository=/path/to/repo` Git repository to be used. Default is the current folder.
50
- - `git fame --branch=HEAD` Branch to run on. Default is what `HEAD` points to.
51
- - `git fame --format=output` Output format. Default is `pretty`. Additional: `csv`.
52
- - `git fame --after=2010-01-01` Only use commits after this date. Format: yyyy-mm-dd. Note that the given date is included.
53
- - `git fame --before=2016-02-01` Only use commits before this date. Format: yyyy-mm-dd. Note that the given date is included.
54
- - `git fame --verbose` Print shell commands used by `git-fame`.
55
- - `git fame --everything` Images and binaries are ignored by default. Include them as well.
56
- - `git fame --timeout` Set timeout in seconds for each git command.
57
-
58
- #### By type
59
-
60
- `--by-type` adds extra columns file types.
61
-
62
- ```
63
- +----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
64
- | name | loc | commits | files | distribution (%) | unknown | yml | md | gemspec | rb |
65
- +----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
66
- | Linus Oleander | 914 | 106 | 21 | 94.5 / 97.2 / 100.0 | 32 | 5 | 61 | 23 | 257 |
67
- | f1yegor | 47 | 2 | 7 | 4.9 / 1.8 / 33.3 | 3 | 5 | 6 | 1 | 10 |
68
- | David Selassie | 6 | 1 | 2 | 0.6 / 0.9 / 9.5 | 2 | 0 | 3 | 0 | 0 |
69
- +----------------+-----+---------+-------+---------------------+---------+-----+----+---------+-----+
70
- ```
71
-
72
- ### Programmatically
73
-
74
- Want to work with the data before using it? Here's how.
75
-
76
- #### Constructor arguments
77
-
78
- `options` is a hash with most of the arguments passed to the binary defined above.
79
- Take a look at the [bin/git-fame](bin/git-fame) file for more information.
80
-
81
- ``` ruby
82
- repository = GitFame::Base.new(options)
83
- ```
84
-
85
- #### Print table
86
-
87
- `repository.pretty_puts` outputs the statistics as an ascii table.
88
-
89
-
90
- #### Print csv table to console
91
-
92
- `repository.csv_puts` outputs the statistics as csv.
93
-
94
- #### Statistics
95
-
96
- ##### GitFame
97
-
98
- - `repository.loc` (Fixnum) Total number of lines.
99
- - `repository.commits` (Fixnum) Total number of commits.
100
- - `repository.files` (Fixnum) Total number of files.
101
- - `repository.authors` (Array< Author >) All authors.
102
-
103
- ##### Author
104
-
105
- `author = repository.authors.first`
106
-
107
- - Formated
108
- - `author.loc` (String) Number of lines.
109
- - `author.commits` (String) Number of commits.
110
- - `author.files` (String) Number of files changed.
111
- - Non formated
112
- - `author.distribution` (String) Distribution (in %) between users (loc/commits/files)
113
- - `author.raw_loc` (Fixnum) Number of lines.
114
- - `author.raw_commits` (Fixnum) Number of commits.
115
- - `author.raw_files` (Fixnum) Number of files changed.
116
- - `author.file_type_counts` (Array) File types (k) and loc (v)
117
-
118
- ## Testing
119
-
120
- 1. Download fixtures (`spec/fixtures`) using `git submodule update --init`.
121
- 2. Run rspec using `bundle exec rspec`.
122
-
123
- Note that `puts` has been disabled to avoid unnecessary output during testing.
124
- Visit `spec/spec_helper.rb` to enable it again.
125
-
126
- ## Contributing
127
-
128
- 1. Fork it
129
- 2. Create your feature branch (`git checkout -b my-new-feature`)
130
- 3. Commit your changes (`git commit -am 'Added some feature'`)
131
- 4. Push to the branch (`git push origin my-new-feature`)
132
- 5. Create new Pull Request
133
-
134
- ## Requirements
135
-
136
- *GitFame* should work on all Unix based operating system with Git installed.
137
-
138
- ## License
139
-
140
- *GitFame* is released under the *MIT license*.
data/Rakefile DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- require "bundler/gem_tasks"
4
- require "method_profiler"
5
- require "git_fame"
6
-
7
- task :profile do
8
- profiler = MethodProfiler.observe(GitFame::Base)
9
-
10
- GitFame::Base.new({
11
- repository: "spec/fixtures/gash"
12
- })
13
-
14
- puts profiler.report
15
- end
data/bin/git-fame DELETED
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib"
4
-
5
- require "git_fame"
6
- require "trollop"
7
-
8
- opts = Trollop::options do
9
- version "git-fame #{GitFame::VERSION} (c) 2012-#{Date.today.year} Linus Oleander"
10
- opt :repository, "What git repository should be used?", default: "."
11
- opt :sort, "What should the printed table be sorted by? #{GitFame::SORT.join(", ")}", default: "loc", type: String
12
- opt :"hide-progressbar", "Hide progressbar", default: false
13
- opt :whitespace, "Ignore whitespace changes", default: false
14
- opt :"by-type", "Group line counts by file extension (i.e. .rb, .erb, .yml)", default: false
15
- opt :include, "Comma separated, glob file path to include. I.e path/*.rb", default: "", type: String
16
- opt :exclude, "Comma separated, glob file path to exclude. I.e any/**/path/*", default: "", type: String
17
- opt :extension, "Comma-separated list of extensions to consider, leave blank for all", default: "", type: String
18
- opt :branch, "Branch to run on", default: "HEAD", type: String
19
- opt :format, "Format (pretty/csv)", default: "pretty", type: String
20
- opt :after, "Only use commmits after this date. Format: yyyy-mm-dd. Note that the given date is included", type: String
21
- opt :before, "Only use commits before this date. Format: yyyy-mm-dd. Note that the given date is included", type: String
22
- opt :verbose, "Print shell commands used by git-fame", default: false
23
- opt :timeout, "Set timeout in seconds for each git command. Turn off by using -1", type: Integer, default: GitFame::CMD_TIMEOUT
24
- opt :everything, "Images and binaries are ignored by default. Include them as well", default: false
25
- end
26
-
27
- unless GitFame::SORT.include?(opts[:sort])
28
- Trollop::die :sort, "must be one of the following; #{GitFame::SORT.join(", ")}"
29
- end
30
-
31
- if opts[:timeout] != -1 and opts[:timeout] <= 0
32
- Trollop::die :timeout, "must be positive"
33
- end
34
-
35
- begin
36
- fame = GitFame::Base.new({
37
- repository: opts[:repository],
38
- progressbar: ! opts[:"hide-progressbar"],
39
- sort: opts[:sort],
40
- whitespace: opts[:whitespace],
41
- by_type: opts[:"by-type"],
42
- include: opts[:include],
43
- exclude: opts[:exclude],
44
- extensions: opts[:extension],
45
- branch: opts[:branch],
46
- after: opts[:after],
47
- before: opts[:before],
48
- verbose: opts[:verbose],
49
- everything: opts[:everything],
50
- timeout: opts[:timeout]
51
- })
52
-
53
- opts[:format] == "csv" ? fame.csv_puts : fame.pretty_puts
54
- rescue GitFame::Error => e
55
- Trollop::die e.message
56
- rescue Timeout::Error
57
- Trollop::die "Maximum timeout of #{opts[:timeout]} sec exceed. Try passing --timeout=<sec> or -1 for no timeout"
58
- end