Documentation
¶
Overview ¶
Package context provides the GitVersionContext, the immutable snapshot of git state and configuration used for version calculation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitVersionContext ¶
type GitVersionContext struct {
// CurrentBranch is the branch being versioned.
CurrentBranch git.Branch
// CurrentCommit is the commit being versioned (branch tip or explicit SHA).
CurrentCommit git.Commit
// FullConfiguration is the merged configuration (defaults + user overrides).
FullConfiguration *config.Config
// CurrentCommitTaggedVersion is the semantic version tag on the current
// commit, if any. Zero value with IsCurrentCommitTagged=false means no tag.
CurrentCommitTaggedVersion semver.SemanticVersion
// IsCurrentCommitTagged is true when the current commit has a version tag.
IsCurrentCommitTagged bool
// NumberOfUncommittedChanges counts dirty working directory entries.
NumberOfUncommittedChanges int
}
GitVersionContext holds the resolved state needed for version calculation. It is created once per invocation and passed to all strategies.
func NewContext ¶
func NewContext(store *git.RepositoryStore, repo git.Repository, cfg *config.Config, opts Options) (*GitVersionContext, error)
NewContext creates a GitVersionContext by resolving the target branch, current commit, version tags, and uncommitted change count.
func (*GitVersionContext) GetEffectiveConfiguration ¶
func (ctx *GitVersionContext) GetEffectiveConfiguration(branchName string) (config.EffectiveConfiguration, error)
GetEffectiveConfiguration resolves the effective configuration for the given branch, using the context's full configuration.
Click to show internal directories.
Click to hide internal directories.