Package pl.project13.core.jgit
Class JGitCommon
- java.lang.Object
-
- pl.project13.core.jgit.JGitCommon
-
public class JGitCommon extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description JGitCommon(LogInterface log)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcreateMatchPattern(java.lang.String pattern)protected intdistanceBetween(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevCommit child, org.eclipse.jgit.revwalk.RevCommit parent)Calculates the distance (number of commits) between the given parent and child commits.java.util.List<org.eclipse.jgit.revwalk.RevCommit>findCommitsUntilSomeTag(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevCommit head, java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<java.lang.String>> tagObjectIdToName)protected org.eclipse.jgit.revwalk.RevCommitfindEvalCommitObjectId(java.lang.String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo)protected java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<java.lang.String>>findTagObjectIds(org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, java.lang.String matchPattern)java.lang.StringgetClosestTagCommitCount(java.lang.String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)java.lang.StringgetClosestTagName(java.lang.String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)protected java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<DatedRevTag>>getCommitIdsToTags(org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, java.lang.String matchPattern)java.util.Collection<java.lang.String>getTags(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId objectId)static booleanisRepositoryInDirtyState(org.eclipse.jgit.lib.Repository repo)protected java.util.HashMap<org.eclipse.jgit.lib.ObjectId,java.util.List<java.lang.String>>transformRevTagsMapToDateSortedTagNames(java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<DatedRevTag>> commitIdsToTags)protected java.lang.StringtrimFullTagName(java.lang.String tagName)
-
-
-
Constructor Detail
-
JGitCommon
public JGitCommon(LogInterface log)
-
-
Method Detail
-
getTags
public java.util.Collection<java.lang.String> getTags(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId objectId) throws org.eclipse.jgit.api.errors.GitAPIException- Throws:
org.eclipse.jgit.api.errors.GitAPIException
-
getClosestTagName
public java.lang.String getClosestTagName(@Nonnull java.lang.String evaluateOnCommit, @Nonnull org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)
-
getClosestTagCommitCount
public java.lang.String getClosestTagCommitCount(@Nonnull java.lang.String evaluateOnCommit, @Nonnull org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)
-
createMatchPattern
protected java.lang.String createMatchPattern(java.lang.String pattern)
-
findTagObjectIds
protected java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<java.lang.String>> findTagObjectIds(@Nonnull org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, java.lang.String matchPattern)
-
findEvalCommitObjectId
protected org.eclipse.jgit.revwalk.RevCommit findEvalCommitObjectId(@Nonnull java.lang.String evaluateOnCommit, @Nonnull org.eclipse.jgit.lib.Repository repo) throws java.lang.RuntimeException- Throws:
java.lang.RuntimeException
-
getCommitIdsToTags
protected java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<DatedRevTag>> getCommitIdsToTags(@Nonnull org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, java.lang.String matchPattern)
-
transformRevTagsMapToDateSortedTagNames
protected java.util.HashMap<org.eclipse.jgit.lib.ObjectId,java.util.List<java.lang.String>> transformRevTagsMapToDateSortedTagNames(java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<DatedRevTag>> commitIdsToTags)
-
trimFullTagName
protected java.lang.String trimFullTagName(@Nonnull java.lang.String tagName)
-
findCommitsUntilSomeTag
public java.util.List<org.eclipse.jgit.revwalk.RevCommit> findCommitsUntilSomeTag(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevCommit head, @Nonnull java.util.Map<org.eclipse.jgit.lib.ObjectId,java.util.List<java.lang.String>> tagObjectIdToName)
-
distanceBetween
protected int distanceBetween(@Nonnull org.eclipse.jgit.lib.Repository repo, @Nonnull org.eclipse.jgit.revwalk.RevCommit child, @Nonnull org.eclipse.jgit.revwalk.RevCommit parent)Calculates the distance (number of commits) between the given parent and child commits.- Parameters:
repo- theRepositorythis command should interact withchild- the child commit (starting point)parent- the parent commit (end point)- Returns:
- distance (number of commits) between the given commits
- See Also:
- mdonoughe/jgit-describe/blob/master/src/org/mdonoughe/JGitDescribeTask.java
-
isRepositoryInDirtyState
public static boolean isRepositoryInDirtyState(org.eclipse.jgit.lib.Repository repo) throws org.eclipse.jgit.api.errors.GitAPIException- Throws:
org.eclipse.jgit.api.errors.GitAPIException
-
-