Package adams.core.git
Class GitHelper
- java.lang.Object
-
- adams.core.git.GitHelper
-
public class GitHelper extends Object
Helper class for git.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static StringFORMAT_REVCOMMIT_LONGstatic StringFORMAT_REVCOMMIT_SHORTstatic StringPH_COMMITTERstatic StringPH_FULL_MESSAGEstatic StringPH_HASHstatic StringPH_SHORT_MESSAGEstatic StringPH_TIMESTAMP
-
Constructor Summary
Constructors Constructor Description GitHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringformat(org.eclipse.jgit.api.MergeResult merge)Formats a merge result.static Stringformat(org.eclipse.jgit.api.PullResult pull)Turns the pull result into a legible string.static Stringformat(org.eclipse.jgit.api.RebaseResult rebase)Formats a rebase result.static Stringformat(org.eclipse.jgit.revwalk.RevCommit commit, String format)Returns a commit as a string.static Stringformat(org.eclipse.jgit.transport.FetchResult fetch)Formats a fetch result.static Stringformat(org.eclipse.jgit.transport.RemoteRefUpdate update)Turns the update into a string.static booleanisRemoteRepo(org.eclipse.jgit.api.Git git)Checks whether the repo is a remote one.
-
-
-
Field Detail
-
PH_TIMESTAMP
public static final String PH_TIMESTAMP
- See Also:
- Constant Field Values
-
PH_COMMITTER
public static final String PH_COMMITTER
- See Also:
- Constant Field Values
-
PH_HASH
public static final String PH_HASH
- See Also:
- Constant Field Values
-
PH_FULL_MESSAGE
public static final String PH_FULL_MESSAGE
- See Also:
- Constant Field Values
-
PH_SHORT_MESSAGE
public static final String PH_SHORT_MESSAGE
- See Also:
- Constant Field Values
-
FORMAT_REVCOMMIT_LONG
public static final String FORMAT_REVCOMMIT_LONG
- See Also:
- Constant Field Values
-
FORMAT_REVCOMMIT_SHORT
public static final String FORMAT_REVCOMMIT_SHORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
format
public static String format(org.eclipse.jgit.revwalk.RevCommit commit, String format)
Returns a commit as a string.
Supported placeholders:PH_HASH,PH_COMMITTER,PH_FULL_MESSAGE,PH_SHORT_MESSAGE,PH_TIMESTAMP- Parameters:
commit- the commit to formatformat- the format to use- Returns:
- the formatted string
-
format
public static String format(org.eclipse.jgit.transport.RemoteRefUpdate update)
Turns the update into a string.- Parameters:
update- the update to format- Returns:
- the generated string
-
format
public static String format(org.eclipse.jgit.transport.FetchResult fetch)
Formats a fetch result.- Parameters:
fetch- the result to format- Returns:
- the generated string
-
format
public static String format(org.eclipse.jgit.api.MergeResult merge)
Formats a merge result.- Parameters:
merge- the result to format- Returns:
- the generated string
-
format
public static String format(org.eclipse.jgit.api.RebaseResult rebase)
Formats a rebase result.- Parameters:
rebase- the result to format- Returns:
- the generated string
-
format
public static String format(org.eclipse.jgit.api.PullResult pull)
Turns the pull result into a legible string.- Parameters:
pull- the result to format- Returns:
- the generated string
-
isRemoteRepo
public static boolean isRemoteRepo(org.eclipse.jgit.api.Git git)
Checks whether the repo is a remote one.- Parameters:
git- the repo to check- Returns:
- true if remote
-
-