Enum Hook
- java.lang.Object
-
- java.lang.Enum<Hook>
-
- org.eclipse.jgit.util.Hook
-
-
Enum Constant Summary
Enum Constants Enum Constant 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
static Hook
valueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
PRE_COMMIT
public static final Hook PRE_COMMIT
Literal for the "pre-commit" git hook.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.
-
PREPARE_COMMIT_MSG
public static final Hook PREPARE_COMMIT_MSG
Literal for the "prepare-commit-msg" git hook.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.
-
COMMIT_MSG
public static final Hook COMMIT_MSG
Literal for the "commit-msg" git hook.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.
-
POST_COMMIT
public static final Hook POST_COMMIT
Literal for the "post-commit" git hook.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.
-
POST_REWRITE
public static final Hook POST_REWRITE
Literal for the "post-rewrite" git hook.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
oramend
). 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.
-
PRE_REBASE
public static final Hook PRE_REBASE
Literal for the "pre-rebase" git hook.A non-zero exit code from the called hook means that the rebase should be aborted.
-
-
Method Detail
-
values
public static Hook[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Hook c : Hook.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Hook valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getName
public java.lang.String getName()
- Returns:
- The name of this hook.
-
-