Class GitProvenance

java.lang.Object
org.openrewrite.marker.GitProvenance
All Implemented Interfaces:
Marker

public class GitProvenance extends Object implements Marker
  • Constructor Details

    • GitProvenance

      public GitProvenance()
  • Method Details

    • getOrganizationName

      @Nullable public @Nullable String getOrganizationName(String baseUrl)
      Extract the organization name, including sub-organizations for git hosting services which support such a concept, from the origin URL. Needs to be supplied with the
      Parameters:
      baseUrl - the portion of the URL which precedes the organization
      Returns:
      the portion of the git origin URL which corresponds to the organization the git repository is organized under
    • getOrganizationName

      @Deprecated @Nullable public @Nullable String getOrganizationName()
      Deprecated.
      There is too much variability in how different git hosting services arrange their organizations to reliably determine the organization component of the URL without additional information. The version of this method which accepts a "baseUrl" parameter should be used instead
    • getRepositoryName

      @Nullable public @Nullable String getRepositoryName()
    • fromProjectDirectory

      @Nullable @Deprecated public static @Nullable GitProvenance fromProjectDirectory(Path projectDir)
      Deprecated.
      Use instead.
      Parameters:
      projectDir - The project directory.
      Returns:
      A marker containing git provenance information.
    • fromProjectDirectory

      @Nullable public static @Nullable GitProvenance fromProjectDirectory(Path projectDir, @Nullable @Nullable BuildEnvironment environment)
      Parameters:
      projectDir - The project directory.
      environment - In detached head scenarios, the branch is best determined from a BuildEnvironment marker if possible.
      Returns:
      A marker containing git provenance information.