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 classstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionGitProvenance(UUID id, @Nullable String origin, @Nullable String branch, @Nullable String change, @Nullable GitProvenance.AutoCRLF autocrlf, @Nullable GitProvenance.EOL eol, @Nullable List<GitProvenance.Committer> committers) -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable GitProvenancefromProjectDirectory(Path projectDir) Deprecated.static @Nullable GitProvenancefromProjectDirectory(Path projectDir, @Nullable BuildEnvironment environment) static @Nullable GitProvenancefromProjectDirectory(Path projectDir, @Nullable BuildEnvironment environment, GitRemote.Parser gitRemoteParser) 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
-
-
Method Details
-
getGitRemote
-
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
-
getRepositoryName
-
getRepositoryPath
-
getRepositoryOrigin
-
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.
-
fromProjectDirectory
@Nullable public static @Nullable GitProvenance fromProjectDirectory(Path projectDir, @Nullable @Nullable BuildEnvironment environment, @Nullable GitRemote.Parser gitRemoteParser) - Parameters:
projectDir- The project directory.environment- In detached head scenarios, the branch is best determined from aBuildEnvironmentmarker if possible.gitRemoteParser- Parses the remote url into aGitRemote. Custom remotes can be registered to it, or a default with known git hosting services can be used.- Returns:
- A marker containing git provenance information.
-
instead.