Class JGitCommon


  • public class JGitCommon
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String createMatchPattern​(java.lang.String pattern)  
      protected int distanceBetween​(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.RevCommit findEvalCommitObjectId​(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.String getClosestTagCommitCount​(java.lang.String evaluateOnCommit, org.eclipse.jgit.lib.Repository repo, GitDescribeConfig gitDescribe)  
      java.lang.String getClosestTagName​(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 boolean isRepositoryInDirtyState​(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.String trimFullTagName​(java.lang.String tagName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 - 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:
        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