You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calling gitversion with the -c argument always prints out the version for the latest commit. If I add -diag the version for the given commit is returned.
Expected Behavior
gitversion -c 1234 returns version for commit 1234
Actual Behavior
gitversion -c 1234 returns version for the latest commit
$ docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.11.1-ubuntu.20.04-6.0 /repo -c 17de5e82e927b6eadb017d6f2b93f58c2868a40e -diag
INFO [11/25/22 12:19:37:41] Dumping commit graph:
INFO [11/25/22 12:19:37:44] ERROR: fatal: detected dubious ownership in repository at '/repo'
ERROR: To add an exception for this directory, call:
ERROR:
ERROR: git config --global --add safe.directory /repo
INFO [11/25/22 12:19:37:44] Working directory: /repo
INFO [11/25/22 12:19:37:46] Project root is: /repo/
INFO [11/25/22 12:19:37:46] DotGit directory is: /repo/.git
INFO [11/25/22 12:19:37:46] Branch from build environment:
INFO [11/25/22 12:19:37:49] Searching for specific commit '17de5e82e927b6eadb017d6f2b93f58c2868a40e'
INFO [11/25/22 12:19:37:53] Running against branch: main (17de5e8 bump boards)
INFO [11/25/22 12:19:37:54] Begin: Calculating base versions
INFO [11/25/22 12:19:37:55] Fallback base version: 0.1.0 with commit count source 5fe5ae0a5bcd168230f62ab4f46c6425fa9591c8
INFO [11/25/22 12:19:37:58] Git tag '1.0.0': 1.0.0 with commit count source ba3c26dce7c97d635b67fdded8df2c3f1960db22
INFO [11/25/22 12:19:37:61] Found multiple base versions which will produce the same SemVer (1.0.1), taking oldest sourcefor commit counting (Git tag '1.0.0')
INFO [11/25/22 12:19:37:61] Base version used: Git tag '1.0.0': 1.0.0 with commit count source ba3c26dce7c97d635b67fdded8df2c3f1960db22
INFO [11/25/22 12:19:37:61] End: Calculating base versions (Took: 68.04ms)
INFO [11/25/22 12:19:37:61] 4 commits found between ba3c26d bump dependencies and 17de5e8 bump boards
INFO [11/25/22 12:19:37:61] 4 commits found between ba3c26d bump dependencies and 17de5e8 bump boards
Executing GenerateSetVersionMessage for'LocalBuild'.
Executing GenerateBuildLogOutput for'LocalBuild'.
{
"Major": 1,
"Minor": 0,
"Patch": 1,
"PreReleaseTag": "",
"PreReleaseTagWithDash": "",
"PreReleaseLabel": "",
"PreReleaseLabelWithDash": "",
"PreReleaseNumber": null,
"WeightedPreReleaseNumber": 60000,
"BuildMetaData": 4,
"BuildMetaDataPadded": "0004",
"FullBuildMetaData": "4.Branch.main.Sha.17de5e82e927b6eadb017d6f2b93f58c2868a40e",
"MajorMinorPatch": "1.0.1",
"SemVer": "1.0.1",
"LegacySemVer": "1.0.1",
"LegacySemVerPadded": "1.0.1",
"AssemblySemVer": "1.0.1.0",
"AssemblySemFileVer": "1.0.1.0",
"FullSemVer": "1.0.1+4",
"InformationalVersion": "1.0.1+4.Branch.main.Sha.17de5e82e927b6eadb017d6f2b93f58c2868a40e",
"BranchName": "main",
"EscapedBranchName": "main",
"Sha": "17de5e82e927b6eadb017d6f2b93f58c2868a40e",
"ShortSha": "17de5e8",
"NuGetVersionV2": "1.0.1",
"NuGetVersion": "1.0.1",
"NuGetPreReleaseTagV2": "",
"NuGetPreReleaseTag": "",
"VersionSourceSha": "ba3c26dce7c97d635b67fdded8df2c3f1960db22",
"CommitsSinceVersionSource": 4,
"CommitsSinceVersionSourcePadded": "0004",
"UncommittedChanges": 2,
"CommitDate": "2022-04-04"
}
INFO [11/25/22 12:19:37:65] Done writing
$ docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.11.1-ubuntu.20.04-6.0 -version
5.11.1+Branch.support-5.x.Sha.82cbf2c587897ed9906624f3b55f200ac99f084e
Context
I'm evaluating gitversion and wanted to see which versions gitversion would have generated for individual commits in my repository.
Your Environment
Version Used: 5.11.1+Branch.support-5.x.Sha.82cbf2c587897ed9906624f3b55f200ac99f084e
Operating System and version: Docker container gittools/gitversion:5.11.1-ubuntu.20.04-6.0 on an Ubuntu 18.04 host
Link to your project:
Link to your CI build (if appropriate):
The text was updated successfully, but these errors were encountered:
I'm able to reproduce this on macOS 11.7.1. Seems like our test coverage for the -c argument is poor. I don't use the -c argument myself, so I don't have much incentive to fix this, but I would warmly welcome a PR that adds tests and fixes this bug.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
Describe the bug
Calling
gitversion
with the-c
argument always prints out the version for the latest commit. If I add-diag
the version for the given commit is returned.Expected Behavior
gitversion -c 1234
returns version for commit 1234Actual Behavior
gitversion -c 1234
returns version for the latest commitPossible Fix
?
Steps to Reproduce
$ docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.11.1-ubuntu.20.04-6.0 -version 5.11.1+Branch.support-5.x.Sha.82cbf2c587897ed9906624f3b55f200ac99f084e
Context
I'm evaluating gitversion and wanted to see which versions gitversion would have generated for individual commits in my repository.
Your Environment
5.11.1+Branch.support-5.x.Sha.82cbf2c587897ed9906624f3b55f200ac99f084e
gittools/gitversion:5.11.1-ubuntu.20.04-6.0
on an Ubuntu 18.04 hostThe text was updated successfully, but these errors were encountered: