overcommit 0.34.0 → 0.34.1
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/lib/overcommit/version.rb +1 -1
- data/template-dir/hooks/commit-msg +115 -0
- data/template-dir/hooks/post-checkout +115 -0
- data/template-dir/hooks/post-commit +115 -0
- data/template-dir/hooks/post-merge +115 -0
- data/template-dir/hooks/post-rewrite +115 -0
- data/template-dir/hooks/pre-commit +115 -0
- data/template-dir/hooks/pre-push +115 -0
- data/template-dir/hooks/pre-rebase +115 -0
- metadata +2 -2
- data/template-dir/hooks/commit-msg +0 -1
- data/template-dir/hooks/post-checkout +0 -1
- data/template-dir/hooks/post-commit +0 -1
- data/template-dir/hooks/post-merge +0 -1
- data/template-dir/hooks/post-rewrite +0 -1
- data/template-dir/hooks/pre-commit +0 -1
- data/template-dir/hooks/pre-push +0 -1
- data/template-dir/hooks/pre-rebase +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e37c45497df46c477e3b21a4111f70f868fa11c3
|
4
|
+
data.tar.gz: 23e271c3acfd366933ad085a684c429ec2d2e7a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e33e92af91a21ba17b0667ff1fd5c48813051a982c7dcb0acfe1117c815df9ee70b567d22cf11e13a8872d50581e6c9a2663a5dc207b524fe997eb80d00a1895
|
7
|
+
data.tar.gz: b39235b068be5fcfb521a25913eb0fe8abcb7efe672d6584db5a6abcbd2150913d37536b99276a19d1eba47e8f98af7d305cc759a1b9291e66bab142d711ed9b
|
data/lib/overcommit/version.rb
CHANGED
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Entrypoint for Overcommit hook integration. Installing Overcommit will result
|
4
|
+
# in all of your git hooks being symlinked to this file, allowing the framework
|
5
|
+
# to manage your hooks for you.
|
6
|
+
|
7
|
+
# Prevent a Ruby stack trace from appearing when we interrupt the hook.
|
8
|
+
# Note that this will be overridden when Overcommit is loaded, since the
|
9
|
+
# InterruptHandler will redefine the trap at that time.
|
10
|
+
Signal.trap('INT') do
|
11
|
+
puts 'Hook run interrupted'
|
12
|
+
exit 130
|
13
|
+
end
|
14
|
+
|
15
|
+
# Allow hooks to be disabled via environment variable so git commands can be run
|
16
|
+
# in scripts without Overcommit running hooks
|
17
|
+
if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
|
18
|
+
exit
|
19
|
+
end
|
20
|
+
|
21
|
+
hook_type = File.basename($0)
|
22
|
+
if hook_type == 'overcommit-hook'
|
23
|
+
puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
|
24
|
+
"by each hook in a repository's .git/hooks directory."
|
25
|
+
exit 64 # EX_USAGE
|
26
|
+
end
|
27
|
+
|
28
|
+
# Check if Overcommit should invoke a Bundler context for loading gems
|
29
|
+
require 'yaml'
|
30
|
+
# rubocop:disable Style/RescueModifier
|
31
|
+
if gemfile = YAML.load_file('.overcommit.yml')['gemfile'] rescue nil
|
32
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
33
|
+
require 'bundler'
|
34
|
+
|
35
|
+
begin
|
36
|
+
Bundler.setup
|
37
|
+
rescue Bundler::BundlerError => ex
|
38
|
+
puts "Problem loading '#{gemfile}': #{ex.message}"
|
39
|
+
puts "Try running:\nbundle install --gemfile=#{gemfile}" if ex.is_a?(Bundler::GemNotFound)
|
40
|
+
exit 78 # EX_CONFIG
|
41
|
+
end
|
42
|
+
end
|
43
|
+
# rubocop:enable Style/RescueModifier
|
44
|
+
|
45
|
+
begin
|
46
|
+
require 'overcommit'
|
47
|
+
rescue LoadError
|
48
|
+
if gemfile
|
49
|
+
puts 'You have specified the `gemfile` option in your Overcommit ' \
|
50
|
+
'configuration but have not added the `overcommit` gem to ' \
|
51
|
+
"#{gemfile}."
|
52
|
+
else
|
53
|
+
puts 'This repository contains hooks installed by Overcommit, but the ' \
|
54
|
+
"`overcommit` gem is not installed.\n" \
|
55
|
+
'Install it with `gem install overcommit`.'
|
56
|
+
end
|
57
|
+
|
58
|
+
exit 64 # EX_USAGE
|
59
|
+
end
|
60
|
+
|
61
|
+
begin
|
62
|
+
logger = Overcommit::Logger.new(STDOUT)
|
63
|
+
Overcommit::Utils.log = logger
|
64
|
+
|
65
|
+
# Ensure master hook is up-to-date
|
66
|
+
installer = Overcommit::Installer.new(logger)
|
67
|
+
if installer.run(Overcommit::Utils.repo_root, action: :update)
|
68
|
+
exec($0, *ARGV) # Execute the updated hook with all original arguments
|
69
|
+
end
|
70
|
+
|
71
|
+
config = Overcommit::ConfigurationLoader.new(logger).load_repo_config
|
72
|
+
|
73
|
+
context = Overcommit::HookContext.create(hook_type, config, ARGV, STDIN)
|
74
|
+
config.apply_environment!(context, ENV)
|
75
|
+
|
76
|
+
printer = Overcommit::Printer.new(config, logger, context)
|
77
|
+
runner = Overcommit::HookRunner.new(config, logger, context, printer)
|
78
|
+
|
79
|
+
status = runner.run
|
80
|
+
|
81
|
+
exit(status ? 0 : 65) # 65 = EX_DATAERR
|
82
|
+
rescue Overcommit::Exceptions::ConfigurationError => error
|
83
|
+
puts error
|
84
|
+
exit 78 # EX_CONFIG
|
85
|
+
rescue Overcommit::Exceptions::HookContextLoadError => error
|
86
|
+
puts error
|
87
|
+
puts 'Are you running an old version of Overcommit?'
|
88
|
+
exit 69 # EX_UNAVAILABLE
|
89
|
+
rescue Overcommit::Exceptions::HookLoadError,
|
90
|
+
Overcommit::Exceptions::InvalidHookDefinition => error
|
91
|
+
puts error.message
|
92
|
+
puts error.backtrace
|
93
|
+
exit 78 # EX_CONFIG
|
94
|
+
rescue Overcommit::Exceptions::HookSetupFailed,
|
95
|
+
Overcommit::Exceptions::HookCleanupFailed => error
|
96
|
+
puts error.message
|
97
|
+
exit 74 # EX_IOERR
|
98
|
+
rescue Overcommit::Exceptions::HookCancelled
|
99
|
+
puts 'You cancelled the hook run'
|
100
|
+
exit 130 # Ctrl-C cancel
|
101
|
+
rescue Overcommit::Exceptions::InvalidGitRepo => error
|
102
|
+
puts error
|
103
|
+
exit 64 # EX_USAGE
|
104
|
+
rescue Overcommit::Exceptions::ConfigurationSignatureChanged => error
|
105
|
+
puts error
|
106
|
+
puts "For more information, see #{Overcommit::REPO_URL}#security"
|
107
|
+
exit 1
|
108
|
+
rescue Overcommit::Exceptions::InvalidHookSignature
|
109
|
+
exit 1
|
110
|
+
rescue => error
|
111
|
+
puts error.message
|
112
|
+
puts error.backtrace
|
113
|
+
puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
|
114
|
+
exit 70 # EX_SOFTWARE
|
115
|
+
end
|
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.34.
|
4
|
+
version: 0.34.1
|
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: 2016-06-
|
12
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: childprocess
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
data/template-dir/hooks/pre-push
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|
@@ -1 +0,0 @@
|
|
1
|
-
overcommit-hook
|