Package pl.project13.core.jgit
Class JGitCommon
java.lang.Object
pl.project13.core.jgit.JGitCommon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) findTagObjectIds(org.eclipse.jgit.lib.Repository repo, boolean includeLightweightTags, String matchPattern) getClosestTagCommitCount(String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe) getClosestTagName(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) getTag(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId objectId) getTags(org.eclipse.jgit.lib.Repository repo, org.eclipse.jgit.lib.ObjectId objectId) static booleanisRepositoryInDirtyState(org.eclipse.jgit.lib.Repository repo) transformRevTagsMapToDateSortedTagNames(Map<org.eclipse.jgit.lib.ObjectId, List<DatedRevTag>> commitIdsToTags) protected StringtrimFullTagName(String tagName)
-
Constructor Details
-
JGitCommon
-
-
Method Details
-
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
-
getTag
public Collection<String> getTag(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) -
createMatchPattern
-
findTagObjectIds
-
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
-
trimFullTagName
-
findCommitsUntilSomeTag
-
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:
-
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
-