-
Notifications
You must be signed in to change notification settings - Fork 653
Build error when building from detached head should be downgraded to warning. #179
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
@distantcam @JakeGinnivan Has this actually been fixed? I'm currently running into this with the 1.1.0 release version. |
@pvandervelde It has been fixed, but I believe only for GitHubFlow not GitFlow. Do you have a develop branch? |
Yeah I do now. I recently switched from GitHubFlow to GitFlow. I'm currently trying to build the release branch. I think the problem is caused because the build server only checkout the branches it needs. It's currently doing: git clone -q --branch=release/0.3 https://github.com/pvandervelde/nBuildKit.git C:\projects\nbuildkit Then when I run my build when I get to the GitVersion bit on my machine that fails with the aforementioned error. |
Appveyor? Ah, I thought I had fixed that. :( I suspect other changes may have broken Appveyor support. Does it build fine locally, with gitversion turned on? |
Actually in AppVeyor it seems to work. When I run the same build locally (because I'm trying to debug another issue) it fails horribly. Also out of curiosity how did you know it was AppVeyor? |
Appveyor is the only build system I know of that only does a partial clone like that. As I've said I had issues with it in the past. |
Was any progress made on this? I'm running into this now with Jenkins. The git commands look like this:
I end up with the following response to
I'm not sure if GitVersion can go back to the repository and find out which branch this thing is on or that I need to fix up my git 'clone' in Jenkins. If the latter I'd appreciate it if somebody could tell me what to do. |
To add to the excitement I have something else that didn't go quite as expected. My error from yesterday may be due to the fact that there was no merge commit because the builds were on a fresh repository, hence master had 2 files in it (the readme and the license) created in 2 commits by GitHub. I then cloned the repository locally and created a dev branch (used SourceTree to setup my GitFlow branches). After that I started developing on my first feature (created my feature branch) and that all went well (GitVersion gave me version 0.1 which makes sense). Then I merged the code into develop and started a release branch (releases/0.1) at which point it worked in my local workspace but no longer worked on the build server (see previous comment). In order to get past it I did the building and merging from my own workspace (which works just fine) and now I have a repository with my first merge commit on master. I now have to create a hotfix to my current release (created the hotfix/0.1.1 branch). On my local workspace the version number becomes 0.1.1-beta.1+1 but on the build server it becomes 0.1.0. I suspect this is once again because Jenkins only pulls in the change and not any of the other branches. So my question is: Am I doing something wrong here? Should I change my Jenkins setup or is there a config setting / command line parameter that I have to pass to GitVersion? @nulltoken @JakeGinnivan @SimonCropp |
Looks like #326 closes this issue. Closing, lets create a new issue if this is still an issue. |
When building from a detached head, GitVersion errors out the build and the only option is to disable GitVersion.
Instead a warning should be produced, and perhaps set the version to something like "HEAD-[SHA]" to show that this is not a normal build.
The text was updated successfully, but these errors were encountered: