Class GitOperations

java.lang.Object
com.palantir.gradle.revapi.GitOperations

public abstract class GitOperations extends Object
Walks back through git history to find the most recent release tags, used as candidate "previous versions" for revapi to compare against.

Starting from HEAD:

  1. Move to the first parent commit (ref^) and verify it exists.
  2. Run git describe --tags --abbrev=0 to find the nearest reachable tag from that commit.
  3. If the tag is the sentinel 0.0.0, only accept it when the commit has a parent (filters out the synthetic root-commit tag used when no real releases exist yet).
  4. Feed that tag back in as the next ref and repeat, collecting up to TAGS_TO_RETURN tags.
  5. Strip a leading v from each tag before returning.
  • Constructor Details

    • GitOperations

      public GitOperations()
  • Method Details

    • getGitInvoker

      protected abstract com.palantir.gradle.gitversion.GitInvoker getGitInvoker()
    • previousGitTags

      public final org.gradle.api.provider.Provider<List<String>> previousGitTags()