New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nerdbank.GitVersioning segment / support #777
Comments
@devhawk creating a segment isn't tricky, but you'll need to guide me into what you'd like to see. For example, which command output to run, when to run etc... |
I don't know the code base and frankly I'm not proficient in Go, so I have no idea what is feasible or not. But since you asked, here's what I'd like to see:
Suggested version display options (from properties returned by
Personally, I only care about the nuget package version, but other folks might want to display one of the other properties example {
"CloudBuildNumber": "2.0.35-preview",
"CloudBuildNumberEnabled": true,
"BuildMetadataWithCommitId": [
"bdf2320560"
],
"VersionFileFound": true,
"VersionOptions": {
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"Version": {
"Version": "2.0",
"Prerelease": "-preview",
"BuildMetadata": ""
},
"PublicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/master-2.x$",
"^refs/heads/release/v\\d+(?:\\.\\d+)?$"
],
"CloudBuild": {
"SetAllVariables": null,
"SetVersionVariables": null,
"BuildNumber": {
"Enabled": true,
"IncludeCommitId": null
}
},
"Release": {
"BranchName": "release/v{version}",
"FirstUnstableTag": "preview"
}
},
"AssemblyVersion": "2.0.0.0",
"AssemblyFileVersion": "2.0.35.62141",
"AssemblyInformationalVersion": "2.0.35-preview+bdf2320560",
"PublicRelease": true,
"PrereleaseVersion": "-preview",
"PrereleaseVersionNoLeadingHyphen": "preview",
"SimpleVersion": "2.0.35",
"BuildNumber": 35,
"VersionRevision": 62141,
"MajorMinorVersion": "2.0",
"VersionMajor": 2,
"VersionMinor": 0,
"GitCommitId": "bdf232056019c3d99927702963979f5026cf4237",
"GitCommitIdShort": "bdf2320560",
"GitCommitDate": "2021-06-02T21:48:28+00:00",
"VersionHeight": 35,
"VersionHeightOffset": 0,
"BuildingRef": "refs/heads/master",
"Version": "2.0.35.62141",
"CloudBuildAllVarsEnabled": false,
"CloudBuildAllVars": {
"NBGV_CloudBuildNumber": "2.0.35-preview",
"NBGV_VersionFileFound": "True",
"NBGV_VersionOptions": "Nerdbank.GitVersioning.VersionOptions",
"NBGV_AssemblyVersion": "2.0.0.0",
"NBGV_AssemblyFileVersion": "2.0.35.62141",
"NBGV_AssemblyInformationalVersion": "2.0.35-preview+bdf2320560",
"NBGV_PublicRelease": "True",
"NBGV_PrereleaseVersion": "-preview",
"NBGV_PrereleaseVersionNoLeadingHyphen": "preview",
"NBGV_SimpleVersion": "2.0.35",
"NBGV_BuildNumber": "35",
"NBGV_VersionRevision": "62141",
"NBGV_MajorMinorVersion": "2.0",
"NBGV_VersionMajor": "2",
"NBGV_VersionMinor": "0",
"NBGV_GitCommitId": "bdf232056019c3d99927702963979f5026cf4237",
"NBGV_GitCommitIdShort": "bdf2320560",
"NBGV_GitCommitDate": "6/2/2021 9:48:28 PM +00:00",
"NBGV_VersionHeight": "35",
"NBGV_VersionHeightOffset": "0",
"NBGV_BuildingRef": "refs/heads/master",
"NBGV_Version": "2.0.35.62141",
"NBGV_BuildMetadataFragment": "+bdf2320560",
"NBGV_NuGetPackageVersion": "2.0.35-preview",
"NBGV_ChocolateyPackageVersion": "2.0.35-preview",
"NBGV_NpmPackageVersion": "2.0.35-preview",
"NBGV_SemVer1": "2.0.35-preview",
"NBGV_SemVer2": "2.0.35-preview",
"NBGV_SemVer1NumericIdentifierPadding": "4"
},
"CloudBuildVersionVarsEnabled": true,
"CloudBuildVersionVars": {
"GitAssemblyInformationalVersion": "2.0.35-preview+bdf2320560",
"GitBuildVersion": "2.0.35.62141",
"GitBuildVersionSimple": "2.0.35"
},
"BuildMetadata": [],
"BuildMetadataFragment": "+bdf2320560",
"NuGetPackageVersion": "2.0.35-preview",
"ChocolateyPackageVersion": "2.0.35-preview",
"NpmPackageVersion": "2.0.35-preview",
"SemVer1": "2.0.35-preview",
"SemVer2": "2.0.35-preview",
"SemVer1NumericIdentifierPadding": 4
} example {
"CloudBuildNumber": "0.0.0+be5538c1e7",
"CloudBuildNumberEnabled": false,
"BuildMetadataWithCommitId": [
"be5538c1e7"
],
"VersionFileFound": false,
"VersionOptions": null,
"AssemblyVersion": "0.0.0.0",
"AssemblyFileVersion": "0.0.0.21950",
"AssemblyInformationalVersion": "0.0.0+be5538c1e7",
"PublicRelease": false,
"PrereleaseVersion": "",
"PrereleaseVersionNoLeadingHyphen": "",
"SimpleVersion": "0.0.0",
"BuildNumber": 0,
"VersionRevision": 21950,
"MajorMinorVersion": "0.0",
"VersionMajor": 0,
"VersionMinor": 0,
"GitCommitId": "be5538c1e7924cc2a3c745f13eb5dc08a0789ef0",
"GitCommitIdShort": "be5538c1e7",
"GitCommitDate": "2021-04-13T06:11:47+00:00",
"VersionHeight": 0,
"VersionHeightOffset": 0,
"BuildingRef": "refs/heads/master",
"Version": "0.0.0.21950",
"CloudBuildAllVarsEnabled": false,
"CloudBuildAllVars": {
"NBGV_CloudBuildNumber": "0.0.0+be5538c1e7",
"NBGV_VersionFileFound": "False",
"NBGV_AssemblyVersion": "0.0.0.0",
"NBGV_AssemblyFileVersion": "0.0.0.21950",
"NBGV_AssemblyInformationalVersion": "0.0.0+be5538c1e7",
"NBGV_PublicRelease": "False",
"NBGV_PrereleaseVersion": "",
"NBGV_PrereleaseVersionNoLeadingHyphen": "",
"NBGV_SimpleVersion": "0.0.0",
"NBGV_BuildNumber": "0",
"NBGV_VersionRevision": "21950",
"NBGV_MajorMinorVersion": "0.0",
"NBGV_VersionMajor": "0",
"NBGV_VersionMinor": "0",
"NBGV_GitCommitId": "be5538c1e7924cc2a3c745f13eb5dc08a0789ef0",
"NBGV_GitCommitIdShort": "be5538c1e7",
"NBGV_GitCommitDate": "4/13/2021 6:11:47 AM +00:00",
"NBGV_VersionHeight": "0",
"NBGV_VersionHeightOffset": "0",
"NBGV_BuildingRef": "refs/heads/master",
"NBGV_Version": "0.0.0.21950",
"NBGV_BuildMetadataFragment": "+be5538c1e7",
"NBGV_NuGetPackageVersion": "0.0.0-gbe5538c1e7",
"NBGV_ChocolateyPackageVersion": "0.0.0-gbe5538c1e7",
"NBGV_NpmPackageVersion": "0.0.0-gbe5538c1e7",
"NBGV_SemVer1": "0.0.0-be5538c1e7",
"NBGV_SemVer2": "0.0.0-gbe5538c1e7",
"NBGV_SemVer1NumericIdentifierPadding": "4"
},
"CloudBuildVersionVarsEnabled": true,
"CloudBuildVersionVars": {
"GitAssemblyInformationalVersion": "0.0.0+be5538c1e7",
"GitBuildVersion": "0.0.0.21950",
"GitBuildVersionSimple": "0.0.0"
},
"BuildMetadata": [],
"BuildMetadataFragment": "+be5538c1e7",
"NuGetPackageVersion": "0.0.0-gbe5538c1e7",
"ChocolateyPackageVersion": "0.0.0-gbe5538c1e7",
"NpmPackageVersion": "0.0.0-gbe5538c1e7",
"SemVer1": "0.0.0-be5538c1e7",
"SemVer2": "0.0.0-gbe5538c1e7",
"SemVer1NumericIdentifierPadding": 4
} |
@devhawk I was referring to myself when I stated that 😅. This info should work! Let me find some time. |
I hoped/figured. Just trying to be the dev asking for someone to implement my pet feature in a "gentle and well-educated manner" |
@devhawk I did notice the response time from |
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. |
it would be awesome if the git segment supported Nerdbank.GitVersioning. Or if there nbgv had its own segment.
I looked at doing this manually with the Command segment, but the segment would need a mechanism to handle "not a git repo" and "is a git repo but isn't configured for Nerdbank.GitVersioning" scenarios.
The text was updated successfully, but these errors were encountered: