Package org.openrewrite.marker
Class GitProvenance
java.lang.Object
org.openrewrite.marker.GitProvenance
- All Implemented Interfaces:
Marker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable GitProvenancefromProjectDirectory(Path projectDir) Deprecated.static @Nullable GitProvenancefromProjectDirectory(Path projectDir, @Nullable BuildEnvironment environment) Deprecated.getOrganizationName(String baseUrl) Extract the organization name, including sub-organizations for git hosting services which support such a concept, from the origin URL.
-
Constructor Details
-
GitProvenance
public GitProvenance()
-
-
Method Details
-
getOrganizationName
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.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
-
fromProjectDirectory
Deprecated.Useinstead.- 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 aBuildEnvironmentmarker if possible.- Returns:
- A marker containing git provenance information.
-
instead.