#!/usr/bin/env python

# https://github.com/git/git/blob/master/Documentation/githooks.txt#L114
# This hook is invoked by 'git commit', and can be bypassed
# with `--no-verify` option.  It takes a single parameter, the
# name of the file that holds the proposed commit log message.
# Exiting with non-zero status causes the 'git commit' to
# abort.
# 
# The hook is allowed to edit the message file in place, and can
# be used to normalize the message into some project standard
# format (if the project has one). It can also be used to refuse
# the commit after inspecting the message file.
# 
# The default 'commit-msg' hook, when enabled, detects duplicate
# "Signed-off-by" lines, and aborts the commit if one is found.
import gitta_hook
import sys
sys.argv.extend(sys.stdin.read().split())  # add stdin arguments
commit_msg_path = sys.argv[1]
kwargs = {'commit_msg_path': commit_msg_path}
gitta_hook.trigger(*sys.argv, **kwargs)

