GitInfo icon indicating copy to clipboard operation
GitInfo copied to clipboard

"Available constants" are undocumented.

Open pklapperich opened this issue 3 years ago • 0 comments

Not all of the available constants are immediately obvious. It would be nice if they were documented similar to the available customizations.

  • $(GitRepositoryUrl)
    • The URL of the default git-remote. Same as git remote get-url origin
  • $(GitBranch)
    • The name of the currently checked out branch
  • $(GitCommit)
    • first 7-char of git commit hash, similar to what's shown by git describe
  • $(GitCommitDate)
    • date of the commit
  • $(GitCommits)
    • number of commits since the last BaseVersion change. This is 0 if the BaseVersion was changed in this commit.
  • $(GitTag)
    • the tag if the current commit is tagged. If the current commit is not tagged, it's -{added_commits}-g$(GitCommit) where {added_commits} is the commits added since the last tag. This is similar to the output of git describe --tags, except no tag name is included unless the current commit is tagged.
  • $(GitBaseTag)
    • Most recent Git Tag (in an ancestor commit) matched by the GitTagRegex
  • $(GitBaseVersionMajor)
    • Major version parsed from the GitBaseVersionRegex
  • $(GitBaseVersionMinor)
    • Minor version parsed from the GitBaseVersionRegex
  • $(GitBaseVersionPatch)
    • Patch version parsed from the GitBaseVersionRegex
  • $(GitSemVerMajor)
    • Same as GitBaseVersionMajor
  • $(GitSemVerMinor)
    • Same as GitBaseVersionMinor
  • $(GitSemVerPatch)
    • Summation of GitBaseVersionPatch and GitCommits. This is useful for automatically increasing the Patch value whenever commits are made without the need to manually edit the Version File or add a new tag.
  • $(GitSemVerLabel)
    • The label parsed from the GitBaseVersionRegex
  • $(GitSemVerDashLabel)
    • Same as GitSemVerLabel, but preceded by a dash. This is useful for reducing conditional statements when the label is optional
  • $(GitSemVerSource)
    • Indicates whether the version came from the Version File or a parsing a Tag
  • $(GitIsDirty)
    • 1 if working directory was dirty during build time, 0 if working directory was clean

pklapperich avatar Sep 04 '21 18:09 pklapperich