public enum Hook extends Enum<Hook>
Enum Constant and Description |
---|
COMMIT_MSG
Literal for the "commit-msg" git hook.
|
POST_COMMIT
Literal for the "post-commit" git hook.
|
POST_REWRITE
Literal for the "post-rewrite" git hook.
|
PRE_COMMIT
Literal for the "pre-commit" git hook.
|
PRE_REBASE
Literal for the "pre-rebase" git hook.
|
PREPARE_COMMIT_MSG
Literal for the "prepare-commit-msg" git hook.
|
Modifier and Type | Method and Description |
---|---|
String |
getName() |
static Hook |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Hook[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Hook PRE_COMMIT
This hook is invoked by git commit, and can be bypassed with the "no-verify" option. It takes no parameter, and is invoked before obtaining the proposed commit log message and making a commit.
A non-zero exit code from the called hook means that the commit should be aborted.
public static final Hook PREPARE_COMMIT_MSG
This hook is invoked by git commit right after preparing the default message, and before any editing possibility is displayed to the user.
A non-zero exit code from the called hook means that the commit should be aborted.
public static final Hook COMMIT_MSG
This hook is invoked by git commit, and can be bypassed with the "no-verify" option. Its single parameter is the path to the file containing the prepared commit message (typically "<gitdir>/COMMIT-EDITMSG").
A non-zero exit code from the called hook means that the commit should be aborted.
public static final Hook POST_COMMIT
This hook is invoked by git commit. It takes no parameter and is invoked after a commit has been made.
The exit code of this hook has no significance.
public static final Hook POST_REWRITE
This hook is invoked after commands that rewrite commits (currently, only
"git rebase" and "git commit --amend"). It a single argument denoting the
source of the call (one of rebase
or amend
). It
then accepts a list of rewritten commits through stdin, in the form
<old SHA-1> <new SHA-1>LF
.
The exit code of this hook has no significance.
public static final Hook PRE_REBASE
This hook is invoked right before the rebase operation runs. It accepts up to two parameters, the first being the upstream from which the branch to rebase has been forked. If the tip of the series of commits to rebase is HEAD, the other parameter is unset. Otherwise, that tip is passed as the second parameter of the script.
A non-zero exit code from the called hook means that the rebase should be aborted.
public static Hook[] values()
for (Hook c : Hook.values()) System.out.println(c);
public static Hook valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getName()
Copyright © 2015. All rights reserved.