C# Class SimpleGitVersion.RepositoryInfo

Immutable object that can be obtained by calling RepositoryInfo.LoadFromPath(string, RepositoryInfoOptions) that describes the commit and all the CSemVer information.
显示文件 Open project: SimpleGitVersion/SGV-Net Class Usage Examples

Public Properties

Property Type Description
CIRelease CIReleaseInfo
CommitDateUtc System.DateTime
CommitSha string
CurrentUserName string
ExistingVersions IReadOnlyList
GitSolutionDirectory string
IsDirtyExplanations string
Options SimpleGitVersion.RepositoryInfoOptions
PossibleVersions IReadOnlyList
PossibleVersionsStrict IReadOnlyList
PreviousMaxRelease ITagCommit
PreviousRelease ITagCommit
ReleaseTagErrorLines IReadOnlyList
ReleaseTagErrorText string
ReleaseTagIsNotPossibleError bool
RepositoryError string
ValidReleaseTag ReleaseTagVersion

Public Methods

Method Description
LoadFromPath ( string path, RepositoryInfoOptions>.Func optionsBuilder ) : RepositoryInfo

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder) and a function that can create a RepositoryInfoOptions from the actual Git repository path.

LoadFromPath ( string path, SimpleGitVersion.RepositoryInfoOptions options = null ) : RepositoryInfo

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder).

Private Methods

Method Description
ComputeIsDirty ( Repository r, Commit commit, SimpleGitVersion.RepositoryInfoOptions options ) : string
RepositoryInfo ( ) : System
RepositoryInfo ( Repository r, SimpleGitVersion.RepositoryInfoOptions options, string gitSolutionDir ) : System
SetError ( StringBuilder errors, IReadOnlyList &lines, string &text ) : void
TryFindCommit ( SimpleGitVersion.RepositoryInfoOptions options, Repository r, Commit &commit, CIBranchVersionMode &ciVersionMode, string &branchNameForCIVersion ) : string

Method Details

LoadFromPath() public static method

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder) and a function that can create a RepositoryInfoOptions from the actual Git repository path.
public static LoadFromPath ( string path, RepositoryInfoOptions>.Func optionsBuilder ) : RepositoryInfo
path string The path to lookup.
optionsBuilder RepositoryInfoOptions>.Func Function that can create a from the Git working directory (the Solution folder).
return RepositoryInfo

LoadFromPath() public static method

Creates a new RepositoryInfo based on a path (that can be below the folder with the '.git' sub folder).
public static LoadFromPath ( string path, SimpleGitVersion.RepositoryInfoOptions options = null ) : RepositoryInfo
path string The path to lookup.
options SimpleGitVersion.RepositoryInfoOptions Optional .
return RepositoryInfo

Property Details

CIRelease public_oe property

Gets CI informations if a CI release must be done. Not null only if we are on a branch that is enabled in RepositoryInfoOptions.Branches (either because it is the current branch or RepositoryInfoOptions.StartingBranchName specifies it), the RepositoryInfoOptions.StartingCommitSha is null or empty and there is no ValidReleaseTag on the commit.
public CIReleaseInfo,SimpleGitVersion CIRelease
return CIReleaseInfo

CommitDateUtc public_oe property

The UTC date and time of the commit.
public DateTime,System CommitDateUtc
return System.DateTime

CommitSha public_oe property

The Sha of the commit.
public string CommitSha
return string

CurrentUserName public_oe property

The current user name.
public string CurrentUserName
return string

ExistingVersions public_oe property

Gets the existing versions in the repository in ascending order. Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation.
public IReadOnlyList ExistingVersions
return IReadOnlyList

GitSolutionDirectory public_oe property

Gets the solution directory: the one that contains the .git folder. Null only if RepositoryError is 'No Git repository.'. It ends with the Path.DirectorySeparatorChar.
public string GitSolutionDirectory
return string

IsDirtyExplanations public_oe property

Gets detailed explanations about IsDirty.
public string IsDirtyExplanations
return string

Options public_oe property

Gets the RepositoryInfoOptions that has been used.
public RepositoryInfoOptions,SimpleGitVersion Options
return SimpleGitVersion.RepositoryInfoOptions

PossibleVersions public_oe property

Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation. When empty, this means that there can not be a valid release tag on the current commit point.
public IReadOnlyList PossibleVersions
return IReadOnlyList

PossibleVersionsStrict public_oe property

Gets the possible versions on this commit in a strict sense: this is a subset of the PossibleVersions. A possible versions that is not a ReleaseTagVersion.IsPatch do not appear here if a greater version exists in the repository. Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation.
public IReadOnlyList PossibleVersionsStrict
return IReadOnlyList

PreviousMaxRelease public_oe property

Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation. Can also be null if there is simply no previous release: the PossibleVersions are then based on ReleaseTagVersion.FirstPossibleVersions.
public ITagCommit PreviousMaxRelease
return ITagCommit

PreviousRelease public_oe property

Null if there is a RepositoryError or a ReleaseTagErrorText that prevented its computation. Can also be null if there is simply no previous release.
public ITagCommit PreviousRelease
return ITagCommit

ReleaseTagErrorLines public_oe property

Gets the errors related to the release tags as a list of lines. Null if no errors.
public IReadOnlyList ReleaseTagErrorLines
return IReadOnlyList

ReleaseTagErrorText public_oe property

Gets the errors related to the release tags as a text. Null if no errors.
public string ReleaseTagErrorText
return string

ReleaseTagIsNotPossibleError public_oe property

Gets whether the error is the fact that the release tag on the current commit point is not one of the PossibleVersions. An error that describes this appears in ReleaseTagErrorLines and ReleaseTagErrorText
public bool ReleaseTagIsNotPossibleError
return bool

RepositoryError public_oe property

Gets the repository level error if any: it is one line of text or null ('No Git repository.' or 'Unitialized Git repository.').
public string RepositoryError
return string

ValidReleaseTag public_oe property

Gets the release tag. If there is error, this is null. It is also null if there is actually no release tag on the current commit.
public ReleaseTagVersion,SimpleGitVersion ValidReleaseTag
return ReleaseTagVersion