Class JGitCommon

java.lang.Object
pl.project13.core.jgit.JGitCommon

public class JGitCommon extends Object
  • Constructor Details

  • 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

      protected String createMatchPattern(String pattern)
    • 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)
    • trimFullTagName

      protected String trimFullTagName(@Nonnull String tagName)
    • 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 - the Repository this command should interact with
      child - 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