Run commit-msg hook on new, edit, refresh -e, squash
commit38db136a7fc6b3ad5fb73df6234a6a81ad4e9928
authorZane Bitter <zbitter@redhat.com>
Tue, 26 Jul 2016 14:49:35 +0000 (26 10:49 -0400)
committerCatalin Marinas <catalin.marinas@gmail.com>
Wed, 30 Nov 2016 16:57:07 +0000 (30 16:57 +0000)
treea9919209439275846543275d077d2b13f35dca3a
parent575a3b19bf64dc8b16be7eaef12b0f84fa41a1f4
Run commit-msg hook on new, edit, refresh -e, squash

If the Git "commit-msg" hook exists, call it on the commit message after
editing when doing "stg new", "stg squash", "stg refresh -e", or "stg edit"
(including in non-interactive mode, e.g. when running "stg edit --sign").

The CLI option --no-verify is also added to these commands to bypass the
hook, consistent with "git commit --no-verify".

(This simplifies the workflow for Gerrit, by allowing the Change-Id line to
be inserted with the commit-msg hook using stgit.)

Fixes bug #18806.

Signed-off-by: Zane Bitter <zbitter@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/argparse.py
stgit/commands/common.py
stgit/commands/edit.py
stgit/commands/new.py
stgit/commands/refresh.py
stgit/commands/squash.py
stgit/lib/git.py