-
Notifications
You must be signed in to change notification settings - Fork 653
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
Cannot get version of a tagged detached head #1501
Comments
I believe I'm running into the same problem here. Everything seems to be OK, except when trying to get version on a tag. You can take a look at these build logs from AppVeyor, pretty much the same as the above: |
I belive we have same problem, here after the error log:
|
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. Thank you for your contributions. |
Stale bot, shoo. It's a valid use case, we like this use case to be supported. 🙏 |
As none of the current maintainers of GitVersion have a need for versioning detached head commits themselves, you can't expect us to implement support for this. However, a pull request adding support for this would be happily merged. Such a pull request would coincidentally fix #2753. |
Just posting a simple workaround for people who didn't think of it but if you simply create a branch out of this detached head (commit in history) then everything works properly. |
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. Thank you for your contributions. |
Hi, I'm new to Gitversion, and I'm doing some experiments to understand how to possibly use it within my company.
I have a POC git repository, using GitFlow. This repository has some branches and some tags:
While checking out tag 0.1.1 and running gitversion command line produced the expected output (FullSemVer is "0.1.1", as the tag says), checking out tag 0.1.0 produces an error message, containing the following text:
INFO [10/16/18 8:53:52:82] End: Attempting to inherit branch configuration from parent branch (Took: 97.94ms)
INFO [10/16/18 8:53:52:85] Running against branch: (no branch) (194bc9cfcd989f95357070a7350439d9f3b172d8)
INFO [10/16/18 8:53:52:86] Current commit is tagged with version 0.1.0, version calcuation is for metadata only.
ERROR [10/16/18 8:53:52:86] An unexpected error occurred:
GitTools.WarningException: It looks like the branch being examined is a detached Head pointing to commit '194bc9c'. Without a proper branch name GitVersion cannot determine the build version.
at GitVersion.GitVersionFinder.EnsureHeadIsNotDetached(GitVersionContext context)
at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context)
at GitVersion.ExecuteCore.<>c__DisplayClass6_0.b__0(IRepository repo)
at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
at GitVersion.Program.VerifyArgumentsAndRun()
INFO [10/16/18 8:53:52:86]
INFO [10/16/18 8:53:52:86] Attempting to show the current git graph (please include in issue):
INFO [10/16/18 8:53:52:86] Showing max of 100 commits
INFO [10/16/18 8:53:52:95] * b7328c5 15 hours ago (origin/develop, develop)
If I run
git describe
on the same checkout, it returns "0.1.0".From the documentation, I understood that, if a commit is tagged, that tag will always correspond to the returned version, in order to be able to go back to that tag and always have the same version returned by gitversion. Am I missing something?
The text was updated successfully, but these errors were encountered: