-
Notifications
You must be signed in to change notification settings - Fork 652
[Improvement] Better error message when in detached head #2753
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
Comments
Improvements in error messages are always welcome! A PR would be highly appreciated. 🙏🏼 |
I will try to provide something but if you have some spare time for a couple of advices, they would be welcome :) |
If you are able to reproduce the problem with the command line, we can see whether the exception thrown is something sensible and start from there. |
Just for the sake of grouping the info together, here are the steps to reproduce the issue:
|
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. |
A PR that improves the error message of detached heads is still very welcome. :) |
Hey @asbjornu! I am really sorry about all that delay. I had a pretty busy end of year, I will try to give it a go during the week-end. |
No problem, @Evangelink. Take we're in no rush. :) |
Fixed by #3338. |
🎉 This issue has been resolved in version 5.12.0 🎉 Your GitReleaseManager bot 📦🚀 |
I just got the same error again with 5.12.0: ERROR [07/31/23 12:27:11:55] An unexpected error occurred:
[12:27:11]GitVersion.BugException: GitVersion has a bug, your HEAD has moved after repo normalisation.
[12:27:11]
[12:27:11]To disable this error set an environmental variable called IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1
[12:27:11]
[12:27:11]Please run `git log --graph --format="%h %cr %d" --decorate --date=relative --all --remotes=* -n 100` and submit it along with your build log (with personal info removed) in a new issue at https://github.com/GitTools/GitVersion
[12:27:11] at GitVersion.GitPreparer.NormalizeGitDirectory(Boolean noFetch, String currentBranchName, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 192
[12:27:11] at GitVersion.GitPreparer.NormalizeGitDirectory(String targetBranch, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 134
[12:27:11] at GitVersion.GitPreparer.PrepareInternal(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 69
[12:27:11] at GitVersion.GitPreparer.Prepare() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitPreparer.cs:line 48
[12:27:11] at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs:line 43
[12:27:11] at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs:line 66
[12:27:11]Process exited with code 1 When |
Is your improvement request related to a problem? Please describe.
When re-building a commit in history, I often fail to remember to comment the
GitVersion.MsBuild
package reference from my project. Which results in one failure per project with the following message:This error message is pretty generic and could (maybe?) be improved for the case of detached head with a more helpful message.
Detailed Description
Either return a different exit code and document it and/or fail with a message that would be displayed. I haven't done msbuild tasks for quite some time and so I don't really remember what's possible and how to do so.
Context
Relates to #2697
Possible Implementation
The text was updated successfully, but these errors were encountered: