Sha256: 8f41229a7e911ce15e77844d64ec291eeaa436b44534f5cb37bbde1121783a00

Contents?: true

Size: 677 Bytes

Versions: 12

Compression:

Stored size: 677 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.
  class GerritChangeId < Base
    SCRIPT_LOCATION = Overcommit::Utils.script_path('gerrit-change-id')

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

      [:fail, result.stdout]
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
overcommit-0.25.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.24.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.23.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.22.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
jawshooah-overcommit-0.22.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.21.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.20.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.19.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.18.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.17.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.16.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb
overcommit-0.15.0 lib/overcommit/hook/commit_msg/gerrit_change_id.rb