-
Notifications
You must be signed in to change notification settings - Fork 11
HEAD has moved #49
Comments
We're getting a similar error on AppVeyor pulling GitVersion.Portable from chocolatey since 4.0.0-beta0014. We're also getting the same error using the recently-released 4.0 stable version on AppVeyor (without using chocolatey). We're trying to determine if it's an issue with our workflow, pretty vanilla Github Flow. AppVeyor builds the PRs before they're merged to
Here's the build log with (slightly) personal info removed:
My bug may be related to appveyor/ci#2740 |
Seeing the same issue. Any update on this? |
This just occurred for us today with GitVersionTask 4.0.0 and a Multibranch Pipeline job in Jenkins. The |
I just had this on Jenkins after interactively rebasing + squashing commits on a feature branch. Can't tell though whether it is 100% reproducible yet... |
We're seeing this behavior as well after upgrading from 4.0.0-beta12 to 4.0.0. When building a pipeline job that builds a merge request to merge a feature into develop. Settings the environment variabele works, but produces the wrong version number. |
Any update on this? |
I found this issue was because Jenkins was checking out a branch named This trips up gitversion in a few ways (eg. branch config resolution which does not remove Following this, you need to delete the local branch That resolved my problem. Hopefully this helps someone else. |
@JoshSchreuder I use Jenkins to build Gerrit changes where it is set to checkout |
As GitVersion stopped using |
IF BUG, INCLUDE THIS PART:
Steps to reproduce
Platform: windows
.NET version: 4.6.1
Expected behaviour
Produce version json output
Actual behaviour
Error happens, cannot reproduce this error using console (it only appears during jenkins build)
Jenkins log:
`
[3] Running batch script
INFO [09/10/18 10:10:45:57] Working directory: C:\Jenkins\Workspace\PlatformTools\nugetdeployer\PR-16\3
INFO [09/10/18 10:10:45:58] IsDynamicGitRepository: False
INFO [09/10/18 10:10:45:62] Returning Project Root from DotGitDirectory: C:\Jenkins\Workspace\PlatformTools\nugetdeployer\PR-16\3.git - C:\Jenkins\Workspace\PlatformTools\nugetdeployer\PR-16\3
INFO [09/10/18 10:10:45:62] Running on Windows.
INFO [09/10/18 10:10:45:63] Applicable build agent found: 'Jenkins'.
INFO [09/10/18 10:10:45:63] Branch from build environment: PR-16
INFO [09/10/18 10:10:45:63] Begin: Normalizing git directory for branch 'PR-16'
INFO [09/10/18 10:10:45:73] One remote found (origin -> 'https://stash.company.com/scm/EPT/nugetdeployer.git').
INFO [09/10/18 10:10:45:74] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
INFO [09/10/18 10:10:45:75] Updating local branch refs/heads/PR-16 to match ref PR-16
INFO [09/10/18 10:10:45:81] Creating local branch from remote tracking 'refs/remotes/origin/bugfix/retryCopy'.
INFO [09/10/18 10:10:45:86] Creating local branch from remote tracking 'refs/remotes/origin/bugfix/xunitRef'.
INFO [09/10/18 10:10:45:87] Creating local branch from remote tracking 'refs/remotes/origin/develop'.
INFO [09/10/18 10:10:45:88] Creating local branch from remote tracking 'refs/remotes/origin/feature/usesettings'.
INFO [09/10/18 10:10:45:90] Creating local branch from remote tracking 'refs/remotes/origin/master'.
INFO [09/10/18 10:10:45:90] HEAD points at branch 'refs/heads/PR-16'.
INFO [09/10/18 10:10:45:91] End: Normalizing git directory for branch 'PR-16' (Took: 278.01ms)
ERROR [09/10/18 10:10:45:91] An unexpected error occurred:
GitTools.Git.BugException: GitTools.Core has a bug, your HEAD has moved after repo normalisation.
To disable this error set an environmental variable called IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1
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/GitTools.Coreat GitTools.Git.GitRepositoryHelper.NormalizeGitDirectory(String gitDirectory, AuthenticationInfo authentication, Boolean noFetch, String currentBranch)
at GitVersion.GitPreparer.Initialise(Boolean normaliseGitDirectory, String currentBranch, Boolean shouldCleanUpRemotes)
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 [09/10/18 10:10:45:91]
INFO [09/10/18 10:10:45:91] Attempting to show the current git graph (please include in issue):
INFO [09/10/18 10:10:45:91] Showing max of 100 commits
INFO [09/10/18 10:10:46:03] * fab5138 53 minutes ago (HEAD -> PR-16, origin/bugfix/xunitRef, origin/PR-16, bugfix/xunitRef)
| * f637db2 5 days ago (origin/develop, develop)
| |\
| | * 24ae8ba 3 weeks ago
| | * 85a9c18 3 weeks ago
| | * 72ba9d3 3 weeks ago
| | * 8020d3f 3 weeks ago
| | * 01bd38c 3 weeks ago
| | |\
| | |/
| |/|
| * | 30226e2 3 weeks ago
| |\ \
|/ / /
| | * 2d47a0a 5 weeks ago
| | | * b7efd95 3 weeks ago (tag: V1.1.2, upstream/master, origin/master, master)
| | | |\
| | ||/
| |/| |
| * | | 23d4661 3 weeks ago (origin/bugfix/retryCopy, bugfix/retryCopy)
| * | | efc76f7 3 weeks ago
|/ / /
| | * 7dd0f09 4 weeks ago (tag: V1.1.1)
| | |\
| ||/
|/| |
|\ \ \
| |/ /
|/| |
| * | fad19b8 4 weeks ago
| * | ffa5dcd 4 weeks ago
| * | ba34408 4 weeks ago
|/ /
| * 4e42786 6 weeks ago (tag: V1.1.0)
| |\
| |/
|/|
|\ \
| * | 60751c0 6 weeks ago
| * | 8bf9e74 6 weeks ago
| * | 0f4c270 6 weeks ago
| * | 3533de3 6 weeks ago
| * | 3b53c94 6 weeks ago
| * | b2ba178 6 weeks ago
| * | c04ceaa 6 weeks ago
| * | 5d75019 6 weeks ago
| * | 518a3a5 6 weeks ago
| * | 1915ccb 7 weeks ago
| * | 14c5bad 7 weeks ago
|/ /
| * d8c4a87 7 weeks ago (tag: V1.0.3)
| |\
| |/
|/|
|\ \
| * | 2d65605 8 weeks ago
| * | f97a379 8 weeks ago
| * | eea1e0e 8 weeks ago
| * | d9fd6fa 8 weeks ago
| * | 434473e 8 weeks ago
| * | 880060d 8 weeks ago
| |/
| * bd20d52 10 weeks ago (tag: V1.0.2)
| |\
|\ \ \
| | |/
| |/|
| * | 2516173 10 weeks ago
| * | 61eb849 10 weeks ago
| |/
| * a7f471b 2 months ago (tag: V1.0.1)
| |\
| |/
|/|
|\ \
| |/
|/|
| * 9a6fe0e 2 months ago
| * 49672f0 2 months ago
| * 0c182a9 2 months ago
| * a471c92 2 months ago
| * 9c2b01e 2 months ago
| * 3cdaf5e 2 months ago
| * 315cc0d 2 months ago
| * 859a133 2 months ago
| * 75bc849 2 months ago
| * 2bc031a 2 months ago
| * 94aad45 2 months ago
|/
| * ba6cc8f 2 months ago (origin/feature/usesettings, feature/usesettings)
| * cf52fda 2 months ago
| * 9844932 2 months ago
|/
script returned exit code 1
`
logging onto node and running same command in same place yields:
C:\jenkins\workspace\PlatformTools\nugetdeployer\PR-16 -> origin\3 (PR-16 -> origin)
λ packages\GitVersion.CommandLine\tools\GitVersion.exe /nofetch /verbosity debug
{
"Major":1,
"Minor":2,
"Patch":0,
"PreReleaseTag":"PullRequest.5",
"PreReleaseTagWithDash":"-PullRequest.5",
"PreReleaseLabel":"PullRequest",
"PreReleaseNumber":5,
"BuildMetaData":"",
"BuildMetaDataPadded":"",
"FullBuildMetaData":"Branch.PR-16.Sha.fab51381529b3963d9e187250686e4fb2e6db5cd",
"MajorMinorPatch":"1.2.0",
"SemVer":"1.2.0-PullRequest.5",
"LegacySemVer":"1.2.0-PullRequest5",
"LegacySemVerPadded":"1.2.0-PullRequest0005",
"AssemblySemVer":"1.0.0.0",
"AssemblySemFileVer":"1.2.0.0",
"FullSemVer":"1.2.0-PullRequest.5",
"InformationalVersion":"1.2.0-PullRequest.5+Branch.PR-16.Sha.fab51381529b3963d9e187250686e4fb2e6db5cd",
"BranchName":"PR-16",
"Sha":"fab51381529b3963d9e187250686e4fb2e6db5cd",
"NuGetVersionV2":"1.2.0-pullrequest0005",
"NuGetVersion":"1.2.0-pullrequest0005",
"NuGetPreReleaseTagV2":"pullrequest0005",
"NuGetPreReleaseTag":"pullrequest0005",
"CommitsSinceVersionSource":5,
"CommitsSinceVersionSourcePadded":"0005",
"CommitDate":"2018-09-10"
}
The text was updated successfully, but these errors were encountered: