Package pl.project13.core.jgit
Class JGitCommon
- java.lang.Object
-
- pl.project13.core.jgit.JGitCommon
-
public class JGitCommon extends Object
-
-
Constructor Summary
Constructors Constructor Description JGitCommon(LoggerBridge log)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateMatchPattern(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.List<org.eclipse.jgit.revwalk.RevCommit>findCommitsUntilSomeTag(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevCommit head, Map<org.eclipse.jgit.lib.ObjectId,List<String>> tagObjectIdToName)protected org.eclipse.jgit.revwalk.RevCommitfindEvalCommitObjectId(String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo)protected Map<org.eclipse.jgit.lib.ObjectId,List<String>>findTagObjectIds(org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, String matchPattern)StringgetClosestTagCommitCount(String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)StringgetClosestTagName(String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)protected Map<org.eclipse.jgit.lib.ObjectId,List<DatedRevTag>>getCommitIdsToTags(org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, String matchPattern)Collection<String>getTags(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId objectId)static booleanisRepositoryInDirtyState(org.eclipse.jgit.lib.Repository repo)protected HashMap<org.eclipse.jgit.lib.ObjectId,List<String>>transformRevTagsMapToDateSortedTagNames(Map<org.eclipse.jgit.lib.ObjectId,List<DatedRevTag>> commitIdsToTags)protected StringtrimFullTagName(String tagName)
-
-
-
Constructor Detail
-
JGitCommon
public JGitCommon(LoggerBridge log)
-
-
Method Detail
-
getTags
public Collection<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 String getClosestTagName(@Nonnull String evaluateOnCommit, @Nonnull org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)
-
getClosestTagCommitCount
public String getClosestTagCommitCount(@Nonnull String evaluateOnCommit, @Nonnull org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)
-
findTagObjectIds
protected Map<org.eclipse.jgit.lib.ObjectId,List<String>> findTagObjectIds(@Nonnull org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, String matchPattern)
-
findEvalCommitObjectId
protected org.eclipse.jgit.revwalk.RevCommit findEvalCommitObjectId(@Nonnull String evaluateOnCommit, @Nonnull org.eclipse.jgit.lib.Repository repo) throws RuntimeException
- Throws:
RuntimeException
-
getCommitIdsToTags
protected Map<org.eclipse.jgit.lib.ObjectId,List<DatedRevTag>> getCommitIdsToTags(@Nonnull org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, String matchPattern)
-
transformRevTagsMapToDateSortedTagNames
protected HashMap<org.eclipse.jgit.lib.ObjectId,List<String>> transformRevTagsMapToDateSortedTagNames(Map<org.eclipse.jgit.lib.ObjectId,List<DatedRevTag>> commitIdsToTags)
-
findCommitsUntilSomeTag
public List<org.eclipse.jgit.revwalk.RevCommit> findCommitsUntilSomeTag(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.revwalk.RevCommit head, @Nonnull Map<org.eclipse.jgit.lib.ObjectId,List<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
-
-