- java.lang.Object
-
- org.eclipse.jgit.hooks.Hooks
-
public class Hooks extends Object
Factory class for instantiating supported hooks.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description Hooks()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CommitMsgHookcommitMsg(Repository repo, PrintStream outputStream)Create commit-msg hook for the given repository with the default error streamstatic CommitMsgHookcommitMsg(Repository repo, PrintStream outputStream, PrintStream errorStream)Create commit-msg hook for the given repositorystatic PostCommitHookpostCommit(Repository repo, PrintStream outputStream)Create post-commit hook for the given repository with the default error streamstatic PostCommitHookpostCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)Create post-commit hook for the given repositorystatic PreCommitHookpreCommit(Repository repo, PrintStream outputStream)Create pre-commit hook for the given repository with the default error streamstatic PreCommitHookpreCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)Create pre-commit hook for the given repositorystatic PrePushHookprePush(Repository repo, PrintStream outputStream)Create pre-push hook for the given repository with the default error streamstatic PrePushHookprePush(Repository repo, PrintStream outputStream, PrintStream errorStream)Create pre-push hook for the given repository
-
-
-
Method Detail
-
preCommit
public static PreCommitHook preCommit(Repository repo, PrintStream outputStream)
Create pre-commit hook for the given repository with the default error stream- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.out- Returns:
- The pre-commit hook for the given repository.
-
preCommit
public static PreCommitHook preCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create pre-commit hook for the given repository- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.outerrorStream- The error stream, ornullto useSystem.err- Returns:
- The pre-commit hook for the given repository.
- Since:
- 5.6
-
postCommit
public static PostCommitHook postCommit(Repository repo, PrintStream outputStream)
Create post-commit hook for the given repository with the default error stream- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.out- Returns:
- The post-commit hook for the given repository.
- Since:
- 4.5
-
postCommit
public static PostCommitHook postCommit(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create post-commit hook for the given repository- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.outerrorStream- The error stream, ornullto useSystem.err- Returns:
- The pre-commit hook for the given repository.
- Since:
- 5.6
-
commitMsg
public static CommitMsgHook commitMsg(Repository repo, PrintStream outputStream)
Create commit-msg hook for the given repository with the default error stream- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.out- Returns:
- The commit-msg hook for the given repository.
-
commitMsg
public static CommitMsgHook commitMsg(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create commit-msg hook for the given repository- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.outerrorStream- The error stream, ornullto useSystem.err- Returns:
- The pre-commit hook for the given repository.
- Since:
- 5.6
-
prePush
public static PrePushHook prePush(Repository repo, PrintStream outputStream)
Create pre-push hook for the given repository with the default error stream- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.out- Returns:
- The pre-push hook for the given repository.
- Since:
- 4.2
-
prePush
public static PrePushHook prePush(Repository repo, PrintStream outputStream, PrintStream errorStream)
Create pre-push hook for the given repository- Parameters:
repo- aRepositoryobject.outputStream- The output stream, ornullto useSystem.outerrorStream- The error stream, ornullto useSystem.err- Returns:
- The pre-push hook for the given repository.
- Since:
- 5.6
-
-