Package-level declarations

Types

Link copied to clipboard

Web source browser used by a repository. AUTO preserves zero-configuration use.

Link copied to clipboard

Strategy for choosing the commit SHA used in generated source-browse links.

Link copied to clipboard

Selects the Git history used for repository provenance and source links.

Link copied to clipboard
data class GitRemoteBranch(val name: String, val commit: String)
Link copied to clipboard
data class GitRepoInfo(val root: File, val remoteUrl: String, val commit: String, val remotePath: String = "", val codeBrowser: CodeBrowser = CodeBrowser.AUTO, val editRef: String? = null)

Functions

Link copied to clipboard
fun findGitRoot(startDir: File): File?
Link copied to clipboard
Link copied to clipboard

Converts Git remotes to browser URLs without publishing authentication user info.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the checked-out branch's upstream branch and last fetched commit, falling back to the conventional remote default branches. The fallback is appropriate for selecting a view revision, but is deliberately not used to infer an editable branch; see readGitUpstreamBranch.

Link copied to clipboard
fun readGitRemoteUrl(gitDir: File, remoteName: String = "origin"): String?
Link copied to clipboard

Returns the current branch's configured upstream and last fetched commit.

Link copied to clipboard
fun readPackedRef(gitDir: File, ref: String): String?
Link copied to clipboard

Reads the commit SHA of the remote tracking branch for the current checkout from the local git database — no external process required.

Link copied to clipboard
fun resolveGitDir(repoRoot: File): File?
Link copied to clipboard

Resolves the merge-base of HEAD with the remote default branch by running git merge-base HEAD origin/master (then origin/main as fallback) in the given repoRoot. Returns the merge-base SHA, or null when git is not available or the merge-base cannot be determined.

Link copied to clipboard

fun resolveGitRepoInfo(repoRoot: File, remoteOverride: String?, remotePathOverride: String? = null, gitOwnership: GitOwnership = GitOwnership.CHECKOUT): GitRepoInfo?

Like resolveGitRepoInfo, but remoteOverride (when non-blank) replaces the git origin URL — normalized from SSH/HTTPS to https://host/org/repo. The source root and revision come from the history selected by gitOwnership. CHECKOUT ignores .gitrepo synchronization metadata; SUBREPO_UPSTREAM explicitly selects that metadata's upstream and imported commit. Backs the repo DSL.

fun resolveGitRepoInfo(repoRoot: File, remoteOverride: String?, commitOverride: String?, remotePathOverride: String? = null, gitOwnership: GitOwnership = GitOwnership.CHECKOUT): GitRepoInfo?

Like the two-argument resolveGitRepoInfo, but additionally accepts commitOverride — when non-blank it replaces the checkout's HEAD commit in the returned GitRepoInfo. This backs the DSL repo { commit = … } property, used when the local HEAD has not been pushed to the remote and generated source-browse links would 404.

fun resolveGitRepoInfo(repoRoot: File, remoteOverride: String?, commitOverride: String?, commitRef: CommitRef?, remotePathOverride: String? = null, codeBrowser: CodeBrowser = CodeBrowser.AUTO, editRefOverride: String? = null, gitOwnership: GitOwnership = GitOwnership.CHECKOUT): GitRepoInfo?

Like the three-argument resolveGitRepoInfo, but accepts a CommitRef enum strategy instead of (or in addition to) a literal commit string. When commitRef is non-null it takes priority over commitOverride:

Link copied to clipboard
fun resolveGitRepoRoot(repoRoot: File, gitOwnership: GitOwnership): File?

Resolves the history owner without changing the configured implementation directory.

Link copied to clipboard
fun resolveModuleRepoInfo(sourceRoots: List<File>, repoInfos: List<GitRepoInfo>): GitRepoInfo?

Picks the GitRepoInfo whose root contains the deepest match for any of the given sourceRoots. Used by Dokka source-link computation to decide which repository a module's Kotlin sources belong to when multiple repos (e.g. stig-project + an external sources repo) are in play. Falls back to the first repoInfos entry if no source root matches.

Link copied to clipboard
Generated with STIG