]> git.ipfire.org Git - thirdparty/git.git/commit - git-p4.py
git-p4: add p4 submit hooks
authorBen Keene <seraphire@gmail.com>
Fri, 14 Feb 2020 14:44:45 +0000 (14:44 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2020 16:58:53 +0000 (08:58 -0800)
commit38ecf75244c4cab93ecb201afff8980c29f56ce8
tree5a3a553c8b6357371de9c4050371d6b0f997e8ed
parentcd1e0dc47a5ab1520b823d051d23f60c89072349
git-p4: add p4 submit hooks

The git command "commit" supports a number of hooks that support
changing the behavior of the commit command.  The git-p4.py program only
has one existing hook, "p4-pre-submit".  This command occurs early in
the process.  There are no hooks in the process flow for modifying
the P4 changelist text programmatically.

Adds 3 new hooks to git-p4.py to the submit option.

The new hooks are:
* p4-prepare-changelist - Execute this hook after the changelist file
  has been created. The hook will be executed even if the
  --prepare-p4-only option is set.  This hook ignores the --no-verify
  option in keeping with the existing behavior of git commit.

* p4-changelist - Execute this hook after the user has edited the
  changelist. Do not execute this hook if the user has selected the
  --prepare-p4-only option. This hook will honor the --no-verify,
  following the conventions of git commit.

* p4-post-changelist - Execute this hook after the P4 submission process
  has completed successfully. This hook takes no parameters and is
  executed regardless of the --no-verify option.  It's return value will
  not be checked.

The calls to the new hooks: p4-prepare-changelist, p4-changelist,
and p4-post-changelist should all be called inside the try-finally
block.

Signed-off-by: Ben Keene <seraphire@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-p4.txt
Documentation/githooks.txt
git-p4.py