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.
Afficher le fichier Open project: SimpleGitVersion/SGV-Net Class Usage Examples

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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).
Résultat RepositoryInfo

LoadFromPath() public static méthode

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 .
Résultat 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
Résultat CIReleaseInfo

CommitDateUtc public_oe property

The UTC date and time of the commit.
public DateTime,System CommitDateUtc
Résultat System.DateTime

CommitSha public_oe property

The Sha of the commit.
public string CommitSha
Résultat string

CurrentUserName public_oe property

The current user name.
public string CurrentUserName
Résultat 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
Résultat 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
Résultat string

IsDirtyExplanations public_oe property

Gets detailed explanations about IsDirty.
public string IsDirtyExplanations
Résultat string

Options public_oe property

Gets the RepositoryInfoOptions that has been used.
public RepositoryInfoOptions,SimpleGitVersion Options
Résultat 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
Résultat 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
Résultat 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
Résultat 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
Résultat 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
Résultat IReadOnlyList

ReleaseTagErrorText public_oe property

Gets the errors related to the release tags as a text. Null if no errors.
public string ReleaseTagErrorText
Résultat 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
Résultat 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
Résultat 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
Résultat ReleaseTagVersion