On Fri, Jul 27, 2018 at 7:22 AM Chen Bin <chenbin.sh@xxxxxxxxx> wrote: > The `p4-pre-submit` hook is executed before git-p4 submits code. > If the hook exits with non-zero value, submit process not start. > > Signed-off-by: Chen Bin <chenbin.sh@xxxxxxxxx> > --- > diff --git a/git-p4.py b/git-p4.py > @@ -1494,7 +1494,13 @@ def __init__(self): > - self.description = "Submit changes from git to the perforce depot." > + self.description = """Submit changes from git to the perforce depot.\n It seemed odd to have an explicit \n within a """...""" string as opposed to simply using a blank line, but I see there is existing precedence in git-p4.py when setting (at least one) self.description. Okay. > + The `p4-pre-submit` hook is executed if it exists and is executable. > + The hook takes no parameter and nothing from standard input. Exiting with > + non-zero status from this script prevents `git-p4 submit` from launching. > + > + One usage scenario is to run unit tests in the hook."""