Skip to content

Compiling projects with GitVersionTask (5.0.1) is incredibly slow on detached head  #1868

Closed
@mzanin

Description

@mzanin

Perhaps related to #694

Compiling a solution with 20+ projects all referencing the GitVersionTask nuget package basically never completes due to GitVersion taking so long.
This is the exception produced by GitVersion:

GitVersionTask.targets(10, 9):   WARN [10/24/19 11:15:01:04] Could not determine assembly version: GitVersion.WarningException: It looks like the branch being examined is a detached Head pointing to commit 'b1008a6'. Without a proper branch name GitVersion cannot determine the build version.
   at GitVersion.GitVersionFinder.EnsureHeadIsNotDetached(GitVersionContext context) in D:\a\1\s\src\GitVersionCore\GitVersionFinder.cs:line 43
   at GitVersion.GitVersionFinder.FindVersion(GitVersionContext context) in D:\a\1\s\src\GitVersionCore\GitVersionFinder.cs:line 16
   at GitVersion.ExecuteCore.<>c__DisplayClass7_0.<ExecuteInternal>b__0(IRepository repo) in D:\a\1\s\src\GitVersionCore\ExecuteCore.cs:line 111
   at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action) in D:\a\1\s\src\GitVersionCore\GitPreparer.cs:line 92
   at GitVersion.ExecuteCore.ExecuteInternal(String targetBranch, String commitId, GitPreparer gitPreparer, IBuildServer buildServer, Config overrideConfig) in D:\a\1\s\src\GitVersionCore\ExecuteCore.cs:line 108
   at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache) in D:\a\1\s\src\GitVersionCore\ExecuteCore.cs:line 55
   at GitVersion.ExecuteCore.TryGetVersion(String directory, VersionVariables& versionVariables, Boolean noFetch, Authentication authentication) in D:\a\1\s\src\GitVersionCore\ExecuteCore.cs:line 79

GitVersion.exe took 10 seconds or so to execute which is also much longer than usual and no version number was computed....

Is there a way to configure this behaviour? This is my GitVersion.yml:

mode: ContinuousDelivery
assembly-versioning-scheme: MajorMinor
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{CommitsSinceVersionSource}'
assembly-informational-format: '{SemVer} {ShortSha}'
increment: None
branches:
  master:
    mode: ContinuousDelivery
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
ignore:
  sha: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions