[Improvement] Better error message when in detached head
See original GitHub issueIs 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:
Severity Code Description Project File Line Suppression State
Error MSB3073 The command ""C:\Users\XXX\.nuget\packages\gitversion.msbuild\5.6.10\tools\net48/gitversion.exe" "C:\Src\YYY" -output file -outputfile obj\gitversion.json" exited with code 1. YYY C:\Users\XXX\.nuget\packages\gitversion.msbuild\5.6.10\tools\GitVersion.MsBuild.targets 9
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
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Git Detached Head: What Is It & How to Recover
Git detached head might be a weird error message, but don't despair. Learn what this means and how to fix it!
Read more >How do I fix a Git detached head?
Detached head means you are no longer on a branch, you have checked out a single commit in the history (in this case...
Read more >Git detached head: What is it & How to fix it
A git detached HEAD state occurs when you are not on a branch but directly on a specific commit. There are also several...
Read more >Correcting detached head problems with Git
This detached head state occurs when a specific commit is checked out instead of a branch. You cannot commit to a commit—only to...
Read more >Recovering from the Git detached HEAD state
With these simple steps, you have successfully preserved your changes and recovered from the Git detached HEAD state.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
I just got the same error again with 5.12.0:
When
IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1
is added, as recommended here, GitVersion incorrectly picks latest commit and calculates wrong version number of the build.