Sha256: 43d5a9c6edf3d5d8d29bec89e76278c84452859a7d1907350a3a4a2af9a66ba4

Contents?: true

Size: 730 Bytes

Versions: 28

Compression:

Stored size: 730 Bytes

Contents

module Overcommit::Hook::CommitMsg
  # Ensures a Gerrit Change-Id line is included in the commit message.
  #
  # It may seem odd to do this here instead of in a prepare-commit-msg hook, but
  # the reality is that if you want to _ensure_ the Change-Id is included then
  # you need to do it in a commit-msg hook. This is because the user could still
  # edit the message after a prepare-commit-msg hook was run.
  #
  # @see https://code.google.com/p/gerrit/
  class GerritChangeId < Base
    SCRIPT_LOCATION = Overcommit::Utils.script_path('gerrit-change-id')

    def run
      result = execute(['sh', SCRIPT_LOCATION, commit_message_file])
      return :pass if result.success?

      [:fail, result.stdout]
    end
  end
end

Version data entries

28 entries across 26 versions & 2 rubygems

Version Path
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/commit_msg/gerrit_change_id.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/commit_msg/gerrit_change_id.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/commit_msg/gerrit_change_id.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/overcommit-0.46.0/lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.46.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.45.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.44.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.43.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.42.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.41.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.40.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.39.1 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.39.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.38.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.37.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.36.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.35.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.34.2 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.34.1 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.34.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb