3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.34.1.182.ge773545c7f
10 .TH "GITHOOKS" "5" "12/10/2021" "Git 2\&.34\&.1\&.182\&.ge77354" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 githooks \- Hooks used by Git
34 $GIT_DIR/hooks/* (or `git config core\&.hooksPath`/*)
37 Hooks are programs you can place in a hooks directory to trigger actions at certain points in git\(cqs execution\&. Hooks that don\(cqt have the executable bit set are ignored\&.
39 By default the hooks directory is \fB$GIT_DIR/hooks\fR, but that can be changed via the \fBcore\&.hooksPath\fR configuration variable (see \fBgit-config\fR(1))\&.
41 Before Git invokes a hook, it changes its working directory to either $GIT_DIR in a bare repository or the root of the working tree in a non\-bare repository\&. An exception are hooks triggered during a push (\fIpre\-receive\fR, \fIupdate\fR, \fIpost\-receive\fR, \fIpost\-update\fR, \fIpush\-to\-checkout\fR) which are always executed in $GIT_DIR\&.
43 Hooks can get their arguments via the environment, command\-line arguments, and stdin\&. See the documentation for each hook below for details\&.
45 \fBgit init\fR may copy hooks to the new repository, depending on its configuration\&. See the "TEMPLATE DIRECTORY" section in \fBgit-init\fR(1) for details\&. When the rest of this document refers to "default hooks" it\(cqs talking about the default template shipped with Git\&.
47 The currently supported hooks are described below\&.
51 This hook is invoked by \fBgit-am\fR(1)\&. It takes a single parameter, the name of the file that holds the proposed commit log message\&. Exiting with a non\-zero status causes \fBgit am\fR to abort before applying the patch\&.
53 The hook is allowed to edit the message file in place, and can be used to normalize the message into some project standard format\&. It can also be used to refuse the commit after inspecting the message file\&.
55 The default \fIapplypatch\-msg\fR hook, when enabled, runs the \fIcommit\-msg\fR hook, if the latter is enabled\&.
58 This hook is invoked by \fBgit-am\fR(1)\&. It takes no parameter, and is invoked after the patch is applied, but before a commit is made\&.
60 If it exits with non\-zero status, then the working tree will not be committed after applying the patch\&.
62 It can be used to inspect the current working tree and refuse to make a commit if it does not pass certain test\&.
64 The default \fIpre\-applypatch\fR hook, when enabled, runs the \fIpre\-commit\fR hook, if the latter is enabled\&.
65 .SS "post\-applypatch"
67 This hook is invoked by \fBgit-am\fR(1)\&. It takes no parameter, and is invoked after the patch is applied and a commit is made\&.
69 This hook is meant primarily for notification, and cannot affect the outcome of \fBgit am\fR\&.
72 This hook is invoked by \fBgit-commit\fR(1), and can be bypassed with the \fB\-\-no\-verify\fR option\&. It takes no parameters, and is invoked before obtaining the proposed commit log message and making a commit\&. Exiting with a non\-zero status from this script causes the \fBgit commit\fR command to abort before creating a commit\&.
74 The default \fIpre\-commit\fR hook, when enabled, catches introduction of lines with trailing whitespaces and aborts the commit when such a line is found\&.
76 All the \fBgit commit\fR hooks are invoked with the environment variable \fBGIT_EDITOR=:\fR if the command will not bring up an editor to modify the commit message\&.
78 The default \fIpre\-commit\fR hook, when enabled\(emand with the \fBhooks\&.allownonascii\fR config option unset or set to false\(emprevents the use of non\-ASCII filenames\&.
79 .SS "pre\-merge\-commit"
81 This hook is invoked by \fBgit-merge\fR(1), and can be bypassed with the \fB\-\-no\-verify\fR option\&. It takes no parameters, and is invoked after the merge has been carried out successfully and before obtaining the proposed commit log message to make a commit\&. Exiting with a non\-zero status from this script causes the \fBgit merge\fR command to abort before creating a commit\&.
83 The default \fIpre\-merge\-commit\fR hook, when enabled, runs the \fIpre\-commit\fR hook, if the latter is enabled\&.
85 This hook is invoked with the environment variable \fBGIT_EDITOR=:\fR if the command will not bring up an editor to modify the commit message\&.
87 If the merge cannot be carried out automatically, the conflicts need to be resolved and the result committed separately (see \fBgit-merge\fR(1))\&. At that point, this hook will not be executed, but the \fIpre\-commit\fR hook will, if it is enabled\&.
88 .SS "prepare\-commit\-msg"
90 This hook is invoked by \fBgit-commit\fR(1) right after preparing the default log message, and before the editor is started\&.
92 It takes one to three parameters\&. The first is the name of the file that contains the commit log message\&. The second is the source of the commit message, and can be: \fBmessage\fR (if a \fB\-m\fR or \fB\-F\fR option was given); \fBtemplate\fR (if a \fB\-t\fR option was given or the configuration option \fBcommit\&.template\fR is set); \fBmerge\fR (if the commit is a merge or a \fB\&.git/MERGE_MSG\fR file exists); \fBsquash\fR (if a \fB\&.git/SQUASH_MSG\fR file exists); or \fBcommit\fR, followed by a commit object name (if a \fB\-c\fR, \fB\-C\fR or \fB\-\-amend\fR option was given)\&.
94 If the exit status is non\-zero, \fBgit commit\fR will abort\&.
96 The purpose of the hook is to edit the message file in place, and it is not suppressed by the \fB\-\-no\-verify\fR option\&. A non\-zero exit means a failure of the hook and aborts the commit\&. It should not be used as replacement for pre\-commit hook\&.
98 The sample \fBprepare\-commit\-msg\fR hook that comes with Git removes the help message found in the commented portion of the commit template\&.
101 This hook is invoked by \fBgit-commit\fR(1) and \fBgit-merge\fR(1), and can be bypassed with the \fB\-\-no\-verify\fR option\&. It takes a single parameter, the name of the file that holds the proposed commit log message\&. Exiting with a non\-zero status causes the command to abort\&.
103 The hook is allowed to edit the message file in place, and can be used to normalize the message into some project standard format\&. It can also be used to refuse the commit after inspecting the message file\&.
105 The default \fIcommit\-msg\fR hook, when enabled, detects duplicate \fBSigned\-off\-by\fR trailers, and aborts the commit if one is found\&.
108 This hook is invoked by \fBgit-commit\fR(1)\&. It takes no parameters, and is invoked after a commit is made\&.
110 This hook is meant primarily for notification, and cannot affect the outcome of \fBgit commit\fR\&.
113 This hook is called by \fBgit-rebase\fR(1) and can be used to prevent a branch from getting rebased\&. The hook may be called with one or two parameters\&. The first parameter is the upstream from which the series was forked\&. The second parameter is the branch being rebased, and is not set when rebasing the current branch\&.
116 This hook is invoked when a \fBgit-checkout\fR(1) or \fBgit-switch\fR(1) is run after having updated the worktree\&. The hook is given three parameters: the ref of the previous HEAD, the ref of the new HEAD (which may or may not have changed), and a flag indicating whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0)\&. This hook cannot affect the outcome of \fBgit switch\fR or \fBgit checkout\fR, other than that the hook\(cqs exit status becomes the exit status of these two commands\&.
118 It is also run after \fBgit-clone\fR(1), unless the \fB\-\-no\-checkout\fR (\fB\-n\fR) option is used\&. The first parameter given to the hook is the null\-ref, the second the ref of the new HEAD and the flag is always 1\&. Likewise for \fBgit worktree add\fR unless \fB\-\-no\-checkout\fR is used\&.
120 This hook can be used to perform repository validity checks, auto\-display differences from the previous HEAD if different, or set working dir metadata properties\&.
123 This hook is invoked by \fBgit-merge\fR(1), which happens when a \fBgit pull\fR is done on a local repository\&. The hook takes a single parameter, a status flag specifying whether or not the merge being done was a squash merge\&. This hook cannot affect the outcome of \fBgit merge\fR and is not executed, if the merge failed due to conflicts\&.
125 This hook can be used in conjunction with a corresponding pre\-commit hook to save and restore any form of metadata associated with the working tree (e\&.g\&.: permissions/ownership, ACLS, etc)\&. See contrib/hooks/setgitperms\&.perl for an example of how to do this\&.
128 This hook is called by \fBgit-push\fR(1) and can be used to prevent a push from taking place\&. The hook is called with two parameters which provide the name and location of the destination remote, if a named remote is not being used both values will be the same\&.
130 Information about what is to be pushed is provided on the hook\(cqs standard input with lines of the form:
136 <local ref> SP <local object name> SP <remote ref> SP <remote object name> LF
142 For instance, if the command \fBgit push origin master:foreign\fR were run the hook would receive a line like the following:
148 refs/heads/master 67890 refs/heads/foreign 12345
154 although the full object name would be supplied\&. If the foreign ref does not yet exist the \fB<remote object name>\fR will be the all\-zeroes object name\&. If a ref is to be deleted, the \fB<local ref>\fR will be supplied as \fB(delete)\fR and the \fB<local object name>\fR will be the all\-zeroes object name\&. If the local commit was specified by something other than a name which could be expanded (such as \fBHEAD~\fR, or an object name) it will be supplied as it was originally given\&.
156 If this hook exits with a non\-zero status, \fBgit push\fR will abort without pushing anything\&. Information about why the push is rejected may be sent to the user by writing to standard error\&.
159 This hook is invoked by \fBgit-receive-pack\fR(1) when it reacts to \fBgit push\fR and updates reference(s) in its repository\&. Just before starting to update refs on the remote repository, the pre\-receive hook is invoked\&. Its exit status determines the success or failure of the update\&.
161 This hook executes once for the receive operation\&. It takes no arguments, but for each ref to be updated it receives on standard input a line of the format:
167 <old\-value> SP <new\-value> SP <ref\-name> LF
173 where \fB<old\-value>\fR is the old object name stored in the ref, \fB<new\-value>\fR is the new object name to be stored in the ref and \fB<ref\-name>\fR is the full name of the ref\&. When creating a new ref, \fB<old\-value>\fR is the all\-zeroes object name\&.
175 If the hook exits with non\-zero status, none of the refs will be updated\&. If the hook exits with zero, updating of individual refs can still be prevented by the \fIupdate\fR hook\&.
177 Both standard output and standard error output are forwarded to \fBgit send\-pack\fR on the other end, so you can simply \fBecho\fR messages for the user\&.
179 The number of push options given on the command line of \fBgit push \-\-push\-option=\&.\&.\&.\fR can be read from the environment variable \fBGIT_PUSH_OPTION_COUNT\fR, and the options themselves are found in \fBGIT_PUSH_OPTION_0\fR, \fBGIT_PUSH_OPTION_1\fR,\&... If it is negotiated to not use the push options phase, the environment variables will not be set\&. If the client selects to use push options, but doesn\(cqt transmit any, the count variable will be set to zero, \fBGIT_PUSH_OPTION_COUNT=0\fR\&.
181 See the section on "Quarantine Environment" in \fBgit-receive-pack\fR(1) for some caveats\&.
184 This hook is invoked by \fBgit-receive-pack\fR(1) when it reacts to \fBgit push\fR and updates reference(s) in its repository\&. Just before updating the ref on the remote repository, the update hook is invoked\&. Its exit status determines the success or failure of the ref update\&.
186 The hook executes once for each ref to be updated, and takes three parameters:
196 the name of the ref being updated,
207 the old object name stored in the ref,
218 and the new object name to be stored in the ref\&.
221 A zero exit from the update hook allows the ref to be updated\&. Exiting with a non\-zero status prevents \fBgit receive\-pack\fR from updating that ref\&.
223 This hook can be used to prevent \fIforced\fR update on certain refs by making sure that the object name is a commit object that is a descendant of the commit object named by the old object name\&. That is, to enforce a "fast\-forward only" policy\&.
225 It could also be used to log the old\&.\&.new status\&. However, it does not know the entire set of branches, so it would end up firing one e\-mail per ref when used naively, though\&. The \fIpost\-receive\fR hook is more suited to that\&.
227 In an environment that restricts the users\(aq access only to git commands over the wire, this hook can be used to implement access control without relying on filesystem ownership and group membership\&. See \fBgit-shell\fR(1) for how you might use the login shell to restrict the user\(cqs access to only git commands\&.
229 Both standard output and standard error output are forwarded to \fBgit send\-pack\fR on the other end, so you can simply \fBecho\fR messages for the user\&.
231 The default \fIupdate\fR hook, when enabled\(emand with \fBhooks\&.allowunannotated\fR config option unset or set to false\(emprevents unannotated tags to be pushed\&.
234 This hook is invoked by \fBgit-receive-pack\fR(1)\&. If the server has set the multi\-valued config variable \fBreceive\&.procReceiveRefs\fR, and the commands sent to \fIreceive\-pack\fR have matching reference names, these commands will be executed by this hook, instead of by the internal \fBexecute_commands()\fR function\&. This hook is responsible for updating the relevant references and reporting the results back to \fIreceive\-pack\fR\&.
236 This hook executes once for the receive operation\&. It takes no arguments, but uses a pkt\-line format protocol to communicate with \fIreceive\-pack\fR to read commands, push\-options and send results\&. In the following example for the protocol, the letter \fIS\fR stands for \fIreceive\-pack\fR and the letter \fIH\fR stands for this hook\&.
242 # Version and features negotiation\&.
243 S: PKT\-LINE(version=1\e0push\-options atomic\&.\&.\&.)
245 H: PKT\-LINE(version=1\e0push\-options\&.\&.\&.)
256 # Send commands from server to the hook\&.
257 S: PKT\-LINE(<old\-oid> <new\-oid> <ref>)
258 S: \&.\&.\&. \&.\&.\&.
260 # Send push\-options only if the \(aqpush\-options\(aq feature is enabled\&.
261 S: PKT\-LINE(push\-option)
262 S: \&.\&.\&. \&.\&.\&.
273 # Receive result from the hook\&.
274 # OK, run this command successfully\&.
275 H: PKT\-LINE(ok <ref>)
277 H: PKT\-LINE(ng <ref> <reason>)
278 # Fall through, let \(aqreceive\-pack\(aq to execute it\&.
279 H: PKT\-LINE(ok <ref>)
280 H: PKT\-LINE(option fall\-through)
281 # OK, but has an alternate reference\&. The alternate reference name
282 # and other status can be given in option directives\&.
283 H: PKT\-LINE(ok <ref>)
284 H: PKT\-LINE(option refname <refname>)
285 H: PKT\-LINE(option old\-oid <old\-oid>)
286 H: PKT\-LINE(option new\-oid <new\-oid>)
287 H: PKT\-LINE(option forced\-update)
288 H: \&.\&.\&. \&.\&.\&.
295 Each command for the \fIproc\-receive\fR hook may point to a pseudo\-reference and always has a zero\-old as its old\-oid, while the \fIproc\-receive\fR hook may update an alternate reference and the alternate reference may exist already with a non\-zero old\-oid\&. For this case, this hook will use "option" directives to report extended attributes for the reference given by the leading "ok" directive\&.
297 The report of the commands of this hook should have the same order as the input\&. The exit status of the \fIproc\-receive\fR hook only determines the success or failure of the group of commands sent to it, unless atomic push is in use\&.
300 This hook is invoked by \fBgit-receive-pack\fR(1) when it reacts to \fBgit push\fR and updates reference(s) in its repository\&. It executes on the remote repository once after all the refs have been updated\&.
302 This hook executes once for the receive operation\&. It takes no arguments, but gets the same information as the \fIpre\-receive\fR hook does on its standard input\&.
304 This hook does not affect the outcome of \fBgit receive\-pack\fR, as it is called after the real work is done\&.
306 This supersedes the \fIpost\-update\fR hook in that it gets both old and new values of all the refs in addition to their names\&.
308 Both standard output and standard error output are forwarded to \fBgit send\-pack\fR on the other end, so you can simply \fBecho\fR messages for the user\&.
310 The default \fIpost\-receive\fR hook is empty, but there is a sample script \fBpost\-receive\-email\fR provided in the \fBcontrib/hooks\fR directory in Git distribution, which implements sending commit emails\&.
312 The number of push options given on the command line of \fBgit push \-\-push\-option=\&.\&.\&.\fR can be read from the environment variable \fBGIT_PUSH_OPTION_COUNT\fR, and the options themselves are found in \fBGIT_PUSH_OPTION_0\fR, \fBGIT_PUSH_OPTION_1\fR,\&... If it is negotiated to not use the push options phase, the environment variables will not be set\&. If the client selects to use push options, but doesn\(cqt transmit any, the count variable will be set to zero, \fBGIT_PUSH_OPTION_COUNT=0\fR\&.
315 This hook is invoked by \fBgit-receive-pack\fR(1) when it reacts to \fBgit push\fR and updates reference(s) in its repository\&. It executes on the remote repository once after all the refs have been updated\&.
317 It takes a variable number of parameters, each of which is the name of ref that was actually updated\&.
319 This hook is meant primarily for notification, and cannot affect the outcome of \fBgit receive\-pack\fR\&.
321 The \fIpost\-update\fR hook can tell what are the heads that were pushed, but it does not know what their original and updated values are, so it is a poor place to do log old\&.\&.new\&. The \fIpost\-receive\fR hook does get both original and updated values of the refs\&. You might consider it instead if you need them\&.
323 When enabled, the default \fIpost\-update\fR hook runs \fBgit update\-server\-info\fR to keep the information used by dumb transports (e\&.g\&., HTTP) up to date\&. If you are publishing a Git repository that is accessible via HTTP, you should probably enable this hook\&.
325 Both standard output and standard error output are forwarded to \fBgit send\-pack\fR on the other end, so you can simply \fBecho\fR messages for the user\&.
326 .SS "reference\-transaction"
328 This hook is invoked by any Git command that performs reference updates\&. It executes whenever a reference transaction is prepared, committed or aborted and may thus get called multiple times\&. The hook does not cover symbolic references (but that may change in the future)\&.
330 The hook takes exactly one argument, which is the current state the given reference transaction is in:
340 "prepared": All reference updates have been queued to the transaction and references were locked on disk\&.
351 "committed": The reference transaction was committed and all references now have their respective new value\&.
362 "aborted": The reference transaction was aborted, no changes were performed and the locks have been released\&.
365 For each reference update that was added to the transaction, the hook receives on standard input a line of the format:
371 <old\-value> SP <new\-value> SP <ref\-name> LF
377 where \fB<old\-value>\fR is the old object name passed into the reference transaction, \fB<new\-value>\fR is the new object name to be stored in the ref and \fB<ref\-name>\fR is the full name of the ref\&. When force updating the reference regardless of its current value or when the reference is to be created anew, \fB<old\-value>\fR is the all\-zeroes object name\&. To distinguish these cases, you can inspect the current value of \fB<ref\-name>\fR via \fBgit rev\-parse\fR\&.
379 The exit status of the hook is ignored for any state except for the "prepared" state\&. In the "prepared" state, a non\-zero exit status will cause the transaction to be aborted\&. The hook will not be called with "aborted" state in that case\&.
380 .SS "push\-to\-checkout"
382 This hook is invoked by \fBgit-receive-pack\fR(1) when it reacts to \fBgit push\fR and updates reference(s) in its repository, and when the push tries to update the branch that is currently checked out and the \fBreceive\&.denyCurrentBranch\fR configuration variable is set to \fBupdateInstead\fR\&. Such a push by default is refused if the working tree and the index of the remote repository has any difference from the currently checked out commit; when both the working tree and the index match the current commit, they are updated to match the newly pushed tip of the branch\&. This hook is to be used to override the default behaviour\&.
384 The hook receives the commit with which the tip of the current branch is going to be updated\&. It can exit with a non\-zero status to refuse the push (when it does so, it must not modify the index or the working tree)\&. Or it can make any necessary changes to the working tree and to the index to bring them to the desired state when the tip of the current branch is updated to the new commit, and exit with a zero status\&.
386 For example, the hook can simply run \fBgit read\-tree \-u \-m HEAD "$1"\fR in order to emulate \fBgit fetch\fR that is run in the reverse direction with \fBgit push\fR, as the two\-tree form of \fBgit read\-tree \-u \-m\fR is essentially the same as \fBgit switch\fR or \fBgit checkout\fR that switches branches while keeping the local changes in the working tree that do not interfere with the difference between the branches\&.
389 This hook is invoked by \fBgit gc \-\-auto\fR (see \fBgit-gc\fR(1))\&. It takes no parameter, and exiting with non\-zero status from this script causes the \fBgit gc \-\-auto\fR to abort\&.
392 This hook is invoked by commands that rewrite commits (\fBgit-commit\fR(1) when called with \fB\-\-amend\fR and \fBgit-rebase\fR(1); however, full\-history (re)writing tools like \fBgit-fast-import\fR(1) or \m[blue]\fBgit\-filter\-repo\fR\m[]\&\s-2\u[1]\d\s+2 typically do not call it!)\&. Its first argument denotes the command it was invoked by: currently one of \fBamend\fR or \fBrebase\fR\&. Further command\-dependent arguments may be passed in the future\&.
394 The hook receives a list of the rewritten commits on stdin, in the format
400 <old\-object\-name> SP <new\-object\-name> [ SP <extra\-info> ] LF
406 The \fIextra\-info\fR is again command\-dependent\&. If it is empty, the preceding SP is also omitted\&. Currently, no commands pass any \fIextra\-info\fR\&.
408 The hook always runs after the automatic note copying (see "notes\&.rewrite\&.<command>" in \fBgit-config\fR(1)) has happened, and thus has access to these notes\&.
410 The following command\-specific comments apply:
418 operation, all commits that were squashed are listed as being rewritten to the squashed commit\&. This means that there will be several lines sharing the same
419 \fInew\-object\-name\fR\&.
421 The commits are guaranteed to be listed in the order that they were processed by rebase\&.
423 .SS "sendemail\-validate"
425 This hook is invoked by \fBgit-send-email\fR(1)\&. It takes a single parameter, the name of the file that holds the e\-mail to be sent\&. Exiting with a non\-zero status causes \fBgit send\-email\fR to abort before sending any e\-mails\&.
426 .SS "fsmonitor\-watchman"
428 This hook is invoked when the configuration option \fBcore\&.fsmonitor\fR is set to \fB\&.git/hooks/fsmonitor\-watchman\fR or \fB\&.git/hooks/fsmonitor\-watchmanv2\fR depending on the version of the hook to use\&.
430 Version 1 takes two arguments, a version (1) and the time in elapsed nanoseconds since midnight, January 1, 1970\&.
432 Version 2 takes two arguments, a version (2) and a token that is used for identifying changes since the token\&. For watchman this would be a clock id\&. This version must output to stdout the new token followed by a NUL before the list of files\&.
434 The hook should output to stdout the list of all files in the working directory that may have changed since the requested time\&. The logic should be inclusive so that it does not miss any potential changes\&. The paths should be relative to the root of the working directory and be separated by a single NUL\&.
436 It is OK to include files which have not actually changed\&. All changes including newly\-created and deleted files should be included\&. When files are renamed, both the old and the new name should be included\&.
438 Git will limit what files it checks for changes as well as which directories are checked for untracked files based on the path names given\&.
440 An optimized way to tell git "all files have changed" is to return the filename \fB/\fR\&.
442 The exit status determines whether git will use the data from the hook to limit its search\&. On error, it will fall back to verifying all files and folders\&.
445 This hook is invoked by \fBgit\-p4 submit\fR\&.
447 The \fBp4\-changelist\fR hook is executed after the changelist message has been edited by the user\&. It can be bypassed with the \fB\-\-no\-verify\fR option\&. It takes a single parameter, the name of the file that holds the proposed changelist text\&. Exiting with a non\-zero status causes the command to abort\&.
449 The hook is allowed to edit the changelist file and can be used to normalize the text into some project standard format\&. It can also be used to refuse the Submit after inspect the message file\&.
451 Run \fBgit\-p4 submit \-\-help\fR for details\&.
452 .SS "p4\-prepare\-changelist"
454 This hook is invoked by \fBgit\-p4 submit\fR\&.
456 The \fBp4\-prepare\-changelist\fR hook is executed right after preparing the default changelist message and before the editor is started\&. It takes one parameter, the name of the file that contains the changelist text\&. Exiting with a non\-zero status from the script will abort the process\&.
458 The purpose of the hook is to edit the message file in place, and it is not suppressed by the \fB\-\-no\-verify\fR option\&. This hook is called even if \fB\-\-prepare\-p4\-only\fR is set\&.
460 Run \fBgit\-p4 submit \-\-help\fR for details\&.
461 .SS "p4\-post\-changelist"
463 This hook is invoked by \fBgit\-p4 submit\fR\&.
465 The \fBp4\-post\-changelist\fR hook is invoked after the submit has successfully occurred in P4\&. It takes no parameters and is meant primarily for notification and cannot affect the outcome of the git p4 submit action\&.
467 Run \fBgit\-p4 submit \-\-help\fR for details\&.
468 .SS "p4\-pre\-submit"
470 This hook is invoked by \fBgit\-p4 submit\fR\&. It takes no parameters and nothing from standard input\&. Exiting with non\-zero status from this script prevent \fBgit\-p4 submit\fR from launching\&. It can be bypassed with the \fB\-\-no\-verify\fR command line option\&. Run \fBgit\-p4 submit \-\-help\fR for details\&.
471 .SS "post\-index\-change"
473 This hook is invoked when the index is written in read\-cache\&.c do_write_locked_index\&.
475 The first parameter passed to the hook is the indicator for the working directory being updated\&. "1" meaning working directory was updated or "0" when the working directory was not updated\&.
477 The second parameter passed to the hook is the indicator for whether or not the index was updated and the skip\-worktree bit could have changed\&. "1" meaning skip\-worktree bits could have been updated and "0" meaning they were not\&.
479 Only one parameter should be set to "1" when the hook runs\&. The hook running passing "1", "1" should not be possible\&.
482 Part of the \fBgit\fR(1) suite
487 \%https://github.com/newren/git-filter-repo