Modifier and Type | Field and Description |
---|---|
static String |
NAME
Constant indicating the name of the commit-smg hook.
|
Modifier | Constructor and Description |
---|---|
protected |
CommitMsgHook(Repository repo,
PrintStream outputStream)
Constructor for CommitMsgHook
|
protected |
CommitMsgHook(Repository repo,
PrintStream outputStream,
PrintStream errorStream)
Constructor for CommitMsgHook
|
Modifier and Type | Method and Description |
---|---|
String |
call() |
String |
getHookName()
Get name of the hook
|
protected String[] |
getParameters()
Override this method when needed to provide relevant parameters to the
underlying hook script.
|
CommitMsgHook |
setCommitMessage(String commitMessage)
It is mandatory to call this method with a non-null value before actually
calling the hook.
|
doRun, getErrorStream, getOutputStream, getRepository, getStdinArgs, handleError, isNativeHookPresent
public static final String NAME
protected CommitMsgHook(Repository repo, PrintStream outputStream)
This constructor will use the default error stream.
repo
- The repositoryoutputStream
- The output stream the hook must use. null
is allowed,
in which case the hook will use System.out
.protected CommitMsgHook(Repository repo, PrintStream outputStream, PrintStream errorStream)
repo
- The repositoryoutputStream
- The output stream the hook must use. null
is allowed,
in which case the hook will use System.out
.errorStream
- The error stream the hook must use. null
is allowed,
in which case the hook will use System.err
.public String call() throws IOException, AbortedByHookException
Run the hook.
call
in interface Callable<String>
call
in class GitHook<String>
IOException
AbortedByHookException
public String getHookName()
getHookName
in class GitHook<String>
null
.protected String[] getParameters()
getParameters
in class GitHook<String>
public CommitMsgHook setCommitMessage(String commitMessage)
commitMessage
- The commit message before the hook has run.this
for convenience.Copyright © 2021 Eclipse JGit Project. All rights reserved.