overcommit 0.28.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +8 -1
- data/lib/overcommit/cli.rb +21 -15
- data/lib/overcommit/configuration.rb +96 -4
- data/lib/overcommit/configuration_loader.rb +29 -3
- data/lib/overcommit/configuration_validator.rb +14 -0
- data/lib/overcommit/exceptions.rb +3 -0
- data/lib/overcommit/git_config.rb +12 -0
- data/lib/overcommit/git_repo.rb +1 -1
- data/lib/overcommit/hook/base.rb +2 -2
- data/lib/overcommit/hook/pre_commit/jscs.rb +4 -3
- data/lib/overcommit/hook/pre_commit/nginx_test.rb +24 -0
- data/lib/overcommit/hook/pre_commit/scalastyle.rb +3 -2
- data/lib/overcommit/hook_context/commit_msg.rb +5 -1
- data/lib/overcommit/hook_loader/plugin_hook_loader.rb +1 -1
- data/lib/overcommit/hook_signer.rb +1 -2
- data/lib/overcommit/utils.rb +1 -1
- data/lib/overcommit/version.rb +1 -1
- data/lib/overcommit.rb +1 -0
- data/template-dir/hooks/commit-msg +4 -0
- data/template-dir/hooks/overcommit-hook +4 -0
- data/template-dir/hooks/post-checkout +4 -0
- data/template-dir/hooks/post-commit +4 -0
- data/template-dir/hooks/post-merge +4 -0
- data/template-dir/hooks/post-rewrite +4 -0
- data/template-dir/hooks/pre-commit +4 -0
- data/template-dir/hooks/pre-push +4 -0
- data/template-dir/hooks/pre-rebase +4 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3062f9af5dd34f661b3a2fe4c57dff0455c58fc
|
4
|
+
data.tar.gz: 2a701f3f869be66540221aae63f3276f829b9d0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 863155a463f38f3fb09c915a61d7e91e175ebeda1da177076bcdf8fbadcda30ea5908995e227b15c8162bffab6ee0236224655196e03d214411f257c1acf1a39
|
7
|
+
data.tar.gz: 841020568579082d8887466e0b4089759fc36f89f8f498c12fe2eaeb319737a0406bec7c82bdec0646aa49a405b85e025f31c81602d352b54c9af6bfe442cd36
|
data/config/default.yml
CHANGED
@@ -43,7 +43,7 @@ plugin_directory: '.git-hooks'
|
|
43
43
|
# This is a defense mechanism when working with repositories which can contain
|
44
44
|
# untrusted code (e.g. when you fetch a pull request from a third party).
|
45
45
|
# See https://github.com/brigade/overcommit#security for more information.
|
46
|
-
|
46
|
+
verify_signatures: true
|
47
47
|
|
48
48
|
# Hooks that are run against every commit message after a user has written it.
|
49
49
|
# These hooks are useful for enforcing policies on commit messages written for a
|
@@ -322,6 +322,13 @@ PreCommit:
|
|
322
322
|
required_executable: 'grep'
|
323
323
|
flags: ['-IHn', "^<<<<<<<[ \t]"]
|
324
324
|
|
325
|
+
NginxTest:
|
326
|
+
enabled: false
|
327
|
+
description: 'Testing nginx configs'
|
328
|
+
required_executable: 'nginx'
|
329
|
+
flags: ['-t']
|
330
|
+
include: '**/nginx.conf'
|
331
|
+
|
325
332
|
Pep257:
|
326
333
|
enabled: false
|
327
334
|
description: 'Analyzing docstrings with pep257'
|
data/lib/overcommit/cli.rb
CHANGED
@@ -22,8 +22,8 @@ module Overcommit
|
|
22
22
|
install_or_uninstall
|
23
23
|
when :template_dir
|
24
24
|
print_template_directory_path
|
25
|
-
when :
|
26
|
-
|
25
|
+
when :sign
|
26
|
+
sign
|
27
27
|
when :run_all
|
28
28
|
run_all
|
29
29
|
end
|
@@ -95,9 +95,9 @@ module Overcommit
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def add_other_options(opts)
|
98
|
-
opts.on('-s', '--sign
|
99
|
-
@options[:
|
100
|
-
@options[:
|
98
|
+
opts.on('-s', '--sign', 'Update hook signatures') do |hook_to_sign|
|
99
|
+
@options[:hook_to_sign] = hook_to_sign if hook_to_sign.is_a?(String)
|
100
|
+
@options[:action] = :sign
|
101
101
|
end
|
102
102
|
|
103
103
|
opts.on('-t', '--template-dir', 'Print location of template directory') do
|
@@ -175,14 +175,20 @@ module Overcommit
|
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
|
-
def
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
178
|
+
def sign
|
179
|
+
if @options[:hook_to_sign]
|
180
|
+
context = Overcommit::HookContext.create(@options[:hook_to_sign],
|
181
|
+
config,
|
182
|
+
@arguments,
|
183
|
+
@input)
|
184
|
+
Overcommit::HookLoader::PluginHookLoader.new(config,
|
185
|
+
context,
|
186
|
+
log).update_signatures
|
187
|
+
else
|
188
|
+
log.log 'Updating signature for configuration file...'
|
189
|
+
config(verify: false).update_signature!
|
190
|
+
end
|
191
|
+
|
186
192
|
halt
|
187
193
|
end
|
188
194
|
|
@@ -204,8 +210,8 @@ module Overcommit
|
|
204
210
|
end
|
205
211
|
|
206
212
|
# Returns the configuration for this repository.
|
207
|
-
def config
|
208
|
-
@config ||= Overcommit::ConfigurationLoader.new(log).load_repo_config
|
213
|
+
def config(options = {})
|
214
|
+
@config ||= Overcommit::ConfigurationLoader.new(log, options).load_repo_config
|
209
215
|
end
|
210
216
|
end
|
211
217
|
end
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'digest'
|
2
|
+
require 'json'
|
3
|
+
|
1
4
|
module Overcommit
|
2
5
|
# Stores configuration for Overcommit and the hooks it runs.
|
3
6
|
class Configuration # rubocop:disable ClassLength
|
@@ -32,10 +35,6 @@ module Overcommit
|
|
32
35
|
File.join(Overcommit::Utils.repo_root, @hash['plugin_directory'] || '.git-hooks')
|
33
36
|
end
|
34
37
|
|
35
|
-
def verify_plugin_signatures?
|
36
|
-
@hash['verify_plugin_signatures'] != false
|
37
|
-
end
|
38
|
-
|
39
38
|
# Returns configuration for all hooks in each hook type.
|
40
39
|
#
|
41
40
|
# @return [Hash]
|
@@ -167,6 +166,63 @@ module Overcommit
|
|
167
166
|
File.exist?(File.join(plugin_directory, hook_type_name, "#{hook_name}.rb"))
|
168
167
|
end
|
169
168
|
|
169
|
+
# Return whether the signature for this configuration has changed since it
|
170
|
+
# was last calculated.
|
171
|
+
#
|
172
|
+
# @return [true,false]
|
173
|
+
def signature_changed?
|
174
|
+
signature != stored_signature
|
175
|
+
end
|
176
|
+
|
177
|
+
# Return whether a previous signature has been recorded for this
|
178
|
+
# configuration.
|
179
|
+
#
|
180
|
+
# @return [true,false]
|
181
|
+
def previous_signature?
|
182
|
+
!stored_signature.empty?
|
183
|
+
end
|
184
|
+
|
185
|
+
# Returns whether this configuration should verify itself by checking the
|
186
|
+
# stored configuration for the repo.
|
187
|
+
#
|
188
|
+
# @return [true,false]
|
189
|
+
def verify_signatures?
|
190
|
+
return false if ENV['OVERCOMMIT_NO_VERIFY']
|
191
|
+
return true if @hash['verify_signatures'] != false
|
192
|
+
|
193
|
+
result = Overcommit::Utils.execute(
|
194
|
+
%W[git config --local --get #{verify_signature_config_key}]
|
195
|
+
)
|
196
|
+
|
197
|
+
if result.status == 1 # Key doesn't exist
|
198
|
+
return true
|
199
|
+
elsif result.status != 0
|
200
|
+
raise Overcommit::Exceptions::GitConfigError,
|
201
|
+
"Unable to read from local repo git config: #{result.stderr}"
|
202
|
+
end
|
203
|
+
|
204
|
+
# We don't cast since we want to allow anything to count as "true" except
|
205
|
+
# a literal zero
|
206
|
+
result.stdout.strip != '0'
|
207
|
+
end
|
208
|
+
|
209
|
+
# Update the currently stored signature for this hook.
|
210
|
+
def update_signature!
|
211
|
+
result = Overcommit::Utils.execute(
|
212
|
+
%w[git config --local] + [signature_config_key, signature]
|
213
|
+
)
|
214
|
+
|
215
|
+
verify_signature_value = @hash['verify_signatures'] ? 1 : 0
|
216
|
+
result &&= Overcommit::Utils.execute(
|
217
|
+
%W[git config --local #{verify_signature_config_key} #{verify_signature_value}]
|
218
|
+
)
|
219
|
+
|
220
|
+
unless result.success?
|
221
|
+
raise Overcommit::Exceptions::GitConfigError,
|
222
|
+
"Unable to write to local repo git config: #{result.stderr}"
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
170
226
|
protected
|
171
227
|
|
172
228
|
attr_reader :hash
|
@@ -230,5 +286,41 @@ module Overcommit
|
|
230
286
|
end
|
231
287
|
end
|
232
288
|
end
|
289
|
+
|
290
|
+
# Returns the unique signature of this configuration.
|
291
|
+
#
|
292
|
+
# @return [String]
|
293
|
+
def signature
|
294
|
+
Digest::SHA256.hexdigest(@hash.to_json)
|
295
|
+
end
|
296
|
+
|
297
|
+
# Returns the stored signature of this repo's Overcommit configuration.
|
298
|
+
#
|
299
|
+
# This is intended to be compared against the current signature of this
|
300
|
+
# configuration object.
|
301
|
+
#
|
302
|
+
# @return [String]
|
303
|
+
def stored_signature
|
304
|
+
result = Overcommit::Utils.execute(
|
305
|
+
%w[git config --local --get] + [signature_config_key]
|
306
|
+
)
|
307
|
+
|
308
|
+
if result.status == 1 # Key doesn't exist
|
309
|
+
return ''
|
310
|
+
elsif result.status != 0
|
311
|
+
raise Overcommit::Exceptions::GitConfigError,
|
312
|
+
"Unable to read from local repo git config: #{result.stderr}"
|
313
|
+
end
|
314
|
+
|
315
|
+
result.stdout.chomp
|
316
|
+
end
|
317
|
+
|
318
|
+
def signature_config_key
|
319
|
+
'overcommit.configuration.signature'
|
320
|
+
end
|
321
|
+
|
322
|
+
def verify_signature_config_key
|
323
|
+
'overcommit.configuration.verifysignatures'
|
324
|
+
end
|
233
325
|
end
|
234
326
|
end
|
@@ -10,7 +10,7 @@ module Overcommit
|
|
10
10
|
#
|
11
11
|
# @return [Overcommit::Configuration]
|
12
12
|
def default_configuration
|
13
|
-
@default_config ||= load_from_file(DEFAULT_CONFIG_PATH, default: true)
|
13
|
+
@default_config ||= load_from_file(DEFAULT_CONFIG_PATH, default: true, verify: false)
|
14
14
|
end
|
15
15
|
|
16
16
|
# Loads configuration from file.
|
@@ -18,6 +18,7 @@ module Overcommit
|
|
18
18
|
# @param file [String] path to file
|
19
19
|
# @param options [Hash]
|
20
20
|
# @option default [Boolean] whether this is the default built-in configuration
|
21
|
+
# @option verify [Boolean] whether to verify the signature of the configuration
|
21
22
|
# @option logger [Overcommit::Logger]
|
22
23
|
# @return [Overcommit::Configuration]
|
23
24
|
def load_from_file(file, options = {})
|
@@ -34,8 +35,13 @@ module Overcommit
|
|
34
35
|
|
35
36
|
# Create a configuration loader which writes warnings/errors to the given
|
36
37
|
# {Overcommit::Logger} instance.
|
37
|
-
|
38
|
+
#
|
39
|
+
# @param logger [Overcommit::Logger]
|
40
|
+
# @param options [Hash]
|
41
|
+
# @option verify [Boolean] whether to verify signatures
|
42
|
+
def initialize(logger, options = {})
|
38
43
|
@log = logger
|
44
|
+
@options = options
|
39
45
|
end
|
40
46
|
|
41
47
|
# Loads and returns the configuration for the repository we're running in.
|
@@ -55,12 +61,32 @@ module Overcommit
|
|
55
61
|
# Loads a configuration, ensuring it extends the default configuration.
|
56
62
|
def load_file(file)
|
57
63
|
config = self.class.load_from_file(file, default: false, logger: @log)
|
64
|
+
config = self.class.default_configuration.merge(config)
|
65
|
+
|
66
|
+
if @options.fetch(:verify, config.verify_signatures?)
|
67
|
+
verify_signatures(config)
|
68
|
+
end
|
58
69
|
|
59
|
-
|
70
|
+
config
|
60
71
|
rescue => error
|
61
72
|
raise Overcommit::Exceptions::ConfigurationError,
|
62
73
|
"Unable to load configuration from '#{file}': #{error}",
|
63
74
|
error.backtrace
|
64
75
|
end
|
76
|
+
|
77
|
+
private
|
78
|
+
|
79
|
+
def verify_signatures(config)
|
80
|
+
if !config.previous_signature?
|
81
|
+
raise Overcommit::Exceptions::ConfigurationSignatureChanged,
|
82
|
+
"No previously recorded signature for configuration file.\n" \
|
83
|
+
'Run `overcommit --sign` if you trust the hooks in this repository.'
|
84
|
+
|
85
|
+
elsif config.signature_changed?
|
86
|
+
raise Overcommit::Exceptions::ConfigurationSignatureChanged,
|
87
|
+
"Signature of configuration file has changed!\n" \
|
88
|
+
"Run `overcommit --sign` once you've verified the configuration changes."
|
89
|
+
end
|
90
|
+
end
|
65
91
|
end
|
66
92
|
end
|
@@ -15,6 +15,7 @@ module Overcommit
|
|
15
15
|
hash = convert_nils_to_empty_hashes(hash)
|
16
16
|
ensure_hook_type_sections_exist(hash)
|
17
17
|
check_for_missing_enabled_option(hash) unless @options[:default]
|
18
|
+
check_for_verify_plugin_signatures_option(hash)
|
18
19
|
|
19
20
|
hash
|
20
21
|
end
|
@@ -68,5 +69,18 @@ module Overcommit
|
|
68
69
|
|
69
70
|
@log.newline if any_warnings
|
70
71
|
end
|
72
|
+
|
73
|
+
# Prints a warning if the `verify_plugin_signatures` option is used instead
|
74
|
+
# of the new `verify_signatures` option.
|
75
|
+
def check_for_verify_plugin_signatures_option(hash)
|
76
|
+
return unless @log
|
77
|
+
|
78
|
+
if hash.key?('verify_plugin_signatures')
|
79
|
+
@log.warning '`verify_plugin_signatures` has been renamed to ' \
|
80
|
+
'`verify_signatures`. Defaulting to verifying signatures.'
|
81
|
+
@log.warning "See change log at #{REPO_URL}/blob/v0.29.0/CHANGELOG.md for details."
|
82
|
+
@log.newline
|
83
|
+
end
|
84
|
+
end
|
71
85
|
end
|
72
86
|
end
|
@@ -2,6 +2,9 @@ module Overcommit::Exceptions
|
|
2
2
|
# Raised when a {Configuration} could not be loaded from a file.
|
3
3
|
class ConfigurationError < StandardError; end
|
4
4
|
|
5
|
+
# Raised when the Overcommit configuration file signature has changed.
|
6
|
+
class ConfigurationSignatureChanged < StandardError; end
|
7
|
+
|
5
8
|
# Raised when trying to read/write to/from the local repo git config fails.
|
6
9
|
class GitConfigError < StandardError; end
|
7
10
|
|
data/lib/overcommit/git_repo.rb
CHANGED
@@ -92,7 +92,7 @@ module Overcommit
|
|
92
92
|
refs = options[:refs]
|
93
93
|
subcmd = options[:subcmd] || 'diff'
|
94
94
|
|
95
|
-
`git #{subcmd} --name-only -z --diff-filter=
|
95
|
+
`git #{subcmd} --name-only -z --diff-filter=ACMR --ignore-submodules=all #{flags} #{refs}`.
|
96
96
|
split("\0").
|
97
97
|
map(&:strip).
|
98
98
|
reject(&:empty?).
|
data/lib/overcommit/hook/base.rb
CHANGED
@@ -153,7 +153,7 @@ module Overcommit::Hook
|
|
153
153
|
private
|
154
154
|
|
155
155
|
def applicable_file?(file)
|
156
|
-
includes = Array(@config['include']).map do |glob|
|
156
|
+
includes = Array(@config['include']).flatten.map do |glob|
|
157
157
|
Overcommit::Utils.convert_glob_to_absolute(glob)
|
158
158
|
end
|
159
159
|
|
@@ -161,7 +161,7 @@ module Overcommit::Hook
|
|
161
161
|
Overcommit::Utils.matches_path?(glob, file)
|
162
162
|
end
|
163
163
|
|
164
|
-
excludes = Array(@config['exclude']).map do |glob|
|
164
|
+
excludes = Array(@config['exclude']).flatten.map do |glob|
|
165
165
|
Overcommit::Utils.convert_glob_to_absolute(glob)
|
166
166
|
end
|
167
167
|
|
@@ -8,9 +8,10 @@ module Overcommit::Hook::PreCommit
|
|
8
8
|
result = execute(command, args: applicable_files)
|
9
9
|
return :pass if result.success?
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
# Exit status 2 = Code style errors; everything else we don't know how to
|
12
|
+
# parse. https://github.com/jscs-dev/node-jscs/wiki/Exit-codes
|
13
|
+
unless result.status == 2
|
14
|
+
return :fail, result.stdout + result.stderr.chomp
|
14
15
|
end
|
15
16
|
|
16
17
|
# example message:
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Overcommit::Hook::PreCommit
|
2
|
+
# Runs `nginx -t` against any modified Nginx config files.
|
3
|
+
#
|
4
|
+
# @see https://www.nginx.com/resources/wiki/start/topics/tutorials/commandline/
|
5
|
+
class NginxTest < Base
|
6
|
+
MESSAGE_REGEX = /^nginx: .+ in (?<file>.+):(?<line>\d+)$/
|
7
|
+
|
8
|
+
def run
|
9
|
+
messages = []
|
10
|
+
|
11
|
+
applicable_files.each do |file|
|
12
|
+
result = execute(command + ['-c', file])
|
13
|
+
next if result.success?
|
14
|
+
|
15
|
+
messages += extract_messages(
|
16
|
+
result.stderr.split("\n").grep(MESSAGE_REGEX),
|
17
|
+
MESSAGE_REGEX
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
messages
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -12,9 +12,10 @@ module Overcommit::Hook::PreCommit
|
|
12
12
|
|
13
13
|
def run
|
14
14
|
result = execute(command, args: applicable_files)
|
15
|
-
output = result.stdout.chomp
|
15
|
+
output = result.stdout.chomp + result.stderr.chomp
|
16
16
|
messages = output.split("\n").grep(MESSAGE_REGEX)
|
17
|
-
|
17
|
+
|
18
|
+
return [:fail, output] unless result.success? || messages.any?
|
18
19
|
|
19
20
|
# example message:
|
20
21
|
# error file=/path/to/file.scala message=Error message line=1 column=1
|
@@ -20,7 +20,11 @@ module Overcommit::HookContext
|
|
20
20
|
def commit_message_lines
|
21
21
|
raw_commit_message_lines.
|
22
22
|
take_while { |line| !line.start_with?('diff --git') }.
|
23
|
-
reject { |line| line
|
23
|
+
reject { |line| line.start_with?(comment_character) }
|
24
|
+
end
|
25
|
+
|
26
|
+
def comment_character
|
27
|
+
@comment_character ||= Overcommit::GitConfig.comment_character
|
24
28
|
end
|
25
29
|
|
26
30
|
def commit_message_file
|
@@ -5,7 +5,7 @@ module Overcommit::HookLoader
|
|
5
5
|
# is running in.
|
6
6
|
class PluginHookLoader < Base
|
7
7
|
def load_hooks
|
8
|
-
check_for_modified_plugins if @config.
|
8
|
+
check_for_modified_plugins if @config.verify_signatures?
|
9
9
|
|
10
10
|
hooks = plugin_paths.map do |plugin_path|
|
11
11
|
require plugin_path
|
@@ -35,8 +35,7 @@ module Overcommit
|
|
35
35
|
command = Array(hook_config['command'] ||
|
36
36
|
hook_config['required_executable'])
|
37
37
|
|
38
|
-
unless !@config.
|
39
|
-
signable_file?(command.first)
|
38
|
+
unless !@config.verify_signatures? || signable_file?(command.first)
|
40
39
|
raise Overcommit::Exceptions::InvalidHookDefinition,
|
41
40
|
'Hook must specify a `required_executable` or `command` that ' \
|
42
41
|
'is tracked by git (i.e. is a path relative to the root ' \
|
data/lib/overcommit/utils.rb
CHANGED
@@ -100,7 +100,7 @@ module Overcommit
|
|
100
100
|
|
101
101
|
# Converts a string containing underscores/hyphens/spaces into CamelCase.
|
102
102
|
def camel_case(str)
|
103
|
-
str.split(/_|-| /).map { |part| part.sub(/^\w
|
103
|
+
str.split(/_|-| /).map { |part| part.sub(/^\w/, &:upcase) }.join
|
104
104
|
end
|
105
105
|
|
106
106
|
# Returns a list of supported hook types (pre-commit, commit-msg, etc.)
|
data/lib/overcommit/version.rb
CHANGED
data/lib/overcommit.rb
CHANGED
@@ -10,6 +10,7 @@ require 'overcommit/configuration_loader'
|
|
10
10
|
require 'overcommit/hook/base'
|
11
11
|
require 'overcommit/hook_context/base'
|
12
12
|
require 'overcommit/hook_context'
|
13
|
+
require 'overcommit/git_config'
|
13
14
|
require 'overcommit/git_repo'
|
14
15
|
require 'overcommit/hook_signer'
|
15
16
|
require 'overcommit/hook_loader/base'
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
data/template-dir/hooks/pre-push
CHANGED
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
@@ -93,6 +93,10 @@ rescue Overcommit::Exceptions::HookCancelled
|
|
93
93
|
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
94
94
|
puts error
|
95
95
|
exit 64 # EX_USAGE
|
96
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
97
|
+
puts error
|
98
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
99
|
+
exit 1
|
96
100
|
rescue Overcommit::Exceptions::InvalidHookSignature
|
97
101
|
exit 1
|
98
102
|
rescue => error
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overcommit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.29.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brigade Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: childprocess
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/overcommit/configuration_validator.rb
|
88
88
|
- lib/overcommit/constants.rb
|
89
89
|
- lib/overcommit/exceptions.rb
|
90
|
+
- lib/overcommit/git_config.rb
|
90
91
|
- lib/overcommit/git_repo.rb
|
91
92
|
- lib/overcommit/git_version.rb
|
92
93
|
- lib/overcommit/hook/base.rb
|
@@ -154,6 +155,7 @@ files:
|
|
154
155
|
- lib/overcommit/hook/pre_commit/json_syntax.rb
|
155
156
|
- lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
|
156
157
|
- lib/overcommit/hook/pre_commit/merge_conflicts.rb
|
158
|
+
- lib/overcommit/hook/pre_commit/nginx_test.rb
|
157
159
|
- lib/overcommit/hook/pre_commit/pep257.rb
|
158
160
|
- lib/overcommit/hook/pre_commit/pep8.rb
|
159
161
|
- lib/overcommit/hook/pre_commit/puppet_lint.rb
|
@@ -248,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
250
|
version: '0'
|
249
251
|
requirements: []
|
250
252
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.4.
|
253
|
+
rubygems_version: 2.4.5.1
|
252
254
|
signing_key:
|
253
255
|
specification_version: 4
|
254
256
|
summary: Git hook manager
|