@gitkraken/core-gitlens 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/README.md +9 -2
- package/dist/_virtual/@oxc-project+runtime/helpers/esm/decorate.js +9 -0
- package/dist/_virtual/@oxc-project+runtime/helpers/esm/usingCtx.js +57 -0
- package/dist/git/cache.d.ts +297 -297
- package/dist/git/cache.js +948 -1276
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +202 -197
- package/dist/git/context.js +12 -8
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +268 -281
- package/dist/git/errors.js +928 -706
- package/dist/git/errors.js.map +1 -1
- package/dist/git/features.d.ts +3 -2
- package/dist/git/features.js +34 -55
- package/dist/git/features.js.map +1 -1
- package/dist/git/gitHealth.d.ts +88 -81
- package/dist/git/gitHealth.js +259 -329
- package/dist/git/gitHealth.js.map +1 -1
- package/dist/git/models/author.d.ts +12 -10
- package/dist/git/models/author.js +0 -2
- package/dist/git/models/autolink.d.ts +36 -37
- package/dist/git/models/autolink.js +0 -2
- package/dist/git/models/blame.d.ts +25 -23
- package/dist/git/models/blame.js +0 -2
- package/dist/git/models/branch.d.ts +74 -72
- package/dist/git/models/branch.js +132 -171
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts +135 -133
- package/dist/git/models/commit.js +381 -484
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/contributor.d.ts +30 -29
- package/dist/git/models/contributor.js +56 -64
- package/dist/git/models/contributor.js.map +1 -1
- package/dist/git/models/defaultBranch.d.ts +5 -3
- package/dist/git/models/defaultBranch.js +0 -2
- package/dist/git/models/diff.d.ts +49 -47
- package/dist/git/models/diff.js +0 -2
- package/dist/git/models/file.d.ts +20 -18
- package/dist/git/models/file.js +0 -2
- package/dist/git/models/fileChange.d.ts +45 -43
- package/dist/git/models/fileChange.js +60 -66
- package/dist/git/models/fileChange.js.map +1 -1
- package/dist/git/models/fileStatus.d.ts +25 -23
- package/dist/git/models/fileStatus.js +30 -26
- package/dist/git/models/fileStatus.js.map +1 -1
- package/dist/git/models/graph.d.ts +328 -320
- package/dist/git/models/graph.js +31 -27
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/graphSearch.d.ts +37 -35
- package/dist/git/models/graphSearch.js +0 -2
- package/dist/git/models/graphSession.d.ts +158 -66
- package/dist/git/models/graphSession.js +72 -1
- package/dist/git/models/graphSession.js.map +1 -1
- package/dist/git/models/issue.d.ts +171 -150
- package/dist/git/models/issue.js +86 -88
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/models/issueOrPullRequest.d.ts +16 -14
- package/dist/git/models/issueOrPullRequest.js +0 -2
- package/dist/git/models/lineRange.d.ts +6 -4
- package/dist/git/models/lineRange.js +0 -2
- package/dist/git/models/log.d.ts +18 -16
- package/dist/git/models/log.js +0 -2
- package/dist/git/models/mergeConflicts.d.ts +17 -15
- package/dist/git/models/mergeConflicts.js +0 -2
- package/dist/git/models/patch.d.ts +14 -12
- package/dist/git/models/patch.js +0 -2
- package/dist/git/models/pausedOperationStatus.d.ts +42 -40
- package/dist/git/models/pausedOperationStatus.js +0 -2
- package/dist/git/models/pullRequest.d.ts +238 -236
- package/dist/git/models/pullRequest.js +151 -163
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/rebase.d.ts +30 -28
- package/dist/git/models/rebase.js +0 -2
- package/dist/git/models/reference.d.ts +57 -55
- package/dist/git/models/reference.js +0 -2
- package/dist/git/models/reflog.d.ts +29 -27
- package/dist/git/models/reflog.js +63 -82
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/remote.d.ts +34 -32
- package/dist/git/models/remote.js +74 -95
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/remoteProvider.d.ts +86 -84
- package/dist/git/models/remoteProvider.js +145 -150
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/remoteResource.d.ts +58 -56
- package/dist/git/models/remoteResource.js +15 -12
- package/dist/git/models/remoteResource.js.map +1 -1
- package/dist/git/models/repository.d.ts +144 -142
- package/dist/git/models/repository.js +358 -406
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/repositoryChangeEvent.d.ts +8 -6
- package/dist/git/models/repositoryChangeEvent.js +26 -24
- package/dist/git/models/repositoryChangeEvent.js.map +1 -1
- package/dist/git/models/repositoryIdentities.d.ts +50 -46
- package/dist/git/models/repositoryIdentities.js +7 -5
- package/dist/git/models/repositoryIdentities.js.map +1 -1
- package/dist/git/models/repositoryMetadata.d.ts +9 -7
- package/dist/git/models/repositoryMetadata.js +0 -2
- package/dist/git/models/resourceDescriptor.d.ts +11 -9
- package/dist/git/models/resourceDescriptor.js +0 -2
- package/dist/git/models/revision.d.ts +2 -0
- package/dist/git/models/revision.js +8 -5
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/models/search.d.ts +48 -47
- package/dist/git/models/search.js +53 -49
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/models/shortlog.d.ts +5 -3
- package/dist/git/models/shortlog.js +0 -2
- package/dist/git/models/signature.d.ts +28 -26
- package/dist/git/models/signature.js +0 -2
- package/dist/git/models/staging.d.ts +18 -16
- package/dist/git/models/staging.js +0 -2
- package/dist/git/models/stash.d.ts +5 -3
- package/dist/git/models/stash.js +0 -2
- package/dist/git/models/status.d.ts +51 -49
- package/dist/git/models/status.js +172 -205
- package/dist/git/models/status.js.map +1 -1
- package/dist/git/models/statusFile.d.ts +35 -34
- package/dist/git/models/statusFile.js +112 -125
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/models/tag.d.ts +34 -32
- package/dist/git/models/tag.js +64 -77
- package/dist/git/models/tag.js.map +1 -1
- package/dist/git/models/tree.d.ts +8 -6
- package/dist/git/models/tree.js +0 -2
- package/dist/git/models/user.d.ts +6 -4
- package/dist/git/models/user.js +0 -2
- package/dist/git/models/worktree.d.ts +50 -48
- package/dist/git/models/worktree.js +102 -133
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts +7 -5
- package/dist/git/parsers/diffParser.js +438 -587
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts +3 -1
- package/dist/git/parsers/rebaseTodoParser.js +165 -208
- package/dist/git/parsers/rebaseTodoParser.js.map +1 -1
- package/dist/git/providers/blame.d.ts +12 -10
- package/dist/git/providers/blame.js +0 -2
- package/dist/git/providers/branches.d.ts +96 -94
- package/dist/git/providers/branches.js +0 -2
- package/dist/git/providers/commits.d.ts +105 -104
- package/dist/git/providers/commits.js +0 -2
- package/dist/git/providers/config.d.ts +80 -78
- package/dist/git/providers/config.js +0 -2
- package/dist/git/providers/contributors.d.ts +23 -21
- package/dist/git/providers/contributors.js +0 -2
- package/dist/git/providers/diff.d.ts +68 -66
- package/dist/git/providers/diff.js +0 -2
- package/dist/git/providers/graph.d.ts +73 -62
- package/dist/git/providers/graph.js +0 -2
- package/dist/git/providers/maintenance.d.ts +180 -178
- package/dist/git/providers/maintenance.js +0 -20
- package/dist/git/providers/operations.d.ts +114 -112
- package/dist/git/providers/operations.js +0 -2
- package/dist/git/providers/patch.d.ts +26 -24
- package/dist/git/providers/patch.js +0 -2
- package/dist/git/providers/pausedOperations.d.ts +19 -17
- package/dist/git/providers/pausedOperations.js +0 -2
- package/dist/git/providers/provider.d.ts +52 -50
- package/dist/git/providers/provider.js +0 -2
- package/dist/git/providers/refs.d.ts +42 -40
- package/dist/git/providers/refs.js +0 -2
- package/dist/git/providers/remotes.d.ts +24 -22
- package/dist/git/providers/remotes.js +0 -2
- package/dist/git/providers/revision.d.ts +25 -23
- package/dist/git/providers/revision.js +0 -2
- package/dist/git/providers/shared/remotes.d.ts +24 -22
- package/dist/git/providers/shared/remotes.js +52 -77
- package/dist/git/providers/shared/remotes.js.map +1 -1
- package/dist/git/providers/staging.d.ts +37 -35
- package/dist/git/providers/staging.js +0 -2
- package/dist/git/providers/stash.d.ts +38 -36
- package/dist/git/providers/stash.js +0 -2
- package/dist/git/providers/status.d.ts +32 -30
- package/dist/git/providers/status.js +0 -2
- package/dist/git/providers/tags.d.ts +20 -18
- package/dist/git/providers/tags.js +0 -2
- package/dist/git/providers/types.d.ts +19 -17
- package/dist/git/providers/types.js +0 -2
- package/dist/git/providers/worktrees.d.ts +26 -24
- package/dist/git/providers/worktrees.js +0 -2
- package/dist/git/remotes/azure-devops.d.ts +46 -45
- package/dist/git/remotes/azure-devops.js +252 -257
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/remotes/bitbucket-server.d.ts +30 -29
- package/dist/git/remotes/bitbucket-server.js +141 -142
- package/dist/git/remotes/bitbucket-server.js.map +1 -1
- package/dist/git/remotes/bitbucket.d.ts +27 -26
- package/dist/git/remotes/bitbucket.js +114 -111
- package/dist/git/remotes/bitbucket.js.map +1 -1
- package/dist/git/remotes/custom.d.ts +26 -25
- package/dist/git/remotes/custom.js +130 -130
- package/dist/git/remotes/custom.js.map +1 -1
- package/dist/git/remotes/gerrit.d.ts +29 -28
- package/dist/git/remotes/gerrit.js +140 -143
- package/dist/git/remotes/gerrit.js.map +1 -1
- package/dist/git/remotes/gitea.d.ts +28 -27
- package/dist/git/remotes/gitea.js +141 -145
- package/dist/git/remotes/gitea.js.map +1 -1
- package/dist/git/remotes/github.d.ts +35 -34
- package/dist/git/remotes/github.js +196 -190
- package/dist/git/remotes/github.js.map +1 -1
- package/dist/git/remotes/gitlab.d.ts +31 -30
- package/dist/git/remotes/gitlab.js +245 -227
- package/dist/git/remotes/gitlab.js.map +1 -1
- package/dist/git/remotes/google-source.d.ts +16 -14
- package/dist/git/remotes/google-source.js +33 -31
- package/dist/git/remotes/google-source.js.map +1 -1
- package/dist/git/remotes/matcher.d.ts +16 -14
- package/dist/git/remotes/matcher.js +141 -124
- package/dist/git/remotes/matcher.js.map +1 -1
- package/dist/git/repositoryService.d.ts +47 -47
- package/dist/git/repositoryService.js +47 -44
- package/dist/git/repositoryService.js.map +1 -1
- package/dist/git/run.types.d.ts +91 -76
- package/dist/git/run.types.js +0 -2
- package/dist/git/service.d.ts +73 -71
- package/dist/git/service.js +286 -302
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts +4 -2
- package/dist/git/utils/autolink.utils.js +103 -139
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts +22 -20
- package/dist/git/utils/blame.utils.js +196 -230
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/branch.utils.d.ts +7 -9
- package/dist/git/utils/branch.utils.js +89 -115
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/commit.utils.d.ts +10 -16
- package/dist/git/utils/commit.utils.js +28 -47
- package/dist/git/utils/commit.utils.js.map +1 -1
- package/dist/git/utils/config.utils.d.ts +2 -0
- package/dist/git/utils/config.utils.js +14 -5
- package/dist/git/utils/config.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts +16 -13
- package/dist/git/utils/conflictResolution.utils.js +116 -113
- package/dist/git/utils/conflictResolution.utils.js.map +1 -1
- package/dist/git/utils/contributor.utils.d.ts +10 -8
- package/dist/git/utils/contributor.utils.js +47 -69
- package/dist/git/utils/contributor.utils.js.map +1 -1
- package/dist/git/utils/fetch.utils.d.ts +2 -0
- package/dist/git/utils/fetch.utils.js +33 -44
- package/dist/git/utils/fetch.utils.js.map +1 -1
- package/dist/git/utils/fileStatus.utils.d.ts +22 -21
- package/dist/git/utils/fileStatus.utils.js +59 -45
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/graph.utils.d.ts +19 -1
- package/dist/git/utils/graph.utils.js +60 -35
- package/dist/git/utils/graph.utils.js.map +1 -1
- package/dist/git/utils/issue.utils.d.ts +3 -1
- package/dist/git/utils/issue.utils.js +154 -158
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts +3 -1
- package/dist/git/utils/issueOrPullRequest.utils.js +23 -20
- package/dist/git/utils/issueOrPullRequest.utils.js.map +1 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts +4 -1
- package/dist/git/utils/mergeConflicts.utils.js +28 -15
- package/dist/git/utils/mergeConflicts.utils.js.map +1 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts +7 -42
- package/dist/git/utils/pausedOperationStatus.utils.js +83 -146
- package/dist/git/utils/pausedOperationStatus.utils.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts +7 -5
- package/dist/git/utils/pullRequest.utils.js +180 -187
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +6 -6
- package/dist/git/utils/reachability.utils.js +120 -147
- package/dist/git/utils/reachability.utils.js.map +1 -1
- package/dist/git/utils/rebase.utils.d.ts +3 -1
- package/dist/git/utils/rebase.utils.js +87 -71
- package/dist/git/utils/rebase.utils.js.map +1 -1
- package/dist/git/utils/reference.utils.d.ts +33 -32
- package/dist/git/utils/reference.utils.js +152 -179
- package/dist/git/utils/reference.utils.js.map +1 -1
- package/dist/git/utils/remote.utils.d.ts +5 -3
- package/dist/git/utils/remote.utils.js +77 -116
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git/utils/repository.utils.d.ts +3 -1
- package/dist/git/utils/repository.utils.js +12 -11
- package/dist/git/utils/repository.utils.js.map +1 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts +3 -1
- package/dist/git/utils/resourceDescriptor.utils.js +8 -14
- package/dist/git/utils/resourceDescriptor.utils.js.map +1 -1
- package/dist/git/utils/revision.utils.d.ts +11 -10
- package/dist/git/utils/revision.utils.js +69 -83
- package/dist/git/utils/revision.utils.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts +5 -3
- package/dist/git/utils/search.utils.js +383 -522
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts +22 -20
- package/dist/git/utils/sorting.js +133 -227
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/sshKey.utils.d.ts +2 -0
- package/dist/git/utils/sshKey.utils.js +10 -15
- package/dist/git/utils/sshKey.utils.js.map +1 -1
- package/dist/git/utils/status.utils.d.ts +20 -15
- package/dist/git/utils/status.utils.js +93 -79
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/utils/statusFile.utils.d.ts +6 -4
- package/dist/git/utils/statusFile.utils.js +71 -72
- package/dist/git/utils/statusFile.utils.js.map +1 -1
- package/dist/git/utils/tag.utils.d.ts +4 -2
- package/dist/git/utils/tag.utils.js +10 -8
- package/dist/git/utils/tag.utils.js.map +1 -1
- package/dist/git/utils/tooltip.utils.d.ts +5 -2
- package/dist/git/utils/tooltip.utils.js +49 -24
- package/dist/git/utils/tooltip.utils.js.map +1 -1
- package/dist/git/utils/uriAuthority.d.ts +9 -7
- package/dist/git/utils/uriAuthority.js +19 -16
- package/dist/git/utils/uriAuthority.js.map +1 -1
- package/dist/git/utils/user.utils.d.ts +3 -1
- package/dist/git/utils/user.utils.js +6 -10
- package/dist/git/utils/user.utils.js.map +1 -1
- package/dist/git/utils/worktree.utils.d.ts +5 -3
- package/dist/git/utils/worktree.utils.js +14 -12
- package/dist/git/utils/worktree.utils.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts +38 -36
- package/dist/git/watching/changeEvent.js +60 -67
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts +3 -1
- package/dist/git/watching/classifyChange.js +50 -79
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts +43 -41
- package/dist/git/watching/gitIgnoreFilter.js +92 -107
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts +22 -20
- package/dist/git/watching/initWatcher.js +58 -57
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/provider.d.ts +8 -7
- package/dist/git/watching/provider.js +0 -2
- package/dist/git/watching/watchGroup.d.ts +29 -28
- package/dist/git/watching/watchGroup.js +105 -137
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +70 -68
- package/dist/git/watching/watchService.js +275 -339
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +112 -111
- package/dist/git/watching/watchSession.js +260 -314
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts +4 -2
- package/dist/git/watching/watcherPatterns.js +21 -24
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +117 -114
- package/dist/git-cli/cliGitProvider.js +261 -283
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/eventLoopMonitor.d.ts +26 -0
- package/dist/git-cli/exec/eventLoopMonitor.js +61 -0
- package/dist/git-cli/exec/eventLoopMonitor.js.map +1 -0
- package/dist/git-cli/exec/exec.d.ts +3 -4
- package/dist/git-cli/exec/exec.errors.d.ts +2 -2
- package/dist/git-cli/exec/exec.errors.js +2 -2
- package/dist/git-cli/exec/exec.js +3 -3
- package/dist/git-cli/exec/exec.types.d.ts +2 -2
- package/dist/git-cli/exec/exec.types.js +0 -2
- package/dist/git-cli/exec/features.d.ts +2 -3
- package/dist/git-cli/exec/features.js +2 -2
- package/dist/git-cli/exec/git.d.ts +224 -205
- package/dist/git-cli/exec/git.js +834 -1042
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +51 -48
- package/dist/git-cli/exec/gitQueue.js +225 -260
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/exec/locator.d.ts +8 -6
- package/dist/git-cli/exec/locator.js +95 -121
- package/dist/git-cli/exec/locator.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts +22 -20
- package/dist/git-cli/parsers/blameParser.js +238 -332
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/indexParser.d.ts +3 -1
- package/dist/git-cli/parsers/indexParser.js +146 -221
- package/dist/git-cli/parsers/indexParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts +103 -110
- package/dist/git-cli/parsers/logParser.js +998 -1199
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts +5 -3
- package/dist/git-cli/parsers/mergeTreeParser.js +28 -72
- package/dist/git-cli/parsers/mergeTreeParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts +5 -4
- package/dist/git-cli/parsers/refParser.js +92 -137
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts +7 -6
- package/dist/git-cli/parsers/reflogParser.js +100 -173
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/parsers/remoteParser.d.ts +4 -2
- package/dist/git-cli/parsers/remoteParser.js +74 -126
- package/dist/git-cli/parsers/remoteParser.js.map +1 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts +4 -2
- package/dist/git-cli/parsers/shortlogParser.js +44 -49
- package/dist/git-cli/parsers/shortlogParser.js.map +1 -1
- package/dist/git-cli/parsers/signatureParser.d.ts +3 -1
- package/dist/git-cli/parsers/signatureParser.js +82 -124
- package/dist/git-cli/parsers/signatureParser.js.map +1 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts +5 -3
- package/dist/git-cli/parsers/sshSignatureParser.js +55 -64
- package/dist/git-cli/parsers/sshSignatureParser.js.map +1 -1
- package/dist/git-cli/parsers/statusParser.d.ts +4 -2
- package/dist/git-cli/parsers/statusParser.js +148 -205
- package/dist/git-cli/parsers/statusParser.js.map +1 -1
- package/dist/git-cli/parsers/treeParser.d.ts +3 -1
- package/dist/git-cli/parsers/treeParser.js +57 -108
- package/dist/git-cli/parsers/treeParser.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts +4 -3
- package/dist/git-cli/parsers/worktreeParser.js +76 -132
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts +25 -23
- package/dist/git-cli/providers/blame.js +404 -413
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +117 -116
- package/dist/git-cli/providers/branches.js +1132 -1468
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts +4 -2
- package/dist/git-cli/providers/commitFilesetUtils.js +36 -18
- package/dist/git-cli/providers/commitFilesetUtils.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +58 -56
- package/dist/git-cli/providers/commits.js +1084 -1423
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +129 -127
- package/dist/git-cli/providers/config.js +612 -831
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts +29 -28
- package/dist/git-cli/providers/contributors.js +246 -351
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts +97 -94
- package/dist/git-cli/providers/diff.js +638 -845
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +66 -68
- package/dist/git-cli/providers/graph.js +1400 -1848
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/maintenance.d.ts +305 -303
- package/dist/git-cli/providers/maintenance.js +1526 -2078
- package/dist/git-cli/providers/maintenance.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +96 -94
- package/dist/git-cli/providers/operations.js +664 -724
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts +37 -35
- package/dist/git-cli/providers/patch.js +206 -307
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +30 -28
- package/dist/git-cli/providers/pausedOperations.js +475 -506
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +50 -48
- package/dist/git-cli/providers/refs.js +335 -479
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.d.ts +23 -21
- package/dist/git-cli/providers/remotes.js +71 -92
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +27 -25
- package/dist/git-cli/providers/revision.js +288 -304
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +31 -29
- package/dist/git-cli/providers/staging.js +140 -189
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +44 -42
- package/dist/git-cli/providers/stash.js +288 -387
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +61 -59
- package/dist/git-cli/providers/status.js +332 -453
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts +31 -29
- package/dist/git-cli/providers/tags.js +158 -215
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +35 -33
- package/dist/git-cli/providers/worktrees.js +178 -203
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +28 -26
- package/dist/git-cli/service.js +38 -40
- package/dist/git-cli/service.js.map +1 -1
- package/dist/ipc/discovery.d.ts +19 -17
- package/dist/ipc/discovery.js +104 -128
- package/dist/ipc/discovery.js.map +1 -1
- package/dist/ipc/ipcServer.d.ts +16 -14
- package/dist/ipc/ipcServer.js +139 -160
- package/dist/ipc/ipcServer.js.map +1 -1
- package/dist/plus/agents/agentCapabilities.d.ts +50 -37
- package/dist/plus/agents/agentCapabilities.js +138 -173
- package/dist/plus/agents/agentCapabilities.js.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +153 -151
- package/dist/plus/agents/providers/claudeCodeTranscript.js +605 -679
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/providers/gkAgentProvider.d.ts +237 -240
- package/dist/plus/agents/providers/gkAgentProvider.js +2162 -3334
- package/dist/plus/agents/providers/gkAgentProvider.js.map +1 -1
- package/dist/plus/agents/sanitizePrompt.d.ts +2 -0
- package/dist/plus/agents/sanitizePrompt.js +58 -91
- package/dist/plus/agents/sanitizePrompt.js.map +1 -1
- package/dist/plus/agents/stateMachine.d.ts +7 -5
- package/dist/plus/agents/stateMachine.js +135 -163
- package/dist/plus/agents/stateMachine.js.map +1 -1
- package/dist/plus/agents/types.d.ts +333 -336
- package/dist/plus/agents/types.js +48 -48
- package/dist/plus/agents/types.js.map +1 -1
- package/dist/plus/ai/constants.d.ts +3 -1
- package/dist/plus/ai/constants.js +88 -84
- package/dist/plus/ai/constants.js.map +1 -1
- package/dist/plus/ai/errors.d.ts +22 -18
- package/dist/plus/ai/errors.js +158 -138
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/conversation.d.ts +11 -9
- package/dist/plus/ai/models/conversation.js +30 -26
- package/dist/plus/ai/models/conversation.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +29 -27
- package/dist/plus/ai/models/model.js +663 -471
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +56 -55
- package/dist/plus/ai/models/promptTemplates.js +0 -2
- package/dist/plus/ai/models/provider.d.ts +79 -77
- package/dist/plus/ai/models/provider.js +0 -2
- package/dist/plus/ai/models/results.d.ts +27 -21
- package/dist/plus/ai/models/results.js +0 -2
- package/dist/plus/ai/prompts.d.ts +4 -2
- package/dist/plus/ai/prompts.js +301 -190
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts +33 -32
- package/dist/plus/ai/providers/anthropicProvider.js +484 -381
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/azureProvider.d.ts +18 -16
- package/dist/plus/ai/providers/azureProvider.js +53 -53
- package/dist/plus/ai/providers/azureProvider.js.map +1 -1
- package/dist/plus/ai/providers/context.d.ts +23 -20
- package/dist/plus/ai/providers/context.js +0 -2
- package/dist/plus/ai/providers/deepSeekProvider.d.ts +17 -15
- package/dist/plus/ai/providers/deepSeekProvider.js +45 -39
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts +16 -14
- package/dist/plus/ai/providers/geminiProvider.js +316 -230
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +22 -20
- package/dist/plus/ai/providers/gitkrakenProvider.js +165 -260
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts +16 -14
- package/dist/plus/ai/providers/huggingFaceProvider.js +45 -46
- package/dist/plus/ai/providers/huggingFaceProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts +22 -20
- package/dist/plus/ai/providers/mistralProvider.js +263 -195
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts +26 -24
- package/dist/plus/ai/providers/ollamaProvider.js +156 -189
- package/dist/plus/ai/providers/ollamaProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts +18 -16
- package/dist/plus/ai/providers/openAICompatibleProvider.js +50 -50
- package/dist/plus/ai/providers/openAICompatibleProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +187 -185
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +356 -475
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts +20 -19
- package/dist/plus/ai/providers/openRouterProvider.js +60 -65
- package/dist/plus/ai/providers/openRouterProvider.js.map +1 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts +17 -15
- package/dist/plus/ai/providers/openaiProvider.js +35 -34
- package/dist/plus/ai/providers/openaiProvider.js.map +1 -1
- package/dist/plus/ai/providers/responseFormatCache.d.ts +4 -2
- package/dist/plus/ai/providers/responseFormatCache.js +21 -17
- package/dist/plus/ai/providers/responseFormatCache.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts +16 -14
- package/dist/plus/ai/providers/xaiProvider.js +61 -46
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts +4 -2
- package/dist/plus/ai/utils/ai.utils.js +50 -77
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts +7 -5
- package/dist/plus/ai/utils/results.utils.js +235 -269
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +3 -2
- package/dist/plus/ai/utils/truncation.utils.js +242 -205
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/config.d.ts +58 -56
- package/dist/plus/git-github/api/config.js +15 -11
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +500 -497
- package/dist/plus/git-github/api/github.js +2326 -3121
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/github.utils.d.ts +5 -3
- package/dist/plus/git-github/api/github.utils.js +24 -19
- package/dist/plus/git-github/api/github.utils.js.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts +5 -3
- package/dist/plus/git-github/api/issueSearchQuery.js +204 -221
- package/dist/plus/git-github/api/issueSearchQuery.js.map +1 -1
- package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts +6 -5
- package/dist/plus/git-github/api/pullRequestSearchQuery.js +89 -116
- package/dist/plus/git-github/api/pullRequestSearchQuery.js.map +1 -1
- package/dist/plus/git-github/api/token.d.ts +10 -8
- package/dist/plus/git-github/api/token.js +0 -2
- package/dist/plus/git-github/api/tokenUtils.d.ts +4 -2
- package/dist/plus/git-github/api/tokenUtils.js +14 -10
- package/dist/plus/git-github/api/tokenUtils.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts +94 -92
- package/dist/plus/git-github/api/types.js +0 -2
- package/dist/plus/git-github/context.d.ts +65 -63
- package/dist/plus/git-github/context.js +13 -9
- package/dist/plus/git-github/context.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +182 -182
- package/dist/plus/git-github/models.js +199 -265
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts +32 -31
- package/dist/plus/git-github/providers/github/blame.js +137 -150
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +42 -40
- package/dist/plus/git-github/providers/github/branches.js +199 -274
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts +35 -33
- package/dist/plus/git-github/providers/github/commits.js +527 -606
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/config.d.ts +10 -8
- package/dist/plus/git-github/providers/github/config.js +35 -45
- package/dist/plus/git-github/providers/github/config.js.map +1 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts +25 -24
- package/dist/plus/git-github/providers/github/contributors.js +174 -216
- package/dist/plus/git-github/providers/github/contributors.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts +34 -32
- package/dist/plus/git-github/providers/github/diff.js +154 -194
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/graph.d.ts +33 -31
- package/dist/plus/git-github/providers/github/graph.js +400 -452
- package/dist/plus/git-github/providers/github/graph.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts +33 -31
- package/dist/plus/git-github/providers/github/refs.js +97 -131
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts +8 -6
- package/dist/plus/git-github/providers/github/remotes.js +30 -35
- package/dist/plus/git-github/providers/github/remotes.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts +13 -11
- package/dist/plus/git-github/providers/github/revision.js +106 -129
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts +24 -22
- package/dist/plus/git-github/providers/github/status.js +49 -47
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts +21 -19
- package/dist/plus/git-github/providers/github/tags.js +78 -103
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts +67 -64
- package/dist/plus/git-github/providers/githubGitProvider.js +131 -128
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts +46 -44
- package/dist/plus/git-github/providers/githubProvider.js +0 -2
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts +29 -27
- package/dist/plus/integrations/authentication/cloudIntegrationService.js +173 -208
- package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +126 -107
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +399 -497
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +73 -72
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +153 -232
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +61 -59
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +100 -124
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts +14 -12
- package/dist/plus/integrations/authentication/manualTokenProvider.js +26 -51
- package/dist/plus/integrations/authentication/manualTokenProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/models.d.ts +102 -85
- package/dist/plus/integrations/authentication/models.js +55 -54
- package/dist/plus/integrations/authentication/models.js.map +1 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +19 -17
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js +53 -51
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +12 -10
- package/dist/plus/integrations/collectionMetadata.js +204 -254
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/constants.d.ts +60 -34
- package/dist/plus/integrations/constants.js +157 -132
- package/dist/plus/integrations/constants.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +253 -252
- package/dist/plus/integrations/context.js +0 -2
- package/dist/plus/integrations/errors.d.ts +26 -25
- package/dist/plus/integrations/errors.js +116 -140
- package/dist/plus/integrations/errors.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +36 -40
- package/dist/plus/integrations/index.js +46 -57
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +445 -440
- package/dist/plus/integrations/integrationService.js +1054 -1324
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/lite.d.ts +33 -31
- package/dist/plus/integrations/lite.js +84 -122
- package/dist/plus/integrations/lite.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +592 -580
- package/dist/plus/integrations/manager.js +0 -2
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +420 -415
- package/dist/plus/integrations/models/gitHostIntegration.js +1180 -1293
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +200 -190
- package/dist/plus/integrations/models/integration.js +577 -722
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issueCache.d.ts +15 -13
- package/dist/plus/integrations/models/issueCache.js +9 -7
- package/dist/plus/integrations/models/issueCache.js.map +1 -1
- package/dist/plus/integrations/models/issueReads.d.ts +108 -85
- package/dist/plus/integrations/models/issueReads.js +0 -2
- package/dist/plus/integrations/models/issuesIntegration.d.ts +72 -71
- package/dist/plus/integrations/models/issuesIntegration.js +160 -186
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/models/pullRequestReads.d.ts +9 -7
- package/dist/plus/integrations/models/pullRequestReads.js +0 -2
- package/dist/plus/integrations/providerFilters.d.ts +8 -20
- package/dist/plus/integrations/providerFilters.js +11 -7
- package/dist/plus/integrations/providerFilters.js.map +1 -1
- package/dist/plus/integrations/providers/accounts.d.ts +7 -5
- package/dist/plus/integrations/providers/accounts.js +21 -31
- package/dist/plus/integrations/providers/accounts.js.map +1 -1
- package/dist/plus/integrations/providers/apiClients.d.ts +13 -10
- package/dist/plus/integrations/providers/apiClients.js +51 -36
- package/dist/plus/integrations/providers/apiClients.js.map +1 -1
- package/dist/plus/integrations/providers/apiConfig.d.ts +31 -29
- package/dist/plus/integrations/providers/apiConfig.js +18 -16
- package/dist/plus/integrations/providers/apiConfig.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +69 -67
- package/dist/plus/integrations/providers/azure/azure.js +452 -577
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +228 -226
- package/dist/plus/integrations/providers/azure/models.js +223 -251
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +132 -131
- package/dist/plus/integrations/providers/azureDevOps.js +773 -931
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +50 -48
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +417 -585
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts +179 -179
- package/dist/plus/integrations/providers/bitbucket/models.js +96 -144
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts +111 -109
- package/dist/plus/integrations/providers/bitbucket-server/models.js +102 -121
- package/dist/plus/integrations/providers/bitbucket-server/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +79 -79
- package/dist/plus/integrations/providers/bitbucket-server.js +205 -241
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +80 -79
- package/dist/plus/integrations/providers/bitbucket.js +390 -477
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.d.ts +5 -3
- package/dist/plus/integrations/providers/github/github.js +38 -45
- package/dist/plus/integrations/providers/github/github.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.utils.d.ts +8 -5
- package/dist/plus/integrations/providers/github/github.utils.js +7 -4
- package/dist/plus/integrations/providers/github/github.utils.js.map +1 -1
- package/dist/plus/integrations/providers/github/models.d.ts +2 -3
- package/dist/plus/integrations/providers/github/models.js +2 -2
- package/dist/plus/integrations/providers/github.d.ts +174 -172
- package/dist/plus/integrations/providers/github.js +431 -523
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +67 -66
- package/dist/plus/integrations/providers/gitlab/gitlab.js +546 -757
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +7 -5
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js +45 -46
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts +109 -107
- package/dist/plus/integrations/providers/gitlab/models.js +74 -89
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +115 -114
- package/dist/plus/integrations/providers/gitlab.js +440 -528
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +3 -1
- package/dist/plus/integrations/providers/issueSorts.js +66 -62
- package/dist/plus/integrations/providers/issueSorts.js.map +1 -1
- package/dist/plus/integrations/providers/jira-server.d.ts +90 -0
- package/dist/plus/integrations/providers/jira-server.js +322 -0
- package/dist/plus/integrations/providers/jira-server.js.map +1 -0
- package/dist/plus/integrations/providers/jira.d.ts +41 -39
- package/dist/plus/integrations/providers/jira.js +378 -440
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +3 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.js +85 -89
- package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +63 -62
- package/dist/plus/integrations/providers/linear.js +315 -358
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +514 -503
- package/dist/plus/integrations/providers/models.js +816 -865
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts +35 -2
- package/dist/plus/integrations/providers/providerErrors.js +120 -81
- package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +299 -271
- package/dist/plus/integrations/providers/providersApi.js +1048 -1001
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/pullRequestReviews.d.ts +21 -21
- package/dist/plus/integrations/providers/pullRequestReviews.js +64 -90
- package/dist/plus/integrations/providers/pullRequestReviews.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +35 -34
- package/dist/plus/integrations/providers/trello.js +136 -143
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +4 -2
- package/dist/plus/integrations/providers/utils/providerPaging.js +131 -156
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/providers/utils.d.ts +51 -50
- package/dist/plus/integrations/providers/utils.js +185 -296
- package/dist/plus/integrations/providers/utils.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +10 -8
- package/dist/plus/integrations/reads/broaden.js +320 -439
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/context.d.ts +47 -45
- package/dist/plus/integrations/reads/context.js +0 -2
- package/dist/plus/integrations/reads/counts.d.ts +74 -72
- package/dist/plus/integrations/reads/counts.js +233 -314
- package/dist/plus/integrations/reads/counts.js.map +1 -1
- package/dist/plus/integrations/reads/cursors.d.ts +26 -24
- package/dist/plus/integrations/reads/cursors.js +80 -115
- package/dist/plus/integrations/reads/cursors.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts +24 -23
- package/dist/plus/integrations/reads/drains.js +225 -298
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +84 -80
- package/dist/plus/integrations/reads/filters.js +326 -414
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.d.ts +14 -12
- package/dist/plus/integrations/reads/hierarchy.js +248 -332
- package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts +11 -9
- package/dist/plus/integrations/reads/hierarchy.utils.js +109 -108
- package/dist/plus/integrations/reads/hierarchy.utils.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +28 -26
- package/dist/plus/integrations/reads/issueBatch.js +83 -85
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts +42 -33
- package/dist/plus/integrations/reads/issueTracker.js +265 -386
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/issues.d.ts +50 -47
- package/dist/plus/integrations/reads/issues.js +202 -331
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/ordering.d.ts +32 -30
- package/dist/plus/integrations/reads/ordering.js +47 -43
- package/dist/plus/integrations/reads/ordering.js.map +1 -1
- package/dist/plus/integrations/reads/paging.d.ts +59 -57
- package/dist/plus/integrations/reads/paging.js +244 -261
- package/dist/plus/integrations/reads/paging.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts +37 -35
- package/dist/plus/integrations/reads/pullRequests.js +95 -148
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/resolveRepository.d.ts +15 -13
- package/dist/plus/integrations/reads/resolveRepository.js +147 -231
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/dist/plus/integrations/reads/searchIssues.d.ts +29 -27
- package/dist/plus/integrations/reads/searchIssues.js +104 -153
- package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +20 -18
- package/dist/plus/integrations/reads/searchPullRequests.js +91 -113
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.d.ts +6 -4
- package/dist/plus/integrations/reads/sweeps.js +143 -178
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts +24 -16
- package/dist/plus/integrations/reads/trackerIssue.js +52 -49
- package/dist/plus/integrations/reads/trackerIssue.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +10 -7
- package/dist/plus/integrations/reads/warnings.js +264 -291
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +201 -199
- package/dist/plus/integrations/results.js +105 -119
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/plus/integrations/telemetry.d.ts +7 -5
- package/dist/plus/integrations/telemetry.js +9 -9
- package/dist/plus/integrations/telemetry.js.map +1 -1
- package/dist/plus/integrations/utils/domain.utils.d.ts +21 -0
- package/dist/plus/integrations/utils/domain.utils.js +55 -22
- package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts +30 -6
- package/dist/plus/integrations/utils/integration.utils.js +154 -161
- package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
- package/dist/utils/array.d.ts +9 -7
- package/dist/utils/array.js +110 -126
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/base64.d.ts +2 -2
- package/dist/utils/base64.js +2 -2
- package/dist/utils/brand.d.ts +4 -3
- package/dist/utils/brand.js +0 -2
- package/dist/utils/cancellation.d.ts +24 -24
- package/dist/utils/cancellation.js +152 -167
- package/dist/utils/cancellation.js.map +1 -1
- package/dist/utils/charCode.d.ts +31 -37
- package/dist/utils/charCode.js +41 -37
- package/dist/utils/charCode.js.map +1 -1
- package/dist/utils/coalescedRun.d.ts +10 -8
- package/dist/utils/coalescedRun.js +39 -41
- package/dist/utils/coalescedRun.js.map +1 -1
- package/dist/utils/color.d.ts +137 -135
- package/dist/utils/color.js +535 -660
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/counter.d.ts +5 -3
- package/dist/utils/counter.js +19 -17
- package/dist/utils/counter.js.map +1 -1
- package/dist/utils/crypto.d.ts +2 -2
- package/dist/utils/crypto.js +2 -2
- package/dist/utils/date.d.ts +10 -9
- package/dist/utils/date.js +312 -350
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.d.ts +45 -43
- package/dist/utils/debounce.js +175 -206
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/decorators/debounce.d.ts +3 -1
- package/dist/utils/decorators/debounce.js +16 -19
- package/dist/utils/decorators/debounce.js.map +1 -1
- package/dist/utils/decorators/gate.d.ts +13 -11
- package/dist/utils/decorators/gate.js +97 -124
- package/dist/utils/decorators/gate.js.map +1 -1
- package/dist/utils/decorators/log.d.ts +25 -24
- package/dist/utils/decorators/log.js +166 -227
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/memoize.d.ts +10 -8
- package/dist/utils/decorators/memoize.js +49 -57
- package/dist/utils/decorators/memoize.js.map +1 -1
- package/dist/utils/decorators/resolver.d.ts +2 -0
- package/dist/utils/decorators/resolver.js +64 -75
- package/dist/utils/decorators/resolver.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts +15 -14
- package/dist/utils/decorators/sequentialize.js +61 -80
- package/dist/utils/decorators/sequentialize.js.map +1 -1
- package/dist/utils/decorators/serializable.d.ts +2 -0
- package/dist/utils/decorators/serializable.js +30 -39
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts +23 -21
- package/dist/utils/dedupedAsyncCache.js +63 -66
- package/dist/utils/dedupedAsyncCache.js.map +1 -1
- package/dist/utils/diff.d.ts +2 -0
- package/dist/utils/diff.js +41 -51
- package/dist/utils/diff.js.map +1 -1
- package/dist/utils/disposable.d.ts +15 -13
- package/dist/utils/disposable.js +71 -80
- package/dist/utils/disposable.js.map +1 -1
- package/dist/utils/dom.d.ts +45 -0
- package/dist/utils/dom.js +106 -0
- package/dist/utils/dom.js.map +1 -0
- package/dist/utils/encoding.d.ts +2 -0
- package/dist/utils/encoding.js +7 -5
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/env/browser/base64.d.ts +2 -0
- package/dist/utils/env/browser/base64.js +32 -34
- package/dist/utils/env/browser/base64.js.map +1 -1
- package/dist/utils/env/browser/crypto.d.ts +2 -0
- package/dist/utils/env/browser/crypto.js +17 -13
- package/dist/utils/env/browser/crypto.js.map +1 -1
- package/dist/utils/env/browser/fs.d.ts +2 -0
- package/dist/utils/env/browser/fs.js +6 -2
- package/dist/utils/env/browser/fs.js.map +1 -1
- package/dist/utils/env/browser/hex.d.ts +2 -0
- package/dist/utils/env/browser/hex.js +271 -29
- package/dist/utils/env/browser/hex.js.map +1 -1
- package/dist/utils/env/browser/hrtime.d.ts +2 -0
- package/dist/utils/env/browser/hrtime.js +17 -13
- package/dist/utils/env/browser/hrtime.js.map +1 -1
- package/dist/utils/env/browser/logScope.d.ts +3 -1
- package/dist/utils/env/browser/logScope.js +39 -43
- package/dist/utils/env/browser/logScope.js.map +1 -1
- package/dist/utils/env/browser/md5.d.ts +2 -0
- package/dist/utils/env/browser/md5.js +211 -184
- package/dist/utils/env/browser/md5.js.map +1 -1
- package/dist/utils/env/browser/platform.d.ts +3 -0
- package/dist/utils/env/browser/platform.js +11 -4
- package/dist/utils/env/browser/platform.js.map +1 -1
- package/dist/utils/env/node/base64.d.ts +2 -0
- package/dist/utils/env/node/base64.js +13 -11
- package/dist/utils/env/node/base64.js.map +1 -1
- package/dist/utils/env/node/crypto.d.ts +2 -0
- package/dist/utils/env/node/crypto.js +13 -9
- package/dist/utils/env/node/crypto.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts +66 -65
- package/dist/utils/env/node/exec.js +255 -267
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/env/node/fs.d.ts +2 -0
- package/dist/utils/env/node/fs.js +7 -3
- package/dist/utils/env/node/fs.js.map +1 -1
- package/dist/utils/env/node/hex.d.ts +2 -0
- package/dist/utils/env/node/hex.js +10 -6
- package/dist/utils/env/node/hex.js.map +1 -1
- package/dist/utils/env/node/hrtime.d.ts +2 -2
- package/dist/utils/env/node/hrtime.js +2 -2
- package/dist/utils/env/node/logScope.d.ts +3 -1
- package/dist/utils/env/node/logScope.js +52 -42
- package/dist/utils/env/node/logScope.js.map +1 -1
- package/dist/utils/env/node/platform.d.ts +3 -0
- package/dist/utils/env/node/platform.js +11 -4
- package/dist/utils/env/node/platform.js.map +1 -1
- package/dist/utils/error.d.ts +8 -6
- package/dist/utils/error.js +16 -14
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/event.d.ts +27 -25
- package/dist/utils/event.js +141 -170
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/formatter.d.ts +15 -14
- package/dist/utils/formatter.js +96 -129
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/fs.d.ts +2 -2
- package/dist/utils/fs.js +2 -2
- package/dist/utils/function.d.ts +5 -6
- package/dist/utils/function.js +73 -90
- package/dist/utils/function.js.map +1 -1
- package/dist/utils/fuzzy.d.ts +18 -16
- package/dist/utils/fuzzy.js +121 -127
- package/dist/utils/fuzzy.js.map +1 -1
- package/dist/utils/gitRefs.d.ts +11 -0
- package/dist/utils/gitRefs.js +21 -0
- package/dist/utils/gitRefs.js.map +1 -0
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.js +49 -47
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/hex.d.ts +2 -2
- package/dist/utils/hex.js +2 -2
- package/dist/utils/hostingServiceType.d.ts +8 -0
- package/dist/utils/hostingServiceType.js +0 -0
- package/dist/utils/hrtime.d.ts +4 -2
- package/dist/utils/hrtime.js +8 -5
- package/dist/utils/hrtime.js.map +1 -1
- package/dist/utils/iterable.d.ts +3 -1
- package/dist/utils/iterable.js +591 -616
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/keys/chord.d.ts +27 -25
- package/dist/utils/keys/chord.js +108 -122
- package/dist/utils/keys/chord.js.map +1 -1
- package/dist/utils/keys/keybinding.d.ts +98 -22
- package/dist/utils/keys/keybinding.js +151 -53
- package/dist/utils/keys/keybinding.js.map +1 -1
- package/dist/utils/keys/keymapDispatcher.d.ts +66 -0
- package/dist/utils/keys/keymapDispatcher.js +187 -0
- package/dist/utils/keys/keymapDispatcher.js.map +1 -0
- package/dist/utils/lazy.d.ts +14 -12
- package/dist/utils/lazy.js +35 -36
- package/dist/utils/lazy.js.map +1 -1
- package/dist/utils/loggable.d.ts +3 -1
- package/dist/utils/loggable.js +6 -2
- package/dist/utils/loggable.js.map +1 -1
- package/dist/utils/logger.d.ts +48 -46
- package/dist/utils/logger.js +219 -304
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/logger.scoped.d.ts +30 -28
- package/dist/utils/logger.scoped.js +133 -147
- package/dist/utils/logger.scoped.js.map +1 -1
- package/dist/utils/lruMap.d.ts +34 -32
- package/dist/utils/lruMap.js +97 -101
- package/dist/utils/lruMap.js.map +1 -1
- package/dist/utils/markdown.d.ts +5 -3
- package/dist/utils/markdown.js +52 -88
- package/dist/utils/markdown.js.map +1 -1
- package/dist/utils/mru.d.ts +13 -11
- package/dist/utils/mru.js +57 -62
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/object.d.ts +9 -34
- package/dist/utils/object.js +132 -191
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.d.ts +36 -34
- package/dist/utils/paging.js +42 -45
- package/dist/utils/paging.js.map +1 -1
- package/dist/utils/path.d.ts +4 -1
- package/dist/utils/path.js +129 -162
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/pausedOperation.d.ts +42 -0
- package/dist/utils/pausedOperation.js +62 -0
- package/dist/utils/pausedOperation.js.map +1 -0
- package/dist/utils/platform.d.ts +2 -2
- package/dist/utils/platform.js +2 -2
- package/dist/utils/plural.d.ts +21 -0
- package/dist/utils/plural.js +136 -0
- package/dist/utils/plural.js.map +1 -0
- package/dist/utils/promise.d.ts +19 -18
- package/dist/utils/promise.js +323 -360
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +331 -330
- package/dist/utils/promiseCache.js +602 -717
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/resourceUsage.d.ts +2 -0
- package/dist/utils/resourceUsage.js +0 -2
- package/dist/utils/searchTree.d.ts +51 -49
- package/dist/utils/searchTree.js +306 -396
- package/dist/utils/searchTree.js.map +1 -1
- package/dist/utils/stopwatch.d.ts +33 -32
- package/dist/utils/stopwatch.js +67 -81
- package/dist/utils/stopwatch.js.map +1 -1
- package/dist/utils/string.d.ts +17 -24
- package/dist/utils/string.js +787 -803
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/subscriptionManager.d.ts +15 -14
- package/dist/utils/subscriptionManager.js +36 -33
- package/dist/utils/subscriptionManager.js.map +1 -1
- package/dist/utils/trie.d.ts +64 -62
- package/dist/utils/trie.js +438 -580
- package/dist/utils/trie.js.map +1 -1
- package/dist/utils/types.d.ts +8 -16
- package/dist/utils/types.js +0 -2
- package/dist/utils/uri.d.ts +27 -25
- package/dist/utils/uri.js +42 -42
- package/dist/utils/uri.js.map +1 -1
- package/dist/utils/validation.d.ts +13 -12
- package/dist/utils/validation.js +17 -23
- package/dist/utils/validation.js.map +1 -1
- package/dist/utils/version.d.ts +6 -5
- package/dist/utils/version.js +77 -104
- package/dist/utils/version.js.map +1 -1
- package/docs/integrations.md +70 -26
- package/package.json +18 -8
- package/dist/git/cache.d.ts.map +0 -1
- package/dist/git/context.d.ts.map +0 -1
- package/dist/git/errors.d.ts.map +0 -1
- package/dist/git/features.d.ts.map +0 -1
- package/dist/git/gitHealth.d.ts.map +0 -1
- package/dist/git/models/author.d.ts.map +0 -1
- package/dist/git/models/author.js.map +0 -1
- package/dist/git/models/autolink.d.ts.map +0 -1
- package/dist/git/models/autolink.js.map +0 -1
- package/dist/git/models/blame.d.ts.map +0 -1
- package/dist/git/models/blame.js.map +0 -1
- package/dist/git/models/branch.d.ts.map +0 -1
- package/dist/git/models/commit.d.ts.map +0 -1
- package/dist/git/models/contributor.d.ts.map +0 -1
- package/dist/git/models/defaultBranch.d.ts.map +0 -1
- package/dist/git/models/defaultBranch.js.map +0 -1
- package/dist/git/models/diff.d.ts.map +0 -1
- package/dist/git/models/diff.js.map +0 -1
- package/dist/git/models/file.d.ts.map +0 -1
- package/dist/git/models/file.js.map +0 -1
- package/dist/git/models/fileChange.d.ts.map +0 -1
- package/dist/git/models/fileStatus.d.ts.map +0 -1
- package/dist/git/models/graph.d.ts.map +0 -1
- package/dist/git/models/graphSearch.d.ts.map +0 -1
- package/dist/git/models/graphSearch.js.map +0 -1
- package/dist/git/models/graphSession.d.ts.map +0 -1
- package/dist/git/models/issue.d.ts.map +0 -1
- package/dist/git/models/issueOrPullRequest.d.ts.map +0 -1
- package/dist/git/models/issueOrPullRequest.js.map +0 -1
- package/dist/git/models/lineRange.d.ts.map +0 -1
- package/dist/git/models/lineRange.js.map +0 -1
- package/dist/git/models/log.d.ts.map +0 -1
- package/dist/git/models/log.js.map +0 -1
- package/dist/git/models/mergeConflicts.d.ts.map +0 -1
- package/dist/git/models/mergeConflicts.js.map +0 -1
- package/dist/git/models/patch.d.ts.map +0 -1
- package/dist/git/models/patch.js.map +0 -1
- package/dist/git/models/pausedOperationStatus.d.ts.map +0 -1
- package/dist/git/models/pausedOperationStatus.js.map +0 -1
- package/dist/git/models/pullRequest.d.ts.map +0 -1
- package/dist/git/models/rebase.d.ts.map +0 -1
- package/dist/git/models/rebase.js.map +0 -1
- package/dist/git/models/reference.d.ts.map +0 -1
- package/dist/git/models/reference.js.map +0 -1
- package/dist/git/models/reflog.d.ts.map +0 -1
- package/dist/git/models/remote.d.ts.map +0 -1
- package/dist/git/models/remoteProvider.d.ts.map +0 -1
- package/dist/git/models/remoteResource.d.ts.map +0 -1
- package/dist/git/models/repository.d.ts.map +0 -1
- package/dist/git/models/repositoryChangeEvent.d.ts.map +0 -1
- package/dist/git/models/repositoryIdentities.d.ts.map +0 -1
- package/dist/git/models/repositoryMetadata.d.ts.map +0 -1
- package/dist/git/models/repositoryMetadata.js.map +0 -1
- package/dist/git/models/resourceDescriptor.d.ts.map +0 -1
- package/dist/git/models/resourceDescriptor.js.map +0 -1
- package/dist/git/models/revision.d.ts.map +0 -1
- package/dist/git/models/search.d.ts.map +0 -1
- package/dist/git/models/shortlog.d.ts.map +0 -1
- package/dist/git/models/shortlog.js.map +0 -1
- package/dist/git/models/signature.d.ts.map +0 -1
- package/dist/git/models/signature.js.map +0 -1
- package/dist/git/models/staging.d.ts.map +0 -1
- package/dist/git/models/staging.js.map +0 -1
- package/dist/git/models/stash.d.ts.map +0 -1
- package/dist/git/models/stash.js.map +0 -1
- package/dist/git/models/status.d.ts.map +0 -1
- package/dist/git/models/statusFile.d.ts.map +0 -1
- package/dist/git/models/tag.d.ts.map +0 -1
- package/dist/git/models/tree.d.ts.map +0 -1
- package/dist/git/models/tree.js.map +0 -1
- package/dist/git/models/user.d.ts.map +0 -1
- package/dist/git/models/user.js.map +0 -1
- package/dist/git/models/worktree.d.ts.map +0 -1
- package/dist/git/parsers/diffParser.d.ts.map +0 -1
- package/dist/git/parsers/rebaseTodoParser.d.ts.map +0 -1
- package/dist/git/providers/blame.d.ts.map +0 -1
- package/dist/git/providers/blame.js.map +0 -1
- package/dist/git/providers/branches.d.ts.map +0 -1
- package/dist/git/providers/branches.js.map +0 -1
- package/dist/git/providers/commits.d.ts.map +0 -1
- package/dist/git/providers/commits.js.map +0 -1
- package/dist/git/providers/config.d.ts.map +0 -1
- package/dist/git/providers/config.js.map +0 -1
- package/dist/git/providers/contributors.d.ts.map +0 -1
- package/dist/git/providers/contributors.js.map +0 -1
- package/dist/git/providers/diff.d.ts.map +0 -1
- package/dist/git/providers/diff.js.map +0 -1
- package/dist/git/providers/graph.d.ts.map +0 -1
- package/dist/git/providers/graph.js.map +0 -1
- package/dist/git/providers/maintenance.d.ts.map +0 -1
- package/dist/git/providers/maintenance.js.map +0 -1
- package/dist/git/providers/operations.d.ts.map +0 -1
- package/dist/git/providers/operations.js.map +0 -1
- package/dist/git/providers/patch.d.ts.map +0 -1
- package/dist/git/providers/patch.js.map +0 -1
- package/dist/git/providers/pausedOperations.d.ts.map +0 -1
- package/dist/git/providers/pausedOperations.js.map +0 -1
- package/dist/git/providers/provider.d.ts.map +0 -1
- package/dist/git/providers/provider.js.map +0 -1
- package/dist/git/providers/refs.d.ts.map +0 -1
- package/dist/git/providers/refs.js.map +0 -1
- package/dist/git/providers/remotes.d.ts.map +0 -1
- package/dist/git/providers/remotes.js.map +0 -1
- package/dist/git/providers/revision.d.ts.map +0 -1
- package/dist/git/providers/revision.js.map +0 -1
- package/dist/git/providers/shared/remotes.d.ts.map +0 -1
- package/dist/git/providers/staging.d.ts.map +0 -1
- package/dist/git/providers/staging.js.map +0 -1
- package/dist/git/providers/stash.d.ts.map +0 -1
- package/dist/git/providers/stash.js.map +0 -1
- package/dist/git/providers/status.d.ts.map +0 -1
- package/dist/git/providers/status.js.map +0 -1
- package/dist/git/providers/tags.d.ts.map +0 -1
- package/dist/git/providers/tags.js.map +0 -1
- package/dist/git/providers/types.d.ts.map +0 -1
- package/dist/git/providers/types.js.map +0 -1
- package/dist/git/providers/worktrees.d.ts.map +0 -1
- package/dist/git/providers/worktrees.js.map +0 -1
- package/dist/git/remotes/azure-devops.d.ts.map +0 -1
- package/dist/git/remotes/bitbucket-server.d.ts.map +0 -1
- package/dist/git/remotes/bitbucket.d.ts.map +0 -1
- package/dist/git/remotes/custom.d.ts.map +0 -1
- package/dist/git/remotes/gerrit.d.ts.map +0 -1
- package/dist/git/remotes/gitea.d.ts.map +0 -1
- package/dist/git/remotes/github.d.ts.map +0 -1
- package/dist/git/remotes/gitlab.d.ts.map +0 -1
- package/dist/git/remotes/google-source.d.ts.map +0 -1
- package/dist/git/remotes/matcher.d.ts.map +0 -1
- package/dist/git/repositoryService.d.ts.map +0 -1
- package/dist/git/run.types.d.ts.map +0 -1
- package/dist/git/run.types.js.map +0 -1
- package/dist/git/service.d.ts.map +0 -1
- package/dist/git/utils/autolink.utils.d.ts.map +0 -1
- package/dist/git/utils/blame.utils.d.ts.map +0 -1
- package/dist/git/utils/branch.utils.d.ts.map +0 -1
- package/dist/git/utils/commit.utils.d.ts.map +0 -1
- package/dist/git/utils/config.utils.d.ts.map +0 -1
- package/dist/git/utils/conflictResolution.utils.d.ts.map +0 -1
- package/dist/git/utils/contributor.utils.d.ts.map +0 -1
- package/dist/git/utils/fetch.utils.d.ts.map +0 -1
- package/dist/git/utils/fileStatus.utils.d.ts.map +0 -1
- package/dist/git/utils/graph.utils.d.ts.map +0 -1
- package/dist/git/utils/issue.utils.d.ts.map +0 -1
- package/dist/git/utils/issueOrPullRequest.utils.d.ts.map +0 -1
- package/dist/git/utils/mergeConflicts.utils.d.ts.map +0 -1
- package/dist/git/utils/pausedOperationStatus.utils.d.ts.map +0 -1
- package/dist/git/utils/pullRequest.utils.d.ts.map +0 -1
- package/dist/git/utils/reachability.utils.d.ts.map +0 -1
- package/dist/git/utils/rebase.utils.d.ts.map +0 -1
- package/dist/git/utils/reference.utils.d.ts.map +0 -1
- package/dist/git/utils/remote.utils.d.ts.map +0 -1
- package/dist/git/utils/repository.utils.d.ts.map +0 -1
- package/dist/git/utils/resourceDescriptor.utils.d.ts.map +0 -1
- package/dist/git/utils/revision.utils.d.ts.map +0 -1
- package/dist/git/utils/search.utils.d.ts.map +0 -1
- package/dist/git/utils/sorting.d.ts.map +0 -1
- package/dist/git/utils/sshKey.utils.d.ts.map +0 -1
- package/dist/git/utils/status.utils.d.ts.map +0 -1
- package/dist/git/utils/statusFile.utils.d.ts.map +0 -1
- package/dist/git/utils/tag.utils.d.ts.map +0 -1
- package/dist/git/utils/tooltip.utils.d.ts.map +0 -1
- package/dist/git/utils/uriAuthority.d.ts.map +0 -1
- package/dist/git/utils/user.utils.d.ts.map +0 -1
- package/dist/git/utils/worktree.utils.d.ts.map +0 -1
- package/dist/git/watching/changeEvent.d.ts.map +0 -1
- package/dist/git/watching/classifyChange.d.ts.map +0 -1
- package/dist/git/watching/gitIgnoreFilter.d.ts.map +0 -1
- package/dist/git/watching/initWatcher.d.ts.map +0 -1
- package/dist/git/watching/provider.d.ts.map +0 -1
- package/dist/git/watching/provider.js.map +0 -1
- package/dist/git/watching/watchGroup.d.ts.map +0 -1
- package/dist/git/watching/watchService.d.ts.map +0 -1
- package/dist/git/watching/watchSession.d.ts.map +0 -1
- package/dist/git/watching/watcherPatterns.d.ts.map +0 -1
- package/dist/git-cli/cliGitProvider.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.errors.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.errors.js.map +0 -1
- package/dist/git-cli/exec/exec.js.map +0 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +0 -1
- package/dist/git-cli/exec/exec.types.js.map +0 -1
- package/dist/git-cli/exec/features.d.ts.map +0 -1
- package/dist/git-cli/exec/features.js.map +0 -1
- package/dist/git-cli/exec/git.d.ts.map +0 -1
- package/dist/git-cli/exec/gitQueue.d.ts.map +0 -1
- package/dist/git-cli/exec/locator.d.ts.map +0 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/indexParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/mergeTreeParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/refParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/reflogParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/remoteParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/shortlogParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/signatureParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/sshSignatureParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/statusParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/treeParser.d.ts.map +0 -1
- package/dist/git-cli/parsers/worktreeParser.d.ts.map +0 -1
- package/dist/git-cli/providers/blame.d.ts.map +0 -1
- package/dist/git-cli/providers/branches.d.ts.map +0 -1
- package/dist/git-cli/providers/commitFilesetUtils.d.ts.map +0 -1
- package/dist/git-cli/providers/commits.d.ts.map +0 -1
- package/dist/git-cli/providers/config.d.ts.map +0 -1
- package/dist/git-cli/providers/contributors.d.ts.map +0 -1
- package/dist/git-cli/providers/diff.d.ts.map +0 -1
- package/dist/git-cli/providers/graph.d.ts.map +0 -1
- package/dist/git-cli/providers/maintenance.d.ts.map +0 -1
- package/dist/git-cli/providers/operations.d.ts.map +0 -1
- package/dist/git-cli/providers/patch.d.ts.map +0 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +0 -1
- package/dist/git-cli/providers/refs.d.ts.map +0 -1
- package/dist/git-cli/providers/remotes.d.ts.map +0 -1
- package/dist/git-cli/providers/revision.d.ts.map +0 -1
- package/dist/git-cli/providers/staging.d.ts.map +0 -1
- package/dist/git-cli/providers/stash.d.ts.map +0 -1
- package/dist/git-cli/providers/status.d.ts.map +0 -1
- package/dist/git-cli/providers/tags.d.ts.map +0 -1
- package/dist/git-cli/providers/worktrees.d.ts.map +0 -1
- package/dist/git-cli/service.d.ts.map +0 -1
- package/dist/ipc/discovery.d.ts.map +0 -1
- package/dist/ipc/ipcServer.d.ts.map +0 -1
- package/dist/plus/agents/agentCapabilities.d.ts.map +0 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +0 -1
- package/dist/plus/agents/providers/gkAgentProvider.d.ts.map +0 -1
- package/dist/plus/agents/sanitizePrompt.d.ts.map +0 -1
- package/dist/plus/agents/stateMachine.d.ts.map +0 -1
- package/dist/plus/agents/types.d.ts.map +0 -1
- package/dist/plus/ai/constants.d.ts.map +0 -1
- package/dist/plus/ai/errors.d.ts.map +0 -1
- package/dist/plus/ai/models/conversation.d.ts.map +0 -1
- package/dist/plus/ai/models/model.d.ts.map +0 -1
- package/dist/plus/ai/models/promptTemplates.d.ts.map +0 -1
- package/dist/plus/ai/models/promptTemplates.js.map +0 -1
- package/dist/plus/ai/models/provider.d.ts.map +0 -1
- package/dist/plus/ai/models/provider.js.map +0 -1
- package/dist/plus/ai/models/results.d.ts.map +0 -1
- package/dist/plus/ai/models/results.js.map +0 -1
- package/dist/plus/ai/prompts.d.ts.map +0 -1
- package/dist/plus/ai/providers/anthropicProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/azureProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/context.d.ts.map +0 -1
- package/dist/plus/ai/providers/context.js.map +0 -1
- package/dist/plus/ai/providers/deepSeekProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/geminiProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/huggingFaceProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/mistralProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/ollamaProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/openAICompatibleProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +0 -1
- package/dist/plus/ai/providers/openRouterProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/openaiProvider.d.ts.map +0 -1
- package/dist/plus/ai/providers/responseFormatCache.d.ts.map +0 -1
- package/dist/plus/ai/providers/xaiProvider.d.ts.map +0 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +0 -1
- package/dist/plus/ai/utils/results.utils.d.ts.map +0 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +0 -1
- package/dist/plus/git-github/api/config.d.ts.map +0 -1
- package/dist/plus/git-github/api/github.d.ts.map +0 -1
- package/dist/plus/git-github/api/github.utils.d.ts.map +0 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +0 -1
- package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts.map +0 -1
- package/dist/plus/git-github/api/token.d.ts.map +0 -1
- package/dist/plus/git-github/api/token.js.map +0 -1
- package/dist/plus/git-github/api/tokenUtils.d.ts.map +0 -1
- package/dist/plus/git-github/api/types.d.ts.map +0 -1
- package/dist/plus/git-github/api/types.js.map +0 -1
- package/dist/plus/git-github/context.d.ts.map +0 -1
- package/dist/plus/git-github/models.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/config.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/contributors.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/graph.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/remotes.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +0 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +0 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +0 -1
- package/dist/plus/git-github/providers/githubProvider.d.ts.map +0 -1
- package/dist/plus/git-github/providers/githubProvider.js.map +0 -1
- package/dist/plus/integrations/authentication/cloudIntegrationService.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/manualTokenProvider.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/models.d.ts.map +0 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts.map +0 -1
- package/dist/plus/integrations/collectionMetadata.d.ts.map +0 -1
- package/dist/plus/integrations/constants.d.ts.map +0 -1
- package/dist/plus/integrations/context.d.ts.map +0 -1
- package/dist/plus/integrations/context.js.map +0 -1
- package/dist/plus/integrations/errors.d.ts.map +0 -1
- package/dist/plus/integrations/index.d.ts.map +0 -1
- package/dist/plus/integrations/integrationService.d.ts.map +0 -1
- package/dist/plus/integrations/lite.d.ts.map +0 -1
- package/dist/plus/integrations/manager.d.ts.map +0 -1
- package/dist/plus/integrations/manager.js.map +0 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +0 -1
- package/dist/plus/integrations/models/integration.d.ts.map +0 -1
- package/dist/plus/integrations/models/issueCache.d.ts.map +0 -1
- package/dist/plus/integrations/models/issueReads.d.ts.map +0 -1
- package/dist/plus/integrations/models/issueReads.js.map +0 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +0 -1
- package/dist/plus/integrations/models/pullRequestReads.d.ts.map +0 -1
- package/dist/plus/integrations/models/pullRequestReads.js.map +0 -1
- package/dist/plus/integrations/providerFilters.d.ts.map +0 -1
- package/dist/plus/integrations/providers/accounts.d.ts.map +0 -1
- package/dist/plus/integrations/providers/apiClients.d.ts.map +0 -1
- package/dist/plus/integrations/providers/apiConfig.d.ts.map +0 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts.map +0 -1
- package/dist/plus/integrations/providers/azure/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket-server/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +0 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/github.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/github.utils.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/github/models.js.map +0 -1
- package/dist/plus/integrations/providers/github.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/gitlab.d.ts.map +0 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts.map +0 -1
- package/dist/plus/integrations/providers/jira.d.ts.map +0 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts.map +0 -1
- package/dist/plus/integrations/providers/linear.d.ts.map +0 -1
- package/dist/plus/integrations/providers/models.d.ts.map +0 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts.map +0 -1
- package/dist/plus/integrations/providers/providersApi.d.ts.map +0 -1
- package/dist/plus/integrations/providers/pullRequestReviews.d.ts.map +0 -1
- package/dist/plus/integrations/providers/trello.d.ts.map +0 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +0 -1
- package/dist/plus/integrations/providers/utils.d.ts.map +0 -1
- package/dist/plus/integrations/reads/broaden.d.ts.map +0 -1
- package/dist/plus/integrations/reads/context.d.ts.map +0 -1
- package/dist/plus/integrations/reads/context.js.map +0 -1
- package/dist/plus/integrations/reads/counts.d.ts.map +0 -1
- package/dist/plus/integrations/reads/cursors.d.ts.map +0 -1
- package/dist/plus/integrations/reads/drains.d.ts.map +0 -1
- package/dist/plus/integrations/reads/filters.d.ts.map +0 -1
- package/dist/plus/integrations/reads/hierarchy.d.ts.map +0 -1
- package/dist/plus/integrations/reads/hierarchy.utils.d.ts.map +0 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts.map +0 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +0 -1
- package/dist/plus/integrations/reads/issues.d.ts.map +0 -1
- package/dist/plus/integrations/reads/ordering.d.ts.map +0 -1
- package/dist/plus/integrations/reads/paging.d.ts.map +0 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts.map +0 -1
- package/dist/plus/integrations/reads/resolveRepository.d.ts.map +0 -1
- package/dist/plus/integrations/reads/searchIssues.d.ts.map +0 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts.map +0 -1
- package/dist/plus/integrations/reads/sweeps.d.ts.map +0 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts.map +0 -1
- package/dist/plus/integrations/reads/warnings.d.ts.map +0 -1
- package/dist/plus/integrations/results.d.ts.map +0 -1
- package/dist/plus/integrations/telemetry.d.ts.map +0 -1
- package/dist/plus/integrations/utils/domain.utils.d.ts.map +0 -1
- package/dist/plus/integrations/utils/integration.utils.d.ts.map +0 -1
- package/dist/utils/array.d.ts.map +0 -1
- package/dist/utils/base64.d.ts.map +0 -1
- package/dist/utils/base64.js.map +0 -1
- package/dist/utils/brand.d.ts.map +0 -1
- package/dist/utils/brand.js.map +0 -1
- package/dist/utils/cancellation.d.ts.map +0 -1
- package/dist/utils/charCode.d.ts.map +0 -1
- package/dist/utils/coalescedRun.d.ts.map +0 -1
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/counter.d.ts.map +0 -1
- package/dist/utils/crypto.d.ts.map +0 -1
- package/dist/utils/crypto.js.map +0 -1
- package/dist/utils/date.d.ts.map +0 -1
- package/dist/utils/debounce.d.ts.map +0 -1
- package/dist/utils/decorators/debounce.d.ts.map +0 -1
- package/dist/utils/decorators/gate.d.ts.map +0 -1
- package/dist/utils/decorators/log.d.ts.map +0 -1
- package/dist/utils/decorators/memoize.d.ts.map +0 -1
- package/dist/utils/decorators/resolver.d.ts.map +0 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +0 -1
- package/dist/utils/decorators/serializable.d.ts.map +0 -1
- package/dist/utils/dedupedAsyncCache.d.ts.map +0 -1
- package/dist/utils/diff.d.ts.map +0 -1
- package/dist/utils/disposable.d.ts.map +0 -1
- package/dist/utils/encoding.d.ts.map +0 -1
- package/dist/utils/env/browser/base64.d.ts.map +0 -1
- package/dist/utils/env/browser/crypto.d.ts.map +0 -1
- package/dist/utils/env/browser/fs.d.ts.map +0 -1
- package/dist/utils/env/browser/hex.d.ts.map +0 -1
- package/dist/utils/env/browser/hrtime.d.ts.map +0 -1
- package/dist/utils/env/browser/logScope.d.ts.map +0 -1
- package/dist/utils/env/browser/md5.d.ts.map +0 -1
- package/dist/utils/env/browser/platform.d.ts.map +0 -1
- package/dist/utils/env/node/base64.d.ts.map +0 -1
- package/dist/utils/env/node/crypto.d.ts.map +0 -1
- package/dist/utils/env/node/exec.d.ts.map +0 -1
- package/dist/utils/env/node/fs.d.ts.map +0 -1
- package/dist/utils/env/node/hex.d.ts.map +0 -1
- package/dist/utils/env/node/hrtime.d.ts.map +0 -1
- package/dist/utils/env/node/hrtime.js.map +0 -1
- package/dist/utils/env/node/logScope.d.ts.map +0 -1
- package/dist/utils/env/node/platform.d.ts.map +0 -1
- package/dist/utils/error.d.ts.map +0 -1
- package/dist/utils/event.d.ts.map +0 -1
- package/dist/utils/formatter.d.ts.map +0 -1
- package/dist/utils/fs.d.ts.map +0 -1
- package/dist/utils/fs.js.map +0 -1
- package/dist/utils/function.d.ts.map +0 -1
- package/dist/utils/fuzzy.d.ts.map +0 -1
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hex.d.ts.map +0 -1
- package/dist/utils/hex.js.map +0 -1
- package/dist/utils/hrtime.d.ts.map +0 -1
- package/dist/utils/iterable.d.ts.map +0 -1
- package/dist/utils/keys/chord.d.ts.map +0 -1
- package/dist/utils/keys/keybinding.d.ts.map +0 -1
- package/dist/utils/lazy.d.ts.map +0 -1
- package/dist/utils/loggable.d.ts.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.scoped.d.ts.map +0 -1
- package/dist/utils/lruMap.d.ts.map +0 -1
- package/dist/utils/markdown.d.ts.map +0 -1
- package/dist/utils/mru.d.ts.map +0 -1
- package/dist/utils/object.d.ts.map +0 -1
- package/dist/utils/paging.d.ts.map +0 -1
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/platform.d.ts.map +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/promise.d.ts.map +0 -1
- package/dist/utils/promiseCache.d.ts.map +0 -1
- package/dist/utils/resourceUsage.d.ts.map +0 -1
- package/dist/utils/resourceUsage.js.map +0 -1
- package/dist/utils/searchTree.d.ts.map +0 -1
- package/dist/utils/stopwatch.d.ts.map +0 -1
- package/dist/utils/string.d.ts.map +0 -1
- package/dist/utils/subscriptionManager.d.ts.map +0 -1
- package/dist/utils/trie.d.ts.map +0 -1
- package/dist/utils/types.d.ts.map +0 -1
- package/dist/utils/types.js.map +0 -1
- package/dist/utils/uri.d.ts.map +0 -1
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/version.d.ts.map +0 -1
- package/src/git/cache.ts +0 -1859
- package/src/git/context.ts +0 -301
- package/src/git/errors.ts +0 -1168
- package/src/git/features.ts +0 -98
- package/src/git/gitHealth.ts +0 -522
- package/src/git/models/author.ts +0 -19
- package/src/git/models/autolink.ts +0 -59
- package/src/git/models/blame.ts +0 -46
- package/src/git/models/branch.ts +0 -237
- package/src/git/models/commit.ts +0 -673
- package/src/git/models/contributor.ts +0 -84
- package/src/git/models/defaultBranch.ts +0 -6
- package/src/git/models/diff.ts +0 -74
- package/src/git/models/file.ts +0 -29
- package/src/git/models/fileChange.ts +0 -82
- package/src/git/models/fileStatus.ts +0 -36
- package/src/git/models/graph.ts +0 -444
- package/src/git/models/graphSearch.ts +0 -53
- package/src/git/models/graphSession.ts +0 -102
- package/src/git/models/issue.ts +0 -273
- package/src/git/models/issueOrPullRequest.ts +0 -20
- package/src/git/models/lineRange.ts +0 -7
- package/src/git/models/log.ts +0 -21
- package/src/git/models/mergeConflicts.ts +0 -19
- package/src/git/models/patch.ts +0 -25
- package/src/git/models/pausedOperationStatus.ts +0 -63
- package/src/git/models/pullRequest.ts +0 -357
- package/src/git/models/rebase.ts +0 -60
- package/src/git/models/reference.ts +0 -80
- package/src/git/models/reflog.ts +0 -88
- package/src/git/models/remote.ts +0 -100
- package/src/git/models/remoteProvider.ts +0 -291
- package/src/git/models/remoteResource.ts +0 -87
- package/src/git/models/repository.ts +0 -510
- package/src/git/models/repositoryChangeEvent.ts +0 -30
- package/src/git/models/repositoryIdentities.ts +0 -99
- package/src/git/models/repositoryMetadata.ts +0 -12
- package/src/git/models/resourceDescriptor.ts +0 -28
- package/src/git/models/revision.ts +0 -12
- package/src/git/models/search.ts +0 -138
- package/src/git/models/shortlog.ts +0 -6
- package/src/git/models/signature.ts +0 -45
- package/src/git/models/staging.ts +0 -27
- package/src/git/models/stash.ts +0 -6
- package/src/git/models/status.ts +0 -246
- package/src/git/models/statusFile.ts +0 -131
- package/src/git/models/tag.ts +0 -76
- package/src/git/models/tree.ts +0 -10
- package/src/git/models/user.ts +0 -7
- package/src/git/models/worktree.ts +0 -160
- package/src/git/parsers/diffParser.ts +0 -648
- package/src/git/parsers/rebaseTodoParser.ts +0 -169
- package/src/git/providers/blame.ts +0 -40
- package/src/git/providers/branches.ts +0 -143
- package/src/git/providers/commits.ts +0 -174
- package/src/git/providers/config.ts +0 -167
- package/src/git/providers/contributors.ts +0 -34
- package/src/git/providers/diff.ts +0 -133
- package/src/git/providers/graph.ts +0 -95
- package/src/git/providers/maintenance.ts +0 -224
- package/src/git/providers/operations.ts +0 -164
- package/src/git/providers/patch.ts +0 -31
- package/src/git/providers/pausedOperations.ts +0 -23
- package/src/git/providers/provider.ts +0 -64
- package/src/git/providers/refs.ts +0 -68
- package/src/git/providers/remotes.ts +0 -33
- package/src/git/providers/revision.ts +0 -32
- package/src/git/providers/shared/remotes.ts +0 -95
- package/src/git/providers/staging.ts +0 -36
- package/src/git/providers/stash.ts +0 -51
- package/src/git/providers/status.ts +0 -48
- package/src/git/providers/tags.ts +0 -29
- package/src/git/providers/types.ts +0 -33
- package/src/git/providers/worktrees.ts +0 -37
- package/src/git/remotes/azure-devops.ts +0 -361
- package/src/git/remotes/bitbucket-server.ts +0 -189
- package/src/git/remotes/bitbucket.ts +0 -142
- package/src/git/remotes/custom.ts +0 -162
- package/src/git/remotes/gerrit.ts +0 -186
- package/src/git/remotes/gitea.ts +0 -184
- package/src/git/remotes/github.ts +0 -236
- package/src/git/remotes/gitlab.ts +0 -270
- package/src/git/remotes/google-source.ts +0 -51
- package/src/git/remotes/matcher.ts +0 -215
- package/src/git/repositoryService.ts +0 -180
- package/src/git/run.types.ts +0 -156
- package/src/git/service.ts +0 -369
- package/src/git/utils/autolink.utils.ts +0 -202
- package/src/git/utils/blame.utils.ts +0 -298
- package/src/git/utils/branch.utils.ts +0 -165
- package/src/git/utils/commit.utils.ts +0 -89
- package/src/git/utils/config.utils.ts +0 -8
- package/src/git/utils/conflictResolution.utils.ts +0 -157
- package/src/git/utils/contributor.utils.ts +0 -105
- package/src/git/utils/fetch.utils.ts +0 -48
- package/src/git/utils/fileStatus.utils.ts +0 -62
- package/src/git/utils/graph.utils.ts +0 -46
- package/src/git/utils/issue.utils.ts +0 -187
- package/src/git/utils/issueOrPullRequest.utils.ts +0 -23
- package/src/git/utils/mergeConflicts.utils.ts +0 -21
- package/src/git/utils/pausedOperationStatus.utils.ts +0 -184
- package/src/git/utils/pullRequest.utils.ts +0 -244
- package/src/git/utils/reachability.utils.ts +0 -180
- package/src/git/utils/rebase.utils.ts +0 -128
- package/src/git/utils/reference.utils.ts +0 -267
- package/src/git/utils/remote.utils.ts +0 -146
- package/src/git/utils/repository.utils.ts +0 -18
- package/src/git/utils/resourceDescriptor.utils.ts +0 -26
- package/src/git/utils/revision.utils.ts +0 -149
- package/src/git/utils/search.utils.ts +0 -624
- package/src/git/utils/sorting.ts +0 -329
- package/src/git/utils/sshKey.utils.ts +0 -30
- package/src/git/utils/status.utils.ts +0 -115
- package/src/git/utils/statusFile.utils.ts +0 -182
- package/src/git/utils/tag.utils.ts +0 -17
- package/src/git/utils/tooltip.utils.ts +0 -37
- package/src/git/utils/uriAuthority.ts +0 -34
- package/src/git/utils/user.utils.ts +0 -20
- package/src/git/utils/worktree.utils.ts +0 -21
- package/src/git/watching/changeEvent.ts +0 -95
- package/src/git/watching/classifyChange.ts +0 -104
- package/src/git/watching/gitIgnoreFilter.ts +0 -134
- package/src/git/watching/initWatcher.ts +0 -81
- package/src/git/watching/provider.ts +0 -24
- package/src/git/watching/watchGroup.ts +0 -185
- package/src/git/watching/watchService.ts +0 -430
- package/src/git/watching/watchSession.ts +0 -439
- package/src/git/watching/watcherPatterns.ts +0 -51
- package/src/git-cli/cliGitProvider.ts +0 -461
- package/src/git-cli/exec/exec.errors.ts +0 -1
- package/src/git-cli/exec/exec.ts +0 -11
- package/src/git-cli/exec/exec.types.ts +0 -8
- package/src/git-cli/exec/features.ts +0 -2
- package/src/git-cli/exec/git.ts +0 -1371
- package/src/git-cli/exec/gitQueue.ts +0 -326
- package/src/git-cli/exec/locator.ts +0 -157
- package/src/git-cli/parsers/blameParser.ts +0 -374
- package/src/git-cli/parsers/indexParser.ts +0 -192
- package/src/git-cli/parsers/logParser.ts +0 -1365
- package/src/git-cli/parsers/mergeTreeParser.ts +0 -22
- package/src/git-cli/parsers/refParser.ts +0 -110
- package/src/git-cli/parsers/reflogParser.ts +0 -153
- package/src/git-cli/parsers/remoteParser.ts +0 -95
- package/src/git-cli/parsers/shortlogParser.ts +0 -59
- package/src/git-cli/parsers/signatureParser.ts +0 -162
- package/src/git-cli/parsers/sshSignatureParser.ts +0 -85
- package/src/git-cli/parsers/statusParser.ts +0 -209
- package/src/git-cli/parsers/treeParser.ts +0 -61
- package/src/git-cli/parsers/worktreeParser.ts +0 -111
- package/src/git-cli/providers/blame.ts +0 -598
- package/src/git-cli/providers/branches.ts +0 -1931
- package/src/git-cli/providers/commitFilesetUtils.ts +0 -45
- package/src/git-cli/providers/commits.ts +0 -1856
- package/src/git-cli/providers/config.ts +0 -1025
- package/src/git-cli/providers/contributors.ts +0 -360
- package/src/git-cli/providers/diff.ts +0 -1172
- package/src/git-cli/providers/graph.ts +0 -2237
- package/src/git-cli/providers/maintenance.ts +0 -2599
- package/src/git-cli/providers/operations.ts +0 -1016
- package/src/git-cli/providers/patch.ts +0 -305
- package/src/git-cli/providers/pausedOperations.ts +0 -670
- package/src/git-cli/providers/refs.ts +0 -486
- package/src/git-cli/providers/remotes.ts +0 -115
- package/src/git-cli/providers/revision.ts +0 -383
- package/src/git-cli/providers/staging.ts +0 -210
- package/src/git-cli/providers/stash.ts +0 -577
- package/src/git-cli/providers/status.ts +0 -568
- package/src/git-cli/providers/tags.ts +0 -224
- package/src/git-cli/providers/worktrees.ts +0 -285
- package/src/git-cli/service.ts +0 -82
- package/src/ipc/discovery.ts +0 -186
- package/src/ipc/ipcServer.ts +0 -171
- package/src/plus/agents/agentCapabilities.ts +0 -286
- package/src/plus/agents/providers/claudeCodeTranscript.ts +0 -867
- package/src/plus/agents/providers/gkAgentProvider.ts +0 -4036
- package/src/plus/agents/sanitizePrompt.ts +0 -109
- package/src/plus/agents/stateMachine.ts +0 -197
- package/src/plus/agents/types.ts +0 -500
- package/src/plus/ai/constants.ts +0 -121
- package/src/plus/ai/errors.ts +0 -152
- package/src/plus/ai/models/conversation.ts +0 -35
- package/src/plus/ai/models/model.ts +0 -528
- package/src/plus/ai/models/promptTemplates.ts +0 -171
- package/src/plus/ai/models/provider.ts +0 -125
- package/src/plus/ai/models/results.ts +0 -31
- package/src/plus/ai/prompts.ts +0 -849
- package/src/plus/ai/providers/anthropicProvider.ts +0 -458
- package/src/plus/ai/providers/azureProvider.ts +0 -74
- package/src/plus/ai/providers/context.ts +0 -29
- package/src/plus/ai/providers/deepSeekProvider.ts +0 -46
- package/src/plus/ai/providers/geminiProvider.ts +0 -245
- package/src/plus/ai/providers/gitkrakenProvider.ts +0 -347
- package/src/plus/ai/providers/huggingFaceProvider.ts +0 -64
- package/src/plus/ai/providers/mistralProvider.ts +0 -243
- package/src/plus/ai/providers/ollamaProvider.ts +0 -292
- package/src/plus/ai/providers/openAICompatibleProvider.ts +0 -64
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +0 -654
- package/src/plus/ai/providers/openRouterProvider.ts +0 -101
- package/src/plus/ai/providers/openaiProvider.ts +0 -47
- package/src/plus/ai/providers/responseFormatCache.ts +0 -39
- package/src/plus/ai/providers/xaiProvider.ts +0 -54
- package/src/plus/ai/utils/ai.utils.ts +0 -95
- package/src/plus/ai/utils/results.utils.ts +0 -407
- package/src/plus/ai/utils/truncation.utils.ts +0 -296
- package/src/plus/git-github/api/config.ts +0 -91
- package/src/plus/git-github/api/github.ts +0 -5462
- package/src/plus/git-github/api/github.utils.ts +0 -36
- package/src/plus/git-github/api/issueSearchQuery.ts +0 -273
- package/src/plus/git-github/api/pullRequestSearchQuery.ts +0 -154
- package/src/plus/git-github/api/token.ts +0 -15
- package/src/plus/git-github/api/tokenUtils.ts +0 -15
- package/src/plus/git-github/api/types.ts +0 -197
- package/src/plus/git-github/context.ts +0 -107
- package/src/plus/git-github/models.ts +0 -623
- package/src/plus/git-github/providers/github/blame.ts +0 -225
- package/src/plus/git-github/providers/github/branches.ts +0 -401
- package/src/plus/git-github/providers/github/commits.ts +0 -929
- package/src/plus/git-github/providers/github/config.ts +0 -47
- package/src/plus/git-github/providers/github/contributors.ts +0 -313
- package/src/plus/git-github/providers/github/diff.ts +0 -281
- package/src/plus/git-github/providers/github/graph.ts +0 -635
- package/src/plus/git-github/providers/github/refs.ts +0 -172
- package/src/plus/git-github/providers/github/remotes.ts +0 -44
- package/src/plus/git-github/providers/github/revision.ts +0 -140
- package/src/plus/git-github/providers/github/status.ts +0 -69
- package/src/plus/git-github/providers/github/tags.ts +0 -148
- package/src/plus/git-github/providers/githubGitProvider.ts +0 -168
- package/src/plus/git-github/providers/githubProvider.ts +0 -65
- package/src/plus/integrations/authentication/cloudIntegrationService.ts +0 -292
- package/src/plus/integrations/authentication/configuredIntegrationService.ts +0 -656
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +0 -385
- package/src/plus/integrations/authentication/integrationAuthenticationService.ts +0 -148
- package/src/plus/integrations/authentication/manualTokenProvider.ts +0 -79
- package/src/plus/integrations/authentication/models.ts +0 -202
- package/src/plus/integrations/authentication/rejectedTokenTracker.ts +0 -56
- package/src/plus/integrations/collectionMetadata.ts +0 -325
- package/src/plus/integrations/constants.ts +0 -190
- package/src/plus/integrations/context.ts +0 -386
- package/src/plus/integrations/errors.ts +0 -188
- package/src/plus/integrations/index.ts +0 -231
- package/src/plus/integrations/integrationService.ts +0 -2003
- package/src/plus/integrations/lite.ts +0 -233
- package/src/plus/integrations/manager.ts +0 -728
- package/src/plus/integrations/models/gitHostIntegration.ts +0 -1862
- package/src/plus/integrations/models/integration.ts +0 -1005
- package/src/plus/integrations/models/issueCache.ts +0 -29
- package/src/plus/integrations/models/issueReads.ts +0 -152
- package/src/plus/integrations/models/issuesIntegration.ts +0 -248
- package/src/plus/integrations/models/pullRequestReads.ts +0 -18
- package/src/plus/integrations/providerFilters.ts +0 -36
- package/src/plus/integrations/providers/accounts.ts +0 -38
- package/src/plus/integrations/providers/apiClients.ts +0 -69
- package/src/plus/integrations/providers/apiConfig.ts +0 -71
- package/src/plus/integrations/providers/azure/azure.ts +0 -953
- package/src/plus/integrations/providers/azure/models.ts +0 -723
- package/src/plus/integrations/providers/azureDevOps.ts +0 -1355
- package/src/plus/integrations/providers/bitbucket/bitbucket.ts +0 -904
- package/src/plus/integrations/providers/bitbucket/models.ts +0 -446
- package/src/plus/integrations/providers/bitbucket-server/models.ts +0 -283
- package/src/plus/integrations/providers/bitbucket-server.ts +0 -445
- package/src/plus/integrations/providers/bitbucket.ts +0 -793
- package/src/plus/integrations/providers/github/github.ts +0 -64
- package/src/plus/integrations/providers/github/github.utils.ts +0 -23
- package/src/plus/integrations/providers/github/models.ts +0 -29
- package/src/plus/integrations/providers/github.ts +0 -940
- package/src/plus/integrations/providers/gitlab/gitlab.ts +0 -1320
- package/src/plus/integrations/providers/gitlab/gitlab.utils.ts +0 -80
- package/src/plus/integrations/providers/gitlab/models.ts +0 -271
- package/src/plus/integrations/providers/gitlab.ts +0 -841
- package/src/plus/integrations/providers/issueSorts.ts +0 -89
- package/src/plus/integrations/providers/jira.ts +0 -596
- package/src/plus/integrations/providers/jiraIssueByKey.ts +0 -155
- package/src/plus/integrations/providers/linear.ts +0 -484
- package/src/plus/integrations/providers/models.ts +0 -1833
- package/src/plus/integrations/providers/providerErrors.ts +0 -115
- package/src/plus/integrations/providers/providersApi.ts +0 -1881
- package/src/plus/integrations/providers/pullRequestReviews.ts +0 -122
- package/src/plus/integrations/providers/trello.ts +0 -208
- package/src/plus/integrations/providers/utils/providerPaging.ts +0 -212
- package/src/plus/integrations/providers/utils.ts +0 -419
- package/src/plus/integrations/reads/broaden.ts +0 -704
- package/src/plus/integrations/reads/context.ts +0 -99
- package/src/plus/integrations/reads/counts.ts +0 -610
- package/src/plus/integrations/reads/cursors.ts +0 -224
- package/src/plus/integrations/reads/drains.ts +0 -420
- package/src/plus/integrations/reads/filters.ts +0 -614
- package/src/plus/integrations/reads/hierarchy.ts +0 -486
- package/src/plus/integrations/reads/hierarchy.utils.ts +0 -155
- package/src/plus/integrations/reads/issueBatch.ts +0 -197
- package/src/plus/integrations/reads/issueTracker.ts +0 -556
- package/src/plus/integrations/reads/issues.ts +0 -600
- package/src/plus/integrations/reads/ordering.ts +0 -124
- package/src/plus/integrations/reads/paging.ts +0 -379
- package/src/plus/integrations/reads/pullRequests.ts +0 -260
- package/src/plus/integrations/reads/resolveRepository.ts +0 -275
- package/src/plus/integrations/reads/searchIssues.ts +0 -274
- package/src/plus/integrations/reads/searchPullRequests.ts +0 -235
- package/src/plus/integrations/reads/sweeps.ts +0 -266
- package/src/plus/integrations/reads/trackerIssue.ts +0 -105
- package/src/plus/integrations/reads/warnings.ts +0 -535
- package/src/plus/integrations/results.ts +0 -443
- package/src/plus/integrations/telemetry.ts +0 -29
- package/src/plus/integrations/utils/domain.utils.ts +0 -26
- package/src/plus/integrations/utils/integration.utils.ts +0 -215
- package/src/utils/array.ts +0 -194
- package/src/utils/base64.ts +0 -1
- package/src/utils/brand.ts +0 -7
- package/src/utils/cancellation.ts +0 -199
- package/src/utils/charCode.ts +0 -38
- package/src/utils/coalescedRun.ts +0 -45
- package/src/utils/color.ts +0 -817
- package/src/utils/counter.ts +0 -21
- package/src/utils/crypto.ts +0 -1
- package/src/utils/date.ts +0 -474
- package/src/utils/debounce.ts +0 -303
- package/src/utils/decorators/debounce.ts +0 -31
- package/src/utils/decorators/gate.ts +0 -167
- package/src/utils/decorators/log.ts +0 -320
- package/src/utils/decorators/memoize.ts +0 -98
- package/src/utils/decorators/resolver.ts +0 -95
- package/src/utils/decorators/sequentialize.ts +0 -118
- package/src/utils/decorators/serializable.ts +0 -43
- package/src/utils/dedupedAsyncCache.ts +0 -74
- package/src/utils/diff.ts +0 -61
- package/src/utils/disposable.ts +0 -156
- package/src/utils/encoding.ts +0 -8
- package/src/utils/env/browser/base64.ts +0 -50
- package/src/utils/env/browser/crypto.ts +0 -21
- package/src/utils/env/browser/fs.ts +0 -3
- package/src/utils/env/browser/hex.ts +0 -41
- package/src/utils/env/browser/hrtime.ts +0 -14
- package/src/utils/env/browser/logScope.ts +0 -57
- package/src/utils/env/browser/md5.ts +0 -217
- package/src/utils/env/browser/platform.ts +0 -10
- package/src/utils/env/node/base64.ts +0 -19
- package/src/utils/env/node/crypto.ts +0 -17
- package/src/utils/env/node/exec.ts +0 -488
- package/src/utils/env/node/fs.ts +0 -5
- package/src/utils/env/node/hex.ts +0 -11
- package/src/utils/env/node/hrtime.ts +0 -1
- package/src/utils/env/node/logScope.ts +0 -63
- package/src/utils/env/node/platform.ts +0 -5
- package/src/utils/error.ts +0 -18
- package/src/utils/event.ts +0 -230
- package/src/utils/formatter.ts +0 -198
- package/src/utils/fs.ts +0 -1
- package/src/utils/function.ts +0 -141
- package/src/utils/fuzzy.ts +0 -185
- package/src/utils/hash.ts +0 -60
- package/src/utils/hex.ts +0 -1
- package/src/utils/hrtime.ts +0 -8
- package/src/utils/iterable.ts +0 -797
- package/src/utils/keys/chord.ts +0 -184
- package/src/utils/keys/keybinding.ts +0 -116
- package/src/utils/lazy.ts +0 -39
- package/src/utils/loggable.ts +0 -7
- package/src/utils/logger.scoped.ts +0 -237
- package/src/utils/logger.ts +0 -403
- package/src/utils/lruMap.ts +0 -112
- package/src/utils/markdown.ts +0 -115
- package/src/utils/mru.ts +0 -68
- package/src/utils/object.ts +0 -278
- package/src/utils/paging.ts +0 -97
- package/src/utils/path.ts +0 -204
- package/src/utils/platform.ts +0 -1
- package/src/utils/promise.ts +0 -657
- package/src/utils/promiseCache.ts +0 -908
- package/src/utils/resourceUsage.ts +0 -5
- package/src/utils/searchTree.ts +0 -444
- package/src/utils/stopwatch.ts +0 -125
- package/src/utils/string.ts +0 -1003
- package/src/utils/subscriptionManager.ts +0 -40
- package/src/utils/trie.ts +0 -740
- package/src/utils/types.ts +0 -31
- package/src/utils/uri.ts +0 -118
- package/src/utils/validation.ts +0 -38
- package/src/utils/version.ts +0 -128
|
@@ -1,62 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
import { escapeRegex } from '../../utils/string.js';
|
|
19
|
-
import { fsExists } from '../exec/exec.js';
|
|
20
|
-
import { canonicalizeGitConfigKey, isGitBooleanFalse, parseConfigRegexOutput, parseGitBoolean } from './config.js';
|
|
1
|
+
import { CancellationError } from "../../utils/cancellation.js";
|
|
2
|
+
import { escapeRegex } from "../../utils/string.js";
|
|
3
|
+
import { getScopedLogger } from "../../utils/logger.scoped.js";
|
|
4
|
+
import { getSettledValue } from "../../utils/promise.js";
|
|
5
|
+
import { debug } from "../../utils/decorators/log.js";
|
|
6
|
+
import { arePathsEqual, joinPaths } from "../../utils/path.js";
|
|
7
|
+
import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
|
|
8
|
+
import { gitFeaturesByVersion } from "../../git/features.js";
|
|
9
|
+
import "../../git/gitHealth.js";
|
|
10
|
+
import { fsExists } from "../../utils/env/node/exec.js";
|
|
11
|
+
import { canonicalizeGitConfigKey, isGitBooleanFalse, parseConfigRegexOutput, parseGitBoolean } from "./config.js";
|
|
12
|
+
import * as l10n from "@vscode/l10n";
|
|
13
|
+
import * as process from "node:process";
|
|
14
|
+
import { randomUUID } from "node:crypto";
|
|
15
|
+
import { mkdir, open, readFile, readdir, realpath, rename, rm, stat } from "node:fs/promises";
|
|
16
|
+
import { hostname } from "node:os";
|
|
17
|
+
//#region ../git-cli/src/providers/maintenance.ts
|
|
21
18
|
/** Deterministic sample of the 256 object fanout dirs (`00`,`10`,…,`f0`) used to extrapolate loose-object count. */
|
|
22
|
-
const looseObjectSampleDirs = Array.from({ length: 16 }, (_, i) => (i * 16).toString(16).padStart(2,
|
|
19
|
+
const looseObjectSampleDirs = Array.from({ length: 16 }, (_, i) => (i * 16).toString(16).padStart(2, "0"));
|
|
23
20
|
/** Stops the ref probe at four times the recommendation threshold: bounded, but still useful for telemetry. */
|
|
24
|
-
const looseRefProbeLimit =
|
|
21
|
+
const looseRefProbeLimit = 1024;
|
|
25
22
|
/** Worktree-local ownership journal for the sparse-index command lever. */
|
|
26
|
-
const sparseIndexAppliedMarker =
|
|
27
|
-
const sparseIndexLockFile =
|
|
28
|
-
const sparseIndexPendingMarker =
|
|
23
|
+
const sparseIndexAppliedMarker = "sparse-index.applied";
|
|
24
|
+
const sparseIndexLockFile = "sparse-index.lock";
|
|
25
|
+
const sparseIndexPendingMarker = "sparse-index.pending";
|
|
29
26
|
/** How long the global `maintenance.repo` registration list is served from cache (mirrors the config caches). */
|
|
30
|
-
const registeredMaintenanceReposTtlMs =
|
|
27
|
+
const registeredMaintenanceReposTtlMs = 3e4;
|
|
31
28
|
/** How long a repo's worktree list is served from cache — worktrees can be added/removed mid-session. */
|
|
32
|
-
const worktreePathsTtlMs =
|
|
29
|
+
const worktreePathsTtlMs = 3e4;
|
|
33
30
|
/** Demand cadence for the commit-graph write: refreshed at most this often per object database. */
|
|
34
|
-
const commitGraphRefreshIntervalMs =
|
|
31
|
+
const commitGraphRefreshIntervalMs = 3e5;
|
|
35
32
|
/** Git's default `maintenance.incremental-repack.auto` threshold. */
|
|
36
33
|
const defaultIncrementalRepackAutoThreshold = 10;
|
|
37
34
|
/** Bounds defensive reads of repository-controlled MIDX metadata. */
|
|
38
|
-
const maxMultiPackIndexChunkBytes =
|
|
39
|
-
const maxMultiPackIndexChainBytes =
|
|
35
|
+
const maxMultiPackIndexChunkBytes = 16777216;
|
|
36
|
+
const maxMultiPackIndexChainBytes = 1048576;
|
|
40
37
|
/** Sentinel recorded in a `gk.applied.*` marker when the lever's prior LOCAL value was absent (→ undo unsets it). */
|
|
41
|
-
const unsetConfigSentinel =
|
|
38
|
+
const unsetConfigSentinel = "unset";
|
|
42
39
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const emptyConfigSentinel =
|
|
40
|
+
* Sentinel recorded when the prior LOCAL value was present but EMPTY (`key =`). Git reads an empty value as
|
|
41
|
+
* boolean false, and a local empty value shadows any global value — so undo must restore the empty value, not
|
|
42
|
+
* unset the key (unsetting would let a global `true` resurface). The marker can't store the empty string
|
|
43
|
+
* itself: `--get-regexp` prints a value-less line for it, which the bulk gk-config parser drops.
|
|
44
|
+
*/
|
|
45
|
+
const emptyConfigSentinel = "empty";
|
|
49
46
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
* The ONLY tolerable non-zero exits from the config reads/writes below: `--get`/`--get-all`/`--get-regex`
|
|
48
|
+
* exit 1 when the key (or, for `--get-regex`, the pattern) is unset/unmatched, `--unset-all` exits 5 when
|
|
49
|
+
* it was already absent. Any other non-zero means git couldn't read or write the config at all (a held
|
|
50
|
+
* `config.lock`, a read-only `.git`, a malformed file) — which must never be mistaken for "unset"/"already
|
|
51
|
+
* gone", since that reads as success and drops the ownership marker.
|
|
52
|
+
*
|
|
53
|
+
* Note the writes use `--unset-all`, never `--unset`: `--unset` REFUSES a multi-valued key and exits 5 too —
|
|
54
|
+
* the same code as the benign case — leaving the values in place. `--unset-all` removes every local value
|
|
55
|
+
* (the correct restore for an `unset` prior) and reserves 5 for genuinely absent.
|
|
56
|
+
*/
|
|
60
57
|
const gitConfigGetMissingExitCode = 1;
|
|
61
58
|
const gitConfigUnsetMissingExitCode = 5;
|
|
62
59
|
/** `update-index --test-untracked-cache` exits 1 when the filesystem can't support it. */
|
|
@@ -65,2065 +62,1516 @@ const untrackedCacheUnsupportedExitCode = 1;
|
|
|
65
62
|
const markerLockRetryMs = 50;
|
|
66
63
|
const markerLockMaxAttempts = 20;
|
|
67
64
|
const emptyGkMarkers = {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
fsmonitorNotApplicable: false,
|
|
66
|
+
untrackedCacheNotApplicable: false,
|
|
67
|
+
applied: {
|
|
68
|
+
untrackedCache: false,
|
|
69
|
+
fsmonitor: false,
|
|
70
|
+
manyFiles: false,
|
|
71
|
+
backgroundMaintenance: false,
|
|
72
|
+
sparseIndex: false
|
|
73
|
+
},
|
|
74
|
+
commitGraphDisabled: false
|
|
78
75
|
};
|
|
79
|
-
|
|
80
|
-
}
|
|
76
|
+
var MarkerLockContentionError = class extends Error {};
|
|
81
77
|
const untrackedCacheChange = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
configKey: "core.untrackedCache",
|
|
79
|
+
markerKey: "gk.applied.untrackedCache",
|
|
80
|
+
pendingKey: "gk.pending.untrackedCache",
|
|
81
|
+
value: "true"
|
|
86
82
|
};
|
|
87
83
|
const fsmonitorChange = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
configKey: "core.fsmonitor",
|
|
85
|
+
markerKey: "gk.applied.fsmonitor",
|
|
86
|
+
pendingKey: "gk.pending.fsmonitor",
|
|
87
|
+
value: "true"
|
|
92
88
|
};
|
|
93
89
|
const manyFilesChange = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
configKey: "feature.manyFiles",
|
|
91
|
+
markerKey: "gk.applied.manyFiles",
|
|
92
|
+
pendingKey: "gk.pending.manyFiles",
|
|
93
|
+
value: "true"
|
|
98
94
|
};
|
|
99
95
|
const skipHashChange = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
configKey: "index.skipHash",
|
|
97
|
+
markerKey: "gk.applied.skipHash",
|
|
98
|
+
pendingKey: "gk.pending.skipHash",
|
|
99
|
+
value: "true"
|
|
104
100
|
};
|
|
105
101
|
const configLeverChanges = [
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
untrackedCacheChange,
|
|
103
|
+
fsmonitorChange,
|
|
104
|
+
manyFilesChange,
|
|
105
|
+
skipHashChange
|
|
110
106
|
];
|
|
111
107
|
function encodePendingConfigChange(change) {
|
|
112
|
-
|
|
108
|
+
return JSON.stringify(change);
|
|
113
109
|
}
|
|
114
110
|
function decodePendingConfigChange(value) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
111
|
+
try {
|
|
112
|
+
const parsed = JSON.parse(value);
|
|
113
|
+
return typeof parsed.prior === "string" && typeof parsed.value === "string" ? {
|
|
114
|
+
prior: parsed.prior,
|
|
115
|
+
value: parsed.value
|
|
116
|
+
} : void 0;
|
|
117
|
+
} catch {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
124
120
|
}
|
|
125
121
|
/** `core.fsmonitor` is enabled when set to a truthy bool OR a hook path — unset or any false spelling is "off". */
|
|
126
122
|
function isFsmonitorEnabled(value) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return !isGitBooleanFalse(value);
|
|
123
|
+
if (value == null) return false;
|
|
124
|
+
return !isGitBooleanFalse(value);
|
|
130
125
|
}
|
|
131
126
|
/** Parses Git's integer syntax, including the case-insensitive binary `k`, `m`, and `g` suffixes. */
|
|
132
127
|
function parseGitInteger(value) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return Number.isSafeInteger(parsed) ? parsed : undefined;
|
|
128
|
+
const match = /^([+-]?\d+)([kmg])?$/i.exec(value?.trim() ?? "");
|
|
129
|
+
if (match == null) return void 0;
|
|
130
|
+
const multiplier = match[2]?.toLowerCase() === "k" ? 1024 : match[2]?.toLowerCase() === "m" ? 1024 ** 2 : match[2] ? 1024 ** 3 : 1;
|
|
131
|
+
const parsed = Number.parseInt(match[1], 10) * multiplier;
|
|
132
|
+
return Number.isSafeInteger(parsed) ? parsed : void 0;
|
|
139
133
|
}
|
|
140
134
|
/**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
* Whether `fsmonitor--daemon` reported that this git build has no backend for the platform (as opposed to
|
|
136
|
+
* simply not running yet, which also exits non-zero). Git uses 128 for any fatal, so the message matters.
|
|
137
|
+
*/
|
|
144
138
|
function isFsmonitorDaemonUnsupported(result) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return `${result.stderr ?? ''}${result.stdout ?? ''}`.includes('not supported on this platform');
|
|
139
|
+
if (result.exitCode !== 128) return false;
|
|
140
|
+
return `${result.stderr ?? ""}${result.stdout ?? ""}`.includes("not supported on this platform");
|
|
148
141
|
}
|
|
149
142
|
/** Platforms with a built-in FSMonitor daemon backend, and the git floor each one needs. */
|
|
150
143
|
function fsmonitorFeatureForPlatform() {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return 'git:fsmonitor:linux';
|
|
158
|
-
default:
|
|
159
|
-
return undefined;
|
|
160
|
-
}
|
|
144
|
+
switch (process.platform) {
|
|
145
|
+
case "win32":
|
|
146
|
+
case "darwin": return "git:fsmonitor";
|
|
147
|
+
case "linux": return "git:fsmonitor:linux";
|
|
148
|
+
default: return;
|
|
149
|
+
}
|
|
161
150
|
}
|
|
162
151
|
/** Parses `git count-objects -v` (`key: number` per line) into the {@link GitHealthDetails} breakdown. */
|
|
163
152
|
function parseCountObjects(stdout) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
prunePackable: values.get('prune-packable') ?? 0,
|
|
183
|
-
garbage: values.get('garbage') ?? 0,
|
|
184
|
-
sizeGarbage: (values.get('size-garbage') ?? 0) * 1024,
|
|
185
|
-
};
|
|
153
|
+
const values = /* @__PURE__ */ new Map();
|
|
154
|
+
for (const line of stdout.split("\n")) {
|
|
155
|
+
const sep = line.indexOf(":");
|
|
156
|
+
if (sep === -1) continue;
|
|
157
|
+
const key = line.slice(0, sep).trim();
|
|
158
|
+
const value = parseInt(line.slice(sep + 1).trim(), 10);
|
|
159
|
+
if (!Number.isNaN(value)) values.set(key, value);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
count: values.get("count") ?? 0,
|
|
163
|
+
size: (values.get("size") ?? 0) * 1024,
|
|
164
|
+
inPack: values.get("in-pack") ?? 0,
|
|
165
|
+
packs: values.get("packs") ?? 0,
|
|
166
|
+
sizePack: (values.get("size-pack") ?? 0) * 1024,
|
|
167
|
+
prunePackable: values.get("prune-packable") ?? 0,
|
|
168
|
+
garbage: values.get("garbage") ?? 0,
|
|
169
|
+
sizeGarbage: (values.get("size-garbage") ?? 0) * 1024
|
|
170
|
+
};
|
|
186
171
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
// ...but so does a cancelled/timed-out run, and so does a genuine write failure. Surface both, so an
|
|
1593
|
-
// undo can't clear its ownership marker — handing the lever back to the user as "theirs", with no
|
|
1594
|
-
// Undo ever offered again — while the config is in fact still set.
|
|
1595
|
-
this.throwIfDidNotComplete(result, cancellation);
|
|
1596
|
-
if (result.exitCode !== 0 && result.exitCode !== gitConfigUnsetMissingExitCode) {
|
|
1597
|
-
throw new Error(`Unable to unset '${key}' (git exited ${result.exitCode})`);
|
|
1598
|
-
}
|
|
1599
|
-
this.cache.deleteConfig(repoPath, key);
|
|
1600
|
-
}
|
|
1601
|
-
/** Best-effort run; returns the result so callers that must distinguish "didn't run" can check it. */
|
|
1602
|
-
async runQuietly(repoPath, cancellation, ...args) {
|
|
1603
|
-
return this.git.run({
|
|
1604
|
-
cwd: repoPath,
|
|
1605
|
-
errors: 'ignore',
|
|
1606
|
-
priority: 'background',
|
|
1607
|
-
cancellation: cancellation,
|
|
1608
|
-
selfMaintenance: true,
|
|
1609
|
-
}, ...args);
|
|
1610
|
-
}
|
|
1611
|
-
async probeConfig(repoPath, cancellation) {
|
|
1612
|
-
// One `git config --get-regex` for the levers, commit-graph read switch, and index shape, reading
|
|
1613
|
-
// MERGED config — so a key's presence means the user set it somewhere (local, worktree, global, or
|
|
1614
|
-
// system). Git lowercases the section + variable in the output.
|
|
1615
|
-
//
|
|
1616
|
-
// Deliberately NOT routed through the config sub-provider's cached helper: that one swallows git
|
|
1617
|
-
// errors and resolves an EMPTY map, which is indistinguishable from "none of these keys are set" —
|
|
1618
|
-
// and the silent auto tier must never mistake an unreadable config for an unset one and rewrite it.
|
|
1619
|
-
// Reading directly keeps the exit code, which tells the two apart.
|
|
1620
|
-
const result = await this.runQuietly(repoPath, cancellation, 'config', '--get-regex', '^(core\\.fsmonitor|core\\.untrackedcache|core\\.commitgraph|core\\.multipackindex|core\\.sparsecheckout|core\\.sparsecheckoutcone|core\\.splitindex|extensions\\.refstorage|feature\\.manyfiles|index\\.sparse|maintenance\\.incremental-repack\\.auto)$');
|
|
1621
|
-
this.throwIfDidNotComplete(result, cancellation);
|
|
1622
|
-
// Exit 1 is git's "no matches" — genuinely unset. Anything else means we couldn't read the
|
|
1623
|
-
// config; `getHealthSnapshot` turns the throw into a fail-closed snapshot.
|
|
1624
|
-
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) {
|
|
1625
|
-
throw new Error(`Unable to read git config (git exited ${String(result.exitCode)})`);
|
|
1626
|
-
}
|
|
1627
|
-
// `includeValueless`: a BAREWORD entry (`core.untrackedCache` with no `=value`) is git's own
|
|
1628
|
-
// boolean-true shorthand — a naive parse drops it (no space in the line), misreporting a lever
|
|
1629
|
-
// the user has genuinely enabled as both "off" and "unconfigured" (eligible to be re-suggested).
|
|
1630
|
-
// An explicit EMPTY value (`core.untrackedCache=`, a deliberate false) is a DIFFERENT, byte-distinct
|
|
1631
|
-
// line (it keeps a trailing space) and was already parsed correctly without this option.
|
|
1632
|
-
//
|
|
1633
|
-
// Deliberately NOT `.trim()`-ed: when the empty-value line lands last, `.trim()` on the whole
|
|
1634
|
-
// (possibly multi-line) stdout strips that meaningful trailing space and it misreads as a bareword.
|
|
1635
|
-
// `parseConfigRegexOutput` already skips the blank line a trailing newline produces.
|
|
1636
|
-
const map = parseConfigRegexOutput(result.stdout, { includeValueless: true });
|
|
1637
|
-
const incrementalRepackAuto = map.get('maintenance.incremental-repack.auto');
|
|
1638
|
-
const incrementalRepackAutoThreshold = incrementalRepackAuto == null
|
|
1639
|
-
? defaultIncrementalRepackAutoThreshold
|
|
1640
|
-
: parseGitInteger(incrementalRepackAuto);
|
|
1641
|
-
const multiPackIndex = map.get('core.multipackindex');
|
|
1642
|
-
const multiPackIndexEnabled = multiPackIndex == null
|
|
1643
|
-
? true
|
|
1644
|
-
: isGitBooleanFalse(multiPackIndex)
|
|
1645
|
-
? false
|
|
1646
|
-
: parseGitBoolean(multiPackIndex)
|
|
1647
|
-
? true
|
|
1648
|
-
: undefined;
|
|
1649
|
-
return {
|
|
1650
|
-
fsmonitor: isFsmonitorEnabled(map.get('core.fsmonitor')),
|
|
1651
|
-
untrackedCache: parseGitBoolean(map.get('core.untrackedcache')),
|
|
1652
|
-
untrackedCacheConfigured: map.has('core.untrackedcache'),
|
|
1653
|
-
manyFiles: parseGitBoolean(map.get('feature.manyfiles')),
|
|
1654
|
-
// Explicitly-false only — an unset key means git reads the cache (the default). Surfaced so the
|
|
1655
|
-
// Health view can't claim the commit-graph is "maintained by GitLens" when `ensureCommitGraph`
|
|
1656
|
-
// honors this same setting as a write opt-out.
|
|
1657
|
-
commitGraphReadDisabled: map.has('core.commitgraph') && isGitBooleanFalse(map.get('core.commitgraph') ?? ''),
|
|
1658
|
-
multiPackIndexEnabled: multiPackIndexEnabled,
|
|
1659
|
-
incrementalRepackAutoThreshold: incrementalRepackAutoThreshold,
|
|
1660
|
-
refFormat: map.get('extensions.refstorage') == null
|
|
1661
|
-
? 'files'
|
|
1662
|
-
: map.get('extensions.refstorage') === 'reftable'
|
|
1663
|
-
? 'reftable'
|
|
1664
|
-
: 'unknown',
|
|
1665
|
-
sparseCheckout: parseGitBoolean(map.get('core.sparsecheckout')),
|
|
1666
|
-
sparseCheckoutCone: parseGitBoolean(map.get('core.sparsecheckoutcone')),
|
|
1667
|
-
sparseIndex: parseGitBoolean(map.get('index.sparse')),
|
|
1668
|
-
splitIndex: parseGitBoolean(map.get('core.splitindex')),
|
|
1669
|
-
};
|
|
1670
|
-
}
|
|
1671
|
-
// The registered-repo list is process-global git state — cache it briefly (invalidated on
|
|
1672
|
-
// register/unregister) so N repos probed together read it with one subprocess, not N.
|
|
1673
|
-
_registeredMaintenanceRepos;
|
|
1674
|
-
/** The global `maintenance.repo` list. Throws rather than reporting an unreadable list as "none". */
|
|
1675
|
-
async readRegisteredMaintenancePaths(repoPath, cancellation) {
|
|
1676
|
-
const cached = this._registeredMaintenanceRepos;
|
|
1677
|
-
if (cached != null && Date.now() - cached.at <= registeredMaintenanceReposTtlMs)
|
|
1678
|
-
return cached.paths;
|
|
1679
|
-
const result = await this.runQuietly(repoPath, cancellation, 'config', '--global', '--get-all', 'maintenance.repo');
|
|
1680
|
-
// An aborted or unreadable list resolves EMPTY under `errors: 'ignore'`. Reading that as "nothing is
|
|
1681
|
-
// registered" would both cache a lie and let a revert clear ownership for a still-registered repo.
|
|
1682
|
-
// Exit 1 is git's "key not set" — a genuinely empty list.
|
|
1683
|
-
this.throwIfDidNotComplete(result, cancellation);
|
|
1684
|
-
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) {
|
|
1685
|
-
throw new Error(`Unable to read registered maintenance repos (git exited ${String(result.exitCode)})`);
|
|
1686
|
-
}
|
|
1687
|
-
const paths = result.stdout
|
|
1688
|
-
.split('\n')
|
|
1689
|
-
.map(line => line.trim())
|
|
1690
|
-
.filter(line => line !== '');
|
|
1691
|
-
this._registeredMaintenanceRepos = { at: Date.now(), paths: paths };
|
|
1692
|
-
return paths;
|
|
1693
|
-
}
|
|
1694
|
-
/**
|
|
1695
|
-
* `git maintenance register` stores the symlink-RESOLVED worktree path, while GitLens deliberately keeps
|
|
1696
|
-
* the symlinked path as the repo path — so match against both spellings.
|
|
1697
|
-
*/
|
|
1698
|
-
async matchesRegistered(registered, paths) {
|
|
1699
|
-
if (!registered.length)
|
|
1700
|
-
return false;
|
|
1701
|
-
const candidates = await this.resolveRegistrationCandidates(paths);
|
|
1702
|
-
for (const line of registered) {
|
|
1703
|
-
for (const candidate of candidates) {
|
|
1704
|
-
if (arePathsEqual(line, candidate))
|
|
1705
|
-
return true;
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
return false;
|
|
1709
|
-
}
|
|
1710
|
-
/** Each path plus its symlink-resolved spelling — `maintenance register` stores the resolved one. */
|
|
1711
|
-
async resolveRegistrationCandidates(paths) {
|
|
1712
|
-
const candidates = new Set(paths);
|
|
1713
|
-
for (const path of paths) {
|
|
1714
|
-
const real = await realpath(path).catch(() => undefined);
|
|
1715
|
-
if (real != null) {
|
|
1716
|
-
candidates.add(real);
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
return [...candidates];
|
|
1720
|
-
}
|
|
1721
|
-
/**
|
|
1722
|
-
* Whether ANY worktree of this repo family is registered — the DETECTION question ("should we suggest
|
|
1723
|
-
* this?"). Family-wide, because a sibling the user registered already covers the shared object database,
|
|
1724
|
-
* and suggesting it again would leave two scheduled entries for one repo.
|
|
1725
|
-
*/
|
|
1726
|
-
async isMaintenanceRegistered(repoPath, cancellation) {
|
|
1727
|
-
const registered = await this.readRegisteredMaintenancePaths(repoPath, cancellation);
|
|
1728
|
-
return this.matchesRegistered(registered, await this.resolveWorktreePaths(repoPath, cancellation));
|
|
1729
|
-
}
|
|
1730
|
-
/**
|
|
1731
|
-
* Whether ONE specific path is registered — the OWNERSHIP question ("did our unregister take?"). Never
|
|
1732
|
-
* ask this family-wide: a sibling the user registered is theirs, and it would block undo forever.
|
|
1733
|
-
*/
|
|
1734
|
-
async isPathRegistered(repoPath, path, cancellation) {
|
|
1735
|
-
const registered = await this.readRegisteredMaintenancePaths(repoPath, cancellation);
|
|
1736
|
-
return this.matchesRegistered(registered, [path]);
|
|
1737
|
-
}
|
|
1738
|
-
// Cached briefly rather than for the session: a worktree added or removed mid-session must become visible
|
|
1739
|
-
// to family detection, else a sibling the user registers afterwards is never seen and the repo gets
|
|
1740
|
-
// re-suggested for maintenance it already has. The TTL keeps it off the per-probe hot path.
|
|
1741
|
-
_worktreePaths = new Map();
|
|
1742
|
-
/**
|
|
1743
|
-
* Every worktree path of this repo, MAIN FIRST — git's `worktree list` order, which holds regardless of
|
|
1744
|
-
* which worktree it runs from, and lists the repo itself for a bare one.
|
|
1745
|
-
*
|
|
1746
|
-
* `git maintenance register` records the CURRENT worktree's path, so a repo family can accumulate
|
|
1747
|
-
* several `maintenance.repo` entries — several scheduled runs over a single shared object database —
|
|
1748
|
-
* while the `gk.applied.*` ownership marker lives in the shared common git dir and can only describe
|
|
1749
|
-
* one of them. GitLens therefore REGISTERS the main worktree ({@link resolveMaintenanceRepoPath}) but
|
|
1750
|
-
* DETECTS across the whole family, so a registration the user made from a sibling isn't missed.
|
|
1751
|
-
*/
|
|
1752
|
-
async resolveWorktreePaths(repoPath, cancellation) {
|
|
1753
|
-
// Keyed by the COMMON path: the worktree list is identical for every sibling of a repo family, so a
|
|
1754
|
-
// per-worktree key would spawn one `worktree list` per open sibling instead of one per family.
|
|
1755
|
-
const cacheKey = this.cache.getCommonPath(repoPath);
|
|
1756
|
-
const cached = this._worktreePaths.get(cacheKey);
|
|
1757
|
-
if (cached != null && Date.now() - cached.at <= worktreePathsTtlMs)
|
|
1758
|
-
return cached.paths;
|
|
1759
|
-
const result = await this.runQuietly(repoPath, cancellation, 'worktree', 'list', '--porcelain');
|
|
1760
|
-
// Fall back to the repo path (today's behavior) rather than caching a cancelled or failed read.
|
|
1761
|
-
if (result.completion.status !== 'exited' || result.exitCode !== 0 || cancellation?.aborted === true) {
|
|
1762
|
-
return [repoPath];
|
|
1763
|
-
}
|
|
1764
|
-
const paths = result.stdout
|
|
1765
|
-
.split('\n')
|
|
1766
|
-
.filter(l => l.startsWith('worktree '))
|
|
1767
|
-
.map(l => l.slice('worktree '.length).trim())
|
|
1768
|
-
.filter(l => l !== '');
|
|
1769
|
-
if (!paths.length)
|
|
1770
|
-
return [repoPath];
|
|
1771
|
-
this._worktreePaths.set(cacheKey, { at: Date.now(), paths: paths });
|
|
1772
|
-
return paths;
|
|
1773
|
-
}
|
|
1774
|
-
/** The path GitLens registers for background maintenance: the repo's MAIN worktree. */
|
|
1775
|
-
async resolveMaintenanceRepoPath(repoPath, cancellation) {
|
|
1776
|
-
return (await this.resolveWorktreePaths(repoPath, cancellation))[0];
|
|
1777
|
-
}
|
|
1778
|
-
async probeCommitGraph(objectsDir) {
|
|
1779
|
-
const infoDir = joinPaths(objectsDir, 'info');
|
|
1780
|
-
// A repo may have a single `commit-graph` file OR a split `commit-graphs/` chain dir — either counts.
|
|
1781
|
-
const [single, split] = await Promise.allSettled([
|
|
1782
|
-
this.statMtime(joinPaths(infoDir, 'commit-graph')),
|
|
1783
|
-
this.statMtime(joinPaths(infoDir, 'commit-graphs')),
|
|
1784
|
-
]);
|
|
1785
|
-
const mtime = getSettledValue(single) ?? getSettledValue(split);
|
|
1786
|
-
return { present: mtime != null, mtime: mtime };
|
|
1787
|
-
}
|
|
1788
|
-
/**
|
|
1789
|
-
* Whether the NEWEST commit-graph layer carries changed-path Bloom filters (the `BIDX` chunk). Only the
|
|
1790
|
-
* newest layer matters here — `--changed-paths` computes filters for the just-written batch, so an older
|
|
1791
|
-
* base layer written without them says nothing about current coverage. Reads only the header + chunk
|
|
1792
|
-
* lookup table (a handful of bytes), never the graph body. Never throws — any failure (missing file, a
|
|
1793
|
-
* malformed chain, a truncated read) reads as "no filters", matching every other probe in this file.
|
|
1794
|
-
*/
|
|
1795
|
-
async probeChangedPathFilters(objectsDir) {
|
|
1796
|
-
try {
|
|
1797
|
-
const infoDir = joinPaths(objectsDir, 'info');
|
|
1798
|
-
const graphPath = await this.resolveNewestCommitGraphLayer(infoDir);
|
|
1799
|
-
return await this.hasBloomFilterChunk(graphPath);
|
|
1800
|
-
}
|
|
1801
|
-
catch {
|
|
1802
|
-
return false;
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
/** The newest graph layer's file path: the chain's last-listed layer when split, else the single file. */
|
|
1806
|
-
async resolveNewestCommitGraphLayer(infoDir) {
|
|
1807
|
-
const chainPath = joinPaths(infoDir, 'commit-graphs', 'commit-graph-chain');
|
|
1808
|
-
try {
|
|
1809
|
-
const chain = await readFile(chainPath, 'utf8');
|
|
1810
|
-
const hashes = chain
|
|
1811
|
-
.split('\n')
|
|
1812
|
-
.map(line => line.trim())
|
|
1813
|
-
.filter(line => line !== '');
|
|
1814
|
-
if (hashes.length) {
|
|
1815
|
-
return joinPaths(infoDir, 'commit-graphs', `graph-${hashes.at(-1)}.graph`);
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
catch {
|
|
1819
|
-
// No chain (or unreadable) — fall through to the single-file layout.
|
|
1820
|
-
}
|
|
1821
|
-
return joinPaths(infoDir, 'commit-graph');
|
|
1822
|
-
}
|
|
1823
|
-
/**
|
|
1824
|
-
* Reads a commit-graph file's fixed 8-byte header (`CGPH` magic, version, hash version, chunk count,
|
|
1825
|
-
* base-graph count) plus the chunk lookup table (`(chunkCount + 1)` entries of 4-byte id + 8-byte
|
|
1826
|
-
* big-endian offset), and reports whether a `BIDX` (Bloom-filter-index) chunk id is present. Bounded to
|
|
1827
|
-
* the header + table only — never reads the graph body.
|
|
1828
|
-
*/
|
|
1829
|
-
async hasBloomFilterChunk(graphPath) {
|
|
1830
|
-
let handle;
|
|
1831
|
-
try {
|
|
1832
|
-
handle = await open(graphPath, 'r');
|
|
1833
|
-
const header = Buffer.alloc(8);
|
|
1834
|
-
const { bytesRead: headerBytesRead } = await handle.read(header, 0, 8, 0);
|
|
1835
|
-
if (headerBytesRead < 8 || header.toString('ascii', 0, 4) !== 'CGPH')
|
|
1836
|
-
return false;
|
|
1837
|
-
const chunkCount = header.readUInt8(6);
|
|
1838
|
-
const tableLength = (chunkCount + 1) * 12;
|
|
1839
|
-
const table = Buffer.alloc(tableLength);
|
|
1840
|
-
const { bytesRead: tableBytesRead } = await handle.read(table, 0, tableLength, 8);
|
|
1841
|
-
if (tableBytesRead < tableLength)
|
|
1842
|
-
return false;
|
|
1843
|
-
for (let i = 0; i <= chunkCount; i++) {
|
|
1844
|
-
const offset = i * 12;
|
|
1845
|
-
if (table.toString('ascii', offset, offset + 4) === 'BIDX')
|
|
1846
|
-
return true;
|
|
1847
|
-
}
|
|
1848
|
-
return false;
|
|
1849
|
-
}
|
|
1850
|
-
finally {
|
|
1851
|
-
await handle?.close().catch(() => { });
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
/**
|
|
1855
|
-
* Reads the pack names represented by the active classic or incremental MIDX. A classic MIDX wins when
|
|
1856
|
-
* both layouts exist, matching Git's own lookup order. Malformed metadata is reported as unknown instead
|
|
1857
|
-
* of treating every pack as uncovered and silently launching repair work.
|
|
1858
|
-
*/
|
|
1859
|
-
async probeMultiPackIndex(packDir) {
|
|
1860
|
-
const classicPath = joinPaths(packDir, 'multi-pack-index');
|
|
1861
|
-
try {
|
|
1862
|
-
const packNames = await this.readMultiPackIndexPackNames(classicPath);
|
|
1863
|
-
return { present: true, packNames: packNames };
|
|
1864
|
-
}
|
|
1865
|
-
catch (ex) {
|
|
1866
|
-
if (ex.code !== 'ENOENT')
|
|
1867
|
-
return { present: true, packNames: undefined };
|
|
1868
|
-
}
|
|
1869
|
-
const chainDir = joinPaths(packDir, 'multi-pack-index.d');
|
|
1870
|
-
const chainPath = joinPaths(chainDir, 'multi-pack-index-chain');
|
|
1871
|
-
let chain;
|
|
1872
|
-
try {
|
|
1873
|
-
if ((await stat(chainPath)).size > maxMultiPackIndexChainBytes) {
|
|
1874
|
-
return { present: true, packNames: undefined };
|
|
1875
|
-
}
|
|
1876
|
-
chain = await readFile(chainPath, 'utf8');
|
|
1877
|
-
}
|
|
1878
|
-
catch (ex) {
|
|
1879
|
-
return ex.code === 'ENOENT'
|
|
1880
|
-
? { present: false, packNames: new Set() }
|
|
1881
|
-
: { present: true, packNames: undefined };
|
|
1882
|
-
}
|
|
1883
|
-
const hashes = chain
|
|
1884
|
-
.split('\n')
|
|
1885
|
-
.map(line => line.trim())
|
|
1886
|
-
.filter(Boolean);
|
|
1887
|
-
if (hashes.length === 0 || hashes.some(hash => !/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(hash))) {
|
|
1888
|
-
return { present: true, packNames: undefined };
|
|
1889
|
-
}
|
|
1890
|
-
const layers = await Promise.allSettled(hashes.map(hash => this.readMultiPackIndexPackNames(joinPaths(chainDir, `multi-pack-index-${hash}.midx`))));
|
|
1891
|
-
if (layers.some(layer => layer.status === 'rejected'))
|
|
1892
|
-
return { present: true, packNames: undefined };
|
|
1893
|
-
const packNames = new Set();
|
|
1894
|
-
for (const layer of layers) {
|
|
1895
|
-
if (layer.status !== 'fulfilled')
|
|
1896
|
-
continue;
|
|
1897
|
-
for (const name of layer.value) {
|
|
1898
|
-
packNames.add(name);
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
return { present: true, packNames: packNames };
|
|
1902
|
-
}
|
|
1903
|
-
/** Reads and validates the `PNAM` chunk of one MIDX file. */
|
|
1904
|
-
async readMultiPackIndexPackNames(path) {
|
|
1905
|
-
let handle;
|
|
1906
|
-
try {
|
|
1907
|
-
handle = await open(path, 'r');
|
|
1908
|
-
const header = Buffer.alloc(12);
|
|
1909
|
-
const { bytesRead } = await handle.read(header, 0, header.length, 0);
|
|
1910
|
-
if (bytesRead < header.length || header.toString('ascii', 0, 4) !== 'MIDX') {
|
|
1911
|
-
throw new Error('Invalid multi-pack-index header');
|
|
1912
|
-
}
|
|
1913
|
-
const chunkCount = header.readUInt8(6);
|
|
1914
|
-
const expectedPackCount = header.readUInt32BE(8);
|
|
1915
|
-
const tableLength = (chunkCount + 1) * 12;
|
|
1916
|
-
const table = Buffer.alloc(tableLength);
|
|
1917
|
-
const { bytesRead: tableBytesRead } = await handle.read(table, 0, tableLength, header.length);
|
|
1918
|
-
if (tableBytesRead < tableLength)
|
|
1919
|
-
throw new Error('Invalid multi-pack-index chunk table');
|
|
1920
|
-
let namesStart;
|
|
1921
|
-
const chunkOffsets = [];
|
|
1922
|
-
for (let i = 0; i <= chunkCount; i++) {
|
|
1923
|
-
const offset = i * 12;
|
|
1924
|
-
const chunkOffset = Number(table.readBigUInt64BE(offset + 4));
|
|
1925
|
-
if (!Number.isSafeInteger(chunkOffset))
|
|
1926
|
-
throw new Error('Invalid multi-pack-index chunk offset');
|
|
1927
|
-
chunkOffsets.push(chunkOffset);
|
|
1928
|
-
if (table.toString('ascii', offset, offset + 4) === 'PNAM') {
|
|
1929
|
-
namesStart = chunkOffset;
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
if (namesStart == null)
|
|
1933
|
-
throw new Error('Multi-pack-index is missing its pack-name chunk');
|
|
1934
|
-
const namesEnd = Math.min(...chunkOffsets.filter(offset => offset > namesStart));
|
|
1935
|
-
const namesLength = namesEnd - namesStart;
|
|
1936
|
-
if (!Number.isSafeInteger(namesEnd) || namesLength < 0 || namesLength > maxMultiPackIndexChunkBytes) {
|
|
1937
|
-
throw new Error('Invalid multi-pack-index pack-name chunk');
|
|
1938
|
-
}
|
|
1939
|
-
const namesChunk = Buffer.alloc(namesLength);
|
|
1940
|
-
const { bytesRead: namesBytesRead } = await handle.read(namesChunk, 0, namesLength, namesStart);
|
|
1941
|
-
if (namesBytesRead < namesLength)
|
|
1942
|
-
throw new Error('Short multi-pack-index pack-name chunk');
|
|
1943
|
-
const names = namesChunk
|
|
1944
|
-
.toString('utf8')
|
|
1945
|
-
.split('\0')
|
|
1946
|
-
.filter(name => /^pack-(?:[0-9a-f]{40}|[0-9a-f]{64})\.idx$/.test(name))
|
|
1947
|
-
.map(name => `${name.slice(0, -4)}.pack`);
|
|
1948
|
-
if (names.length !== expectedPackCount || new Set(names).size !== names.length) {
|
|
1949
|
-
throw new Error('Multi-pack-index pack-name count does not match its header');
|
|
1950
|
-
}
|
|
1951
|
-
return new Set(names);
|
|
1952
|
-
}
|
|
1953
|
-
finally {
|
|
1954
|
-
await handle?.close().catch(() => { });
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
async probePacks(objectsDir) {
|
|
1958
|
-
const packDir = joinPaths(objectsDir, 'pack');
|
|
1959
|
-
let entries;
|
|
1960
|
-
try {
|
|
1961
|
-
entries = await readdir(packDir);
|
|
1962
|
-
}
|
|
1963
|
-
catch (ex) {
|
|
1964
|
-
if (ex.code === 'ENOENT')
|
|
1965
|
-
return { names: [], bytes: 0 };
|
|
1966
|
-
throw ex;
|
|
1967
|
-
}
|
|
1968
|
-
const packFiles = entries.filter(name => name.endsWith('.pack'));
|
|
1969
|
-
const sizes = await Promise.allSettled(packFiles.map(name => this.fileBytes(joinPaths(packDir, name))));
|
|
1970
|
-
const bytes = sizes.reduce((sum, r) => sum + (getSettledValue(r) ?? 0), 0);
|
|
1971
|
-
return { names: packFiles, bytes: bytes };
|
|
1972
|
-
}
|
|
1973
|
-
async sampleLooseObjects(objectsDir) {
|
|
1974
|
-
const counts = await Promise.allSettled(looseObjectSampleDirs.map(async (dir) => {
|
|
1975
|
-
try {
|
|
1976
|
-
return (await readdir(joinPaths(objectsDir, dir))).length;
|
|
1977
|
-
}
|
|
1978
|
-
catch {
|
|
1979
|
-
// A missing fanout dir means ~no objects with that prefix — count it as 0, not skipped.
|
|
1980
|
-
return 0;
|
|
1981
|
-
}
|
|
1982
|
-
}));
|
|
1983
|
-
const objectsInSampledDirs = counts.reduce((sum, r) => sum + (getSettledValue(r) ?? 0), 0);
|
|
1984
|
-
return { objectsInSampledDirs: objectsInSampledDirs, dirsSampled: looseObjectSampleDirs.length };
|
|
1985
|
-
}
|
|
1986
|
-
/**
|
|
1987
|
-
* Counts loose refs without traversing past the point where the recommendation decision is already made.
|
|
1988
|
-
* `readDirectory` is a test seam for deterministic ref-layout races between parent and child reads.
|
|
1989
|
-
*/
|
|
1990
|
-
async probeLooseRefs(refsDir, readDirectory = dir => readdir(dir, { withFileTypes: true })) {
|
|
1991
|
-
const pending = [refsDir];
|
|
1992
|
-
let count = 0;
|
|
1993
|
-
while (pending.length !== 0) {
|
|
1994
|
-
const dir = pending.pop();
|
|
1995
|
-
let entries;
|
|
1996
|
-
try {
|
|
1997
|
-
entries = await readDirectory(dir);
|
|
1998
|
-
}
|
|
1999
|
-
catch (ex) {
|
|
2000
|
-
const code = ex.code;
|
|
2001
|
-
if (code === 'ENOENT' || (dir !== refsDir && code === 'ENOTDIR')) {
|
|
2002
|
-
if (dir === refsDir)
|
|
2003
|
-
return { count: 0, exact: true };
|
|
2004
|
-
// Ref updates can remove a child directory or replace it with a same-named ref after its
|
|
2005
|
-
// parent was listed. It contributes no child refs now, so continue the bounded walk.
|
|
2006
|
-
continue;
|
|
2007
|
-
}
|
|
2008
|
-
throw ex;
|
|
2009
|
-
}
|
|
2010
|
-
for (const entry of entries) {
|
|
2011
|
-
if (entry.isDirectory()) {
|
|
2012
|
-
pending.push(joinPaths(dir, entry.name));
|
|
2013
|
-
continue;
|
|
2014
|
-
}
|
|
2015
|
-
// Lock files are transient coordination state, not refs `pack-refs` can optimize.
|
|
2016
|
-
if (entry.name.endsWith('.lock'))
|
|
2017
|
-
continue;
|
|
2018
|
-
count++;
|
|
2019
|
-
if (count >= looseRefProbeLimit)
|
|
2020
|
-
return { count: count, exact: false };
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
return { count: count, exact: true };
|
|
2024
|
-
}
|
|
2025
|
-
async statMtime(path) {
|
|
2026
|
-
try {
|
|
2027
|
-
return (await stat(path)).mtimeMs;
|
|
2028
|
-
}
|
|
2029
|
-
catch {
|
|
2030
|
-
return undefined;
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
/** Presence probe that distinguishes a missing path from an unreadable one. */
|
|
2034
|
-
async probePathPresence(path) {
|
|
2035
|
-
try {
|
|
2036
|
-
await stat(path);
|
|
2037
|
-
return true;
|
|
2038
|
-
}
|
|
2039
|
-
catch (ex) {
|
|
2040
|
-
if (ex.code === 'ENOENT')
|
|
2041
|
-
return false;
|
|
2042
|
-
throw ex;
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
async fileBytes(path) {
|
|
2046
|
-
try {
|
|
2047
|
-
return (await stat(path)).size;
|
|
2048
|
-
}
|
|
2049
|
-
catch {
|
|
2050
|
-
return 0;
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
/**
|
|
2054
|
-
* Reads the index entry count straight from the index header — `DIRC` signature, version, entry count,
|
|
2055
|
-
* all big-endian, the first 12 bytes of `.git/index` — for free, no `git` invocation needed.
|
|
2056
|
-
* `undefined` on any failure (missing index, short read, wrong signature): never a guess, never a throw.
|
|
2057
|
-
*/
|
|
2058
|
-
async probeIndexEntryCount(indexPath) {
|
|
2059
|
-
let handle;
|
|
2060
|
-
try {
|
|
2061
|
-
handle = await open(indexPath, 'r');
|
|
2062
|
-
const header = Buffer.alloc(12);
|
|
2063
|
-
const { bytesRead } = await handle.read(header, 0, 12, 0);
|
|
2064
|
-
if (bytesRead < 12 || header.toString('ascii', 0, 4) !== 'DIRC')
|
|
2065
|
-
return undefined;
|
|
2066
|
-
return header.readUInt32BE(8);
|
|
2067
|
-
}
|
|
2068
|
-
catch {
|
|
2069
|
-
return undefined;
|
|
2070
|
-
}
|
|
2071
|
-
finally {
|
|
2072
|
-
await handle?.close().catch(() => { });
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
/**
|
|
2076
|
-
* Conservative split-index detection without spawning git or scanning index bodies. A shared-index file
|
|
2077
|
-
* proves this worktree uses split indexes; its largest base file is included in the byte-size proxy. Stale
|
|
2078
|
-
* bases can only make that explicitly-approximate signal larger.
|
|
2079
|
-
*/
|
|
2080
|
-
async probeSharedIndex(gitDir) {
|
|
2081
|
-
try {
|
|
2082
|
-
const names = (await readdir(gitDir)).filter(name => name.startsWith('sharedindex.'));
|
|
2083
|
-
const sizes = await Promise.all(names.map(name => this.fileBytes(joinPaths(gitDir, name))));
|
|
2084
|
-
return { present: names.length > 0, bytes: Math.max(0, ...sizes) };
|
|
2085
|
-
}
|
|
2086
|
-
catch {
|
|
2087
|
-
return undefined;
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
2090
|
-
/**
|
|
2091
|
-
* Conflict stages duplicate paths in the header count. Operation-state files conservatively suppress the
|
|
2092
|
-
* exact claim without an unconditional `ls-files --unmerged` index scan on every staging event.
|
|
2093
|
-
*/
|
|
2094
|
-
async probeConflictOperation(gitDir) {
|
|
2095
|
-
const states = await Promise.all([
|
|
2096
|
-
fsExists(joinPaths(gitDir, 'MERGE_HEAD')),
|
|
2097
|
-
fsExists(joinPaths(gitDir, 'CHERRY_PICK_HEAD')),
|
|
2098
|
-
fsExists(joinPaths(gitDir, 'REVERT_HEAD')),
|
|
2099
|
-
fsExists(joinPaths(gitDir, 'rebase-merge')),
|
|
2100
|
-
fsExists(joinPaths(gitDir, 'rebase-apply')),
|
|
2101
|
-
]);
|
|
2102
|
-
return states.some(Boolean);
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
__decorate([
|
|
2106
|
-
debug()
|
|
2107
|
-
], MaintenanceGitSubProvider.prototype, "getHealthSnapshot", null);
|
|
2108
|
-
__decorate([
|
|
2109
|
-
debug()
|
|
2110
|
-
], MaintenanceGitSubProvider.prototype, "getHealthDetails", null);
|
|
2111
|
-
__decorate([
|
|
2112
|
-
debug()
|
|
2113
|
-
], MaintenanceGitSubProvider.prototype, "getCapabilities", null);
|
|
2114
|
-
__decorate([
|
|
2115
|
-
debug()
|
|
2116
|
-
], MaintenanceGitSubProvider.prototype, "runMaintenanceTask", null);
|
|
2117
|
-
__decorate([
|
|
2118
|
-
debug()
|
|
2119
|
-
], MaintenanceGitSubProvider.prototype, "applyOptimization", null);
|
|
2120
|
-
__decorate([
|
|
2121
|
-
debug()
|
|
2122
|
-
], MaintenanceGitSubProvider.prototype, "revertOptimization", null);
|
|
2123
|
-
__decorate([
|
|
2124
|
-
debug()
|
|
2125
|
-
], MaintenanceGitSubProvider.prototype, "setCommitGraphDisabled", null);
|
|
2126
|
-
__decorate([
|
|
2127
|
-
debug()
|
|
2128
|
-
], MaintenanceGitSubProvider.prototype, "claimMaintenancePass", null);
|
|
172
|
+
var MaintenanceGitSubProvider = class {
|
|
173
|
+
context;
|
|
174
|
+
git;
|
|
175
|
+
cache;
|
|
176
|
+
provider;
|
|
177
|
+
constructor(context, git, cache, provider) {
|
|
178
|
+
this.context = context;
|
|
179
|
+
this.git = git;
|
|
180
|
+
this.cache = cache;
|
|
181
|
+
this.provider = provider;
|
|
182
|
+
}
|
|
183
|
+
commitGraphWrittenAt = /* @__PURE__ */ new Map();
|
|
184
|
+
commitGraphWriteInflight = /* @__PURE__ */ new Set();
|
|
185
|
+
request(repoPath, task) {
|
|
186
|
+
switch (task) {
|
|
187
|
+
case "commit-graph": return this.ensureCommitGraph(repoPath);
|
|
188
|
+
case "loose-objects":
|
|
189
|
+
case "incremental-repack":
|
|
190
|
+
case "pack-refs": return;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Opportunistically refreshes git's commit-graph (the demand cadence behind `request('commit-graph')`).
|
|
195
|
+
* Without one that COVERS the history, any ordered walk (`--date-order`/`--topo-order` — exactly the
|
|
196
|
+
* graph's initial load) must inflate every commit object to sort BEFORE the first row can be emitted,
|
|
197
|
+
* costing a full-history walk per open; the commit-graph also accelerates `git log`, merge-base, and
|
|
198
|
+
* ahead/behind across the whole extension. It's a standard acceleration cache (`git gc`/`git maintenance`
|
|
199
|
+
* write it routinely) and is always safe to delete. Fire-and-forget: refreshed at most every few minutes
|
|
200
|
+
* per object database (a current chain makes the write a near-no-op), at background queue priority,
|
|
201
|
+
* failures swallowed. Cross-WINDOW writes aren't coordinated here — git's own `commit-graph-chain.lock`
|
|
202
|
+
* serializes them; a loser errors and is swallowed. Resolves `true` only when the write completes; the
|
|
203
|
+
* health service uses that signal for one post-write freshness probe, while graph consumers ignore it.
|
|
204
|
+
*/
|
|
205
|
+
ensureCommitGraph(repoPath) {
|
|
206
|
+
if (this.context.config?.maintenance?.enabled === false) return Promise.resolve(false);
|
|
207
|
+
if (this.context.config?.graph?.writeCommitGraph === false) return Promise.resolve(false);
|
|
208
|
+
const lastWrittenAt = this.commitGraphWrittenAt.get(repoPath);
|
|
209
|
+
if (lastWrittenAt != null && Date.now() - lastWrittenAt < commitGraphRefreshIntervalMs) return Promise.resolve(false);
|
|
210
|
+
this.commitGraphWrittenAt.set(repoPath, Date.now());
|
|
211
|
+
return (async () => {
|
|
212
|
+
try {
|
|
213
|
+
if (!await this.git.supports("git:commit-graph")) return false;
|
|
214
|
+
const gitDir = await this.provider.config.getGitDir(repoPath).catch(() => void 0);
|
|
215
|
+
const commonKey = gitDir != null ? (gitDir.commonUri ?? gitDir.uri).fsPath : repoPath;
|
|
216
|
+
if (this.commitGraphWriteInflight.has(commonKey)) return false;
|
|
217
|
+
if (commonKey !== repoPath) {
|
|
218
|
+
const lastCommonWriteAt = this.commitGraphWrittenAt.get(commonKey);
|
|
219
|
+
if (lastCommonWriteAt != null && Date.now() - lastCommonWriteAt < commitGraphRefreshIntervalMs) return false;
|
|
220
|
+
this.commitGraphWrittenAt.set(commonKey, Date.now());
|
|
221
|
+
}
|
|
222
|
+
this.commitGraphWriteInflight.add(commonKey);
|
|
223
|
+
try {
|
|
224
|
+
if (await this.isCommitGraphWriteDisabled(repoPath)) return false;
|
|
225
|
+
await this.writeCommitGraph(repoPath, true);
|
|
226
|
+
return true;
|
|
227
|
+
} finally {
|
|
228
|
+
this.commitGraphWriteInflight.delete(commonKey);
|
|
229
|
+
}
|
|
230
|
+
} catch {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
})();
|
|
234
|
+
}
|
|
235
|
+
/** Shared opt-out gate for automatic and explicit writes. */
|
|
236
|
+
async isCommitGraphWriteDisabled(repoPath, cancellation) {
|
|
237
|
+
const optOut = await this.runQuietly(repoPath, cancellation, "config", "--type=bool", "--get", "core.commitGraph");
|
|
238
|
+
this.throwIfDidNotComplete(optOut, cancellation);
|
|
239
|
+
if (optOut.stdout.trim() === "false") return true;
|
|
240
|
+
return await this.provider.config.getGkConfig(repoPath, "gk.commitGraphDisabled") === "true";
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The commit-graph write itself. Always a `--split` write: mere existence isn't enough (a stale or thin
|
|
244
|
+
* chain — e.g. one auto-gc increment — accelerates nothing); `--split` appends an incremental layer
|
|
245
|
+
* covering only the uncovered commits (near-no-op when current) and git self-merges layers by its
|
|
246
|
+
* geometric policy. Background priority: a first write on a huge repo can run for a while and must never
|
|
247
|
+
* hold a queue slot ahead of interactive work. Throws on failure — callers decide whether to swallow.
|
|
248
|
+
*/
|
|
249
|
+
async writeCommitGraph(repoPath, bounded, cancellation) {
|
|
250
|
+
const partialClone = await this.isPartialClone(repoPath, cancellation);
|
|
251
|
+
const args = [
|
|
252
|
+
"commit-graph",
|
|
253
|
+
"write",
|
|
254
|
+
"--reachable",
|
|
255
|
+
bounded || partialClone ? "--split" : "--split=replace"
|
|
256
|
+
];
|
|
257
|
+
if (!partialClone && await this.git.supports("git:commit-graph:changed-paths")) {
|
|
258
|
+
args.push("--changed-paths");
|
|
259
|
+
if (bounded) args.push("--max-new-filters=512");
|
|
260
|
+
}
|
|
261
|
+
await this.git.run({
|
|
262
|
+
cwd: repoPath,
|
|
263
|
+
priority: "background",
|
|
264
|
+
cancellation,
|
|
265
|
+
env: { GIT_NO_LAZY_FETCH: "1" },
|
|
266
|
+
selfMaintenance: true
|
|
267
|
+
}, ...args);
|
|
268
|
+
}
|
|
269
|
+
/** Config-only partial/promisor detection; never examines an object and therefore cannot itself lazy-fetch. */
|
|
270
|
+
async isPartialClone(repoPath, cancellation) {
|
|
271
|
+
const result = await this.runQuietly(repoPath, cancellation, "config", "--local", "--get-regex", "^(extensions\\.partialclone|remote\\..*\\.promisor)$");
|
|
272
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
273
|
+
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) throw new Error(l10n.t("Unable to detect a partial clone (git exited {0})", String(result.exitCode)));
|
|
274
|
+
if (result.exitCode !== 0) return false;
|
|
275
|
+
const config = parseConfigRegexOutput(result.stdout, { includeValueless: true });
|
|
276
|
+
for (const [key, value] of config) if (key === "extensions.partialclone" || key.endsWith(".promisor") && parseGitBoolean(value)) return true;
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
/** Honors an explicit MIDX opt-out on both automatic and user-invoked incremental repacks. */
|
|
280
|
+
async isMultiPackIndexEnabled(repoPath, cancellation) {
|
|
281
|
+
const result = await this.runQuietly(repoPath, cancellation, "config", "--bool", "--get", "core.multiPackIndex");
|
|
282
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
283
|
+
if (result.exitCode === gitConfigGetMissingExitCode) return true;
|
|
284
|
+
if (result.exitCode !== 0) throw new Error(l10n.t("Unable to read core.multiPackIndex (git exited {0})", String(result.exitCode)));
|
|
285
|
+
return parseGitBoolean(result.stdout.trim());
|
|
286
|
+
}
|
|
287
|
+
async getHealthSnapshot(repoPath, cancellation) {
|
|
288
|
+
await this.reconcilePendingConfigChanges(repoPath, cancellation);
|
|
289
|
+
const gitDir = await this.provider.config.getGitDir(repoPath);
|
|
290
|
+
const commonGitDir = (gitDir.commonUri ?? gitDir.uri).fsPath;
|
|
291
|
+
const objectsDir = joinPaths(commonGitDir, "objects");
|
|
292
|
+
const packDir = joinPaths(objectsDir, "pack");
|
|
293
|
+
const indexPath = joinPaths(gitDir.uri.fsPath, "index");
|
|
294
|
+
const [commitGraphStat, multiPackIndex, packs, looseObjects, indexBytes, indexEntryCount, sharedIndex, conflictOperation, config, maintenanceRegistered, gkMarkers, supportsMaintenanceRun, changedPaths, changedPathsFeatureSupported, shallowRepository, partialClone, looseRefs, supportsPackRefsMaintenance] = await Promise.allSettled([
|
|
295
|
+
this.probeCommitGraph(objectsDir),
|
|
296
|
+
this.probeMultiPackIndex(packDir),
|
|
297
|
+
this.probePacks(objectsDir),
|
|
298
|
+
this.sampleLooseObjects(objectsDir),
|
|
299
|
+
this.fileBytes(indexPath),
|
|
300
|
+
this.probeIndexEntryCount(indexPath),
|
|
301
|
+
this.probeSharedIndex(gitDir.uri.fsPath),
|
|
302
|
+
this.probeConflictOperation(gitDir.uri.fsPath),
|
|
303
|
+
this.probeConfig(repoPath, cancellation),
|
|
304
|
+
this.isMaintenanceRegistered(repoPath, cancellation),
|
|
305
|
+
this.probeGkMarkers(repoPath),
|
|
306
|
+
this.git.supports("git:maintenance"),
|
|
307
|
+
this.probeChangedPathFilters(objectsDir),
|
|
308
|
+
this.git.supports("git:commit-graph:changed-paths"),
|
|
309
|
+
this.probePathPresence(joinPaths(commonGitDir, "shallow")),
|
|
310
|
+
this.isPartialClone(repoPath, cancellation),
|
|
311
|
+
this.probeLooseRefs(joinPaths(commonGitDir, "refs")),
|
|
312
|
+
this.git.supports("git:maintenance:pack-refs")
|
|
313
|
+
]);
|
|
314
|
+
const markers = getSettledValue(gkMarkers) ?? emptyGkMarkers;
|
|
315
|
+
const configValue = getSettledValue(config);
|
|
316
|
+
const sparseIndexState = await this.reconcileSparseIndexMarkers(repoPath, gitDir.uri.fsPath, configValue?.sparseIndex, cancellation).catch(() => ({
|
|
317
|
+
enabled: configValue?.sparseIndex,
|
|
318
|
+
applied: false
|
|
319
|
+
}));
|
|
320
|
+
const rawIndexBytes = getSettledValue(indexBytes) ?? 0;
|
|
321
|
+
const rawIndexEntryCount = getSettledValue(indexEntryCount);
|
|
322
|
+
const sharedIndexValue = getSettledValue(sharedIndex);
|
|
323
|
+
const conflictOperationValue = getSettledValue(conflictOperation);
|
|
324
|
+
const packsValue = getSettledValue(packs);
|
|
325
|
+
const multiPackIndexValue = getSettledValue(multiPackIndex);
|
|
326
|
+
const indexedPackNames = multiPackIndexValue?.packNames;
|
|
327
|
+
const packsOutsideMultiPackIndex = configValue?.multiPackIndexEnabled === true && packsValue != null && indexedPackNames != null ? packsValue.names.filter((name) => !indexedPackNames.has(name)).length : void 0;
|
|
328
|
+
const splitIndex = configValue?.splitIndex === true || sharedIndexValue?.present === true ? true : configValue != null && sharedIndexValue != null ? false : void 0;
|
|
329
|
+
const indexEntryCountType = configValue == null || rawIndexEntryCount == null || sharedIndexValue == null || conflictOperationValue == null ? "unavailable" : splitIndex ? "split" : conflictOperationValue ? "conflicted" : sparseIndexState.enabled ? "sparse" : "full";
|
|
330
|
+
return {
|
|
331
|
+
repository: {
|
|
332
|
+
shallow: getSettledValue(shallowRepository),
|
|
333
|
+
partial: getSettledValue(partialClone),
|
|
334
|
+
sparseCheckout: configValue?.sparseCheckout,
|
|
335
|
+
sparseCheckoutCone: configValue?.sparseCheckoutCone,
|
|
336
|
+
sparseIndex: sparseIndexState.enabled,
|
|
337
|
+
splitIndex,
|
|
338
|
+
refFormat: configValue?.refFormat ?? "unknown"
|
|
339
|
+
},
|
|
340
|
+
looseRefs: getSettledValue(looseRefs) ?? {
|
|
341
|
+
count: 0,
|
|
342
|
+
exact: false
|
|
343
|
+
},
|
|
344
|
+
commitGraph: {
|
|
345
|
+
...getSettledValue(commitGraphStat) ?? {
|
|
346
|
+
present: false,
|
|
347
|
+
mtime: void 0
|
|
348
|
+
},
|
|
349
|
+
changedPaths: getSettledValue(changedPaths) ?? false,
|
|
350
|
+
changedPathsSupported: getSettledValue(changedPathsFeatureSupported) === true && getSettledValue(partialClone) === false,
|
|
351
|
+
disabled: markers.commitGraphDisabled,
|
|
352
|
+
readDisabled: configValue?.commitGraphReadDisabled ?? false
|
|
353
|
+
},
|
|
354
|
+
multiPackIndex: multiPackIndexValue?.present ?? false,
|
|
355
|
+
multiPackIndexEnabled: configValue?.multiPackIndexEnabled,
|
|
356
|
+
packCount: packsValue?.names.length ?? 0,
|
|
357
|
+
packsOutsideMultiPackIndex,
|
|
358
|
+
incrementalRepackAutoThreshold: configValue?.incrementalRepackAutoThreshold,
|
|
359
|
+
packBytes: packsValue?.bytes ?? 0,
|
|
360
|
+
looseObjects: getSettledValue(looseObjects) ?? {
|
|
361
|
+
objectsInSampledDirs: 0,
|
|
362
|
+
dirsSampled: 0
|
|
363
|
+
},
|
|
364
|
+
indexBytes: rawIndexBytes + (indexEntryCountType === "split" ? sharedIndexValue?.bytes ?? 0 : 0),
|
|
365
|
+
indexEntryCount: indexEntryCountType === "full" || indexEntryCountType === "sparse" ? rawIndexEntryCount : void 0,
|
|
366
|
+
indexEntryCountType,
|
|
367
|
+
config: configValue ?? {
|
|
368
|
+
fsmonitor: false,
|
|
369
|
+
untrackedCache: false,
|
|
370
|
+
untrackedCacheConfigured: true,
|
|
371
|
+
manyFiles: false
|
|
372
|
+
},
|
|
373
|
+
maintenanceRegistered: getSettledValue(maintenanceRegistered),
|
|
374
|
+
fsmonitorNotApplicable: markers.fsmonitorNotApplicable,
|
|
375
|
+
untrackedCacheNotApplicable: markers.untrackedCacheNotApplicable,
|
|
376
|
+
applied: {
|
|
377
|
+
...markers.applied,
|
|
378
|
+
sparseIndex: sparseIndexState.applied
|
|
379
|
+
},
|
|
380
|
+
supportsMaintenanceRun: getSettledValue(supportsMaintenanceRun) ?? false,
|
|
381
|
+
supportsPackRefsMaintenance: getSettledValue(supportsPackRefsMaintenance) ?? false
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Reads all Git Health gk markers (not-applicable flags + `gk.applied.*` ownership) from ONE bulk
|
|
386
|
+
* `.git/gk/config` read (git lowercases the section + variable in `--get-regexp` output, preserving the
|
|
387
|
+
* `applied` subsection). A read failure degrades to all-false — the report just re-suggests, never crashes.
|
|
388
|
+
*/
|
|
389
|
+
async probeGkMarkers(repoPath) {
|
|
390
|
+
const map = await this.provider.config.getGkConfigRegex(repoPath, "^gk\\.").catch(() => /* @__PURE__ */ new Map());
|
|
391
|
+
return {
|
|
392
|
+
fsmonitorNotApplicable: map.get("gk.fsmonitornotapplicable") === "true",
|
|
393
|
+
untrackedCacheNotApplicable: map.get("gk.untrackedcachenotapplicable") === "true",
|
|
394
|
+
applied: {
|
|
395
|
+
untrackedCache: map.has("gk.applied.untrackedcache"),
|
|
396
|
+
fsmonitor: map.has("gk.applied.fsmonitor"),
|
|
397
|
+
manyFiles: map.has("gk.applied.manyfiles"),
|
|
398
|
+
backgroundMaintenance: map.has("gk.applied.backgroundmaintenance"),
|
|
399
|
+
sparseIndex: false
|
|
400
|
+
},
|
|
401
|
+
commitGraphDisabled: map.get("gk.commitgraphdisabled") === "true"
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
async getHealthDetails(repoPath, cancellation) {
|
|
405
|
+
const [commitCountResult, countObjectsResult] = await Promise.allSettled([this.runQuietly(repoPath, cancellation, "rev-list", "--count", "--all"), this.runQuietly(repoPath, cancellation, "count-objects", "-v")]);
|
|
406
|
+
const commitCountRaw = getSettledValue(commitCountResult)?.stdout.trim();
|
|
407
|
+
const commitCount = commitCountRaw ? parseInt(commitCountRaw, 10) : void 0;
|
|
408
|
+
const countObjectsStdout = getSettledValue(countObjectsResult)?.stdout;
|
|
409
|
+
return {
|
|
410
|
+
commitCount: commitCount != null && !Number.isNaN(commitCount) ? commitCount : void 0,
|
|
411
|
+
countObjects: countObjectsStdout ? parseCountObjects(countObjectsStdout) : void 0
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
_capabilities;
|
|
415
|
+
getCapabilities(_repoPath) {
|
|
416
|
+
return this._capabilities ??= this.getCapabilitiesCore();
|
|
417
|
+
}
|
|
418
|
+
async getCapabilitiesCore() {
|
|
419
|
+
const requiresGit = (feature, systemd = false) => systemd ? l10n.t("Requires Git {version} or later (for systemd timer scheduling)", { version: String(gitFeaturesByVersion.get(feature)) }) : l10n.t("Requires Git {version} or later", { version: String(gitFeaturesByVersion.get(feature)) });
|
|
420
|
+
const maintenanceStartFeature = this.backgroundMaintenanceFeature;
|
|
421
|
+
const fsmonitorFeature = fsmonitorFeatureForPlatform();
|
|
422
|
+
const [untrackedCacheResult, fsmonitorResult, backgroundMaintenanceResult, manyFilesResult, skipHashResult, sparseIndexResult] = await Promise.allSettled([
|
|
423
|
+
this.git.supports("git:untrackedCache"),
|
|
424
|
+
fsmonitorFeature != null ? this.git.supports(fsmonitorFeature) : false,
|
|
425
|
+
this.git.supports(maintenanceStartFeature),
|
|
426
|
+
this.git.supports("git:manyFiles"),
|
|
427
|
+
this.git.supports("git:index:skipHash"),
|
|
428
|
+
this.git.supports("git:sparse-index")
|
|
429
|
+
]);
|
|
430
|
+
const untrackedCache = getSettledValue(untrackedCacheResult) ?? false;
|
|
431
|
+
const fsmonitor = getSettledValue(fsmonitorResult) ?? false;
|
|
432
|
+
const backgroundMaintenance = getSettledValue(backgroundMaintenanceResult) ?? false;
|
|
433
|
+
const manyFiles = getSettledValue(manyFilesResult) ?? false;
|
|
434
|
+
const skipHash = getSettledValue(skipHashResult) ?? false;
|
|
435
|
+
const sparseIndex = getSettledValue(sparseIndexResult) ?? false;
|
|
436
|
+
return [
|
|
437
|
+
{
|
|
438
|
+
id: "untrackedCache",
|
|
439
|
+
supported: untrackedCache,
|
|
440
|
+
reason: untrackedCache ? void 0 : requiresGit("git:untrackedCache")
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
id: "fsmonitor",
|
|
444
|
+
supported: fsmonitor,
|
|
445
|
+
reason: fsmonitorFeature == null ? l10n.t("Only available on Windows, macOS, and Linux") : !fsmonitor ? requiresGit(fsmonitorFeature) : void 0
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: "backgroundMaintenance",
|
|
449
|
+
supported: backgroundMaintenance,
|
|
450
|
+
reason: backgroundMaintenance ? void 0 : requiresGit(maintenanceStartFeature, maintenanceStartFeature === "git:maintenance:start:systemd")
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
id: "manyFiles",
|
|
454
|
+
supported: manyFiles,
|
|
455
|
+
reason: manyFiles ? void 0 : requiresGit("git:manyFiles"),
|
|
456
|
+
note: manyFiles && skipHash ? l10n.t("Also enables index.skipHash — Git before 2.40 reports the zeroed hash as corrupt, and some libgit2- and JGit-based tools may reject or misdiagnose the index") : void 0
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
id: "sparseIndex",
|
|
460
|
+
supported: sparseIndex,
|
|
461
|
+
reason: sparseIndex ? void 0 : requiresGit("git:sparse-index"),
|
|
462
|
+
note: sparseIndex ? l10n.t("Older Git versions and some tools that read the index directly do not understand sparse-directory entries") : void 0
|
|
463
|
+
}
|
|
464
|
+
];
|
|
465
|
+
}
|
|
466
|
+
async runMaintenanceTask(repoPath, task, options) {
|
|
467
|
+
const cancellation = options?.cancellation;
|
|
468
|
+
if (task === "commit-graph") {
|
|
469
|
+
if (!await this.git.supports("git:commit-graph")) return false;
|
|
470
|
+
if (await this.isCommitGraphWriteDisabled(repoPath, cancellation)) return false;
|
|
471
|
+
await this.writeCommitGraph(repoPath, false, cancellation);
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
474
|
+
const maintenanceFeature = task === "pack-refs" ? "git:maintenance:pack-refs" : "git:maintenance";
|
|
475
|
+
if (!await this.git.supports(maintenanceFeature)) return false;
|
|
476
|
+
if (task === "incremental-repack" && !await this.isMultiPackIndexEnabled(repoPath, cancellation)) return false;
|
|
477
|
+
await this.git.run({
|
|
478
|
+
cwd: repoPath,
|
|
479
|
+
errors: "throw",
|
|
480
|
+
priority: "background",
|
|
481
|
+
cancellation,
|
|
482
|
+
selfMaintenance: true
|
|
483
|
+
}, "maintenance", "run", ...options?.auto ? ["--auto"] : [], `--task=${task}`);
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
async applyOptimization(repoPath, id, cancellation) {
|
|
487
|
+
await this.reconcilePendingConfigChanges(repoPath, cancellation);
|
|
488
|
+
switch (id) {
|
|
489
|
+
case "untrackedCache": return this.applyUntrackedCache(repoPath, cancellation);
|
|
490
|
+
case "fsmonitor": return this.applyFsmonitor(repoPath, cancellation);
|
|
491
|
+
case "backgroundMaintenance": return this.startBackgroundMaintenance(repoPath, cancellation);
|
|
492
|
+
case "manyFiles": return this.applyManyFiles(repoPath, cancellation);
|
|
493
|
+
case "sparseIndex": return this.applySparseIndex(repoPath, cancellation);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
async revertOptimization(repoPath, id, cancellation) {
|
|
497
|
+
await this.reconcilePendingConfigChanges(repoPath, cancellation);
|
|
498
|
+
switch (id) {
|
|
499
|
+
case "untrackedCache":
|
|
500
|
+
await this.revertConfigLever(repoPath, "core.untrackedCache", "gk.applied.untrackedCache", cancellation);
|
|
501
|
+
break;
|
|
502
|
+
case "fsmonitor":
|
|
503
|
+
if (await this.revertConfigLever(repoPath, "core.fsmonitor", "gk.applied.fsmonitor", cancellation)) await this.runQuietly(repoPath, cancellation, "fsmonitor--daemon", "stop");
|
|
504
|
+
break;
|
|
505
|
+
case "backgroundMaintenance":
|
|
506
|
+
await this.revertBackgroundMaintenance(repoPath, cancellation);
|
|
507
|
+
break;
|
|
508
|
+
case "manyFiles":
|
|
509
|
+
if (await this.provider.config.getGkConfig(repoPath, "gk.applied.manyFiles") != null) {
|
|
510
|
+
await this.revertConfigLever(repoPath, "index.skipHash", "gk.applied.skipHash", cancellation);
|
|
511
|
+
await this.revertConfigLever(repoPath, "feature.manyFiles", "gk.applied.manyFiles", cancellation);
|
|
512
|
+
}
|
|
513
|
+
break;
|
|
514
|
+
case "sparseIndex": await this.revertSparseIndex(repoPath, cancellation);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* The Git Health per-repository commit-graph off switch (`gk.commitGraphDisabled`). Unlike the
|
|
519
|
+
* ownership markers above, this isn't a "record prior, then restore" lever — it's a plain flag with no
|
|
520
|
+
* underlying config value to protect — so it needs no marker lock; two windows toggling it concurrently
|
|
521
|
+
* just resolve to whichever write lands last.
|
|
522
|
+
*/
|
|
523
|
+
async setCommitGraphDisabled(repoPath, disabled, cancellation) {
|
|
524
|
+
if (disabled) {
|
|
525
|
+
await this.provider.config.setGkConfig(repoPath, "gk.commitGraphDisabled", "true");
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (await this.readGkMarkerUncached(repoPath, "gk.commitGraphDisabled", cancellation) == null) return;
|
|
529
|
+
await this.provider.config.setGkConfig(repoPath, "gk.commitGraphDisabled", void 0);
|
|
530
|
+
}
|
|
531
|
+
async applyUntrackedCache(repoPath, cancellation) {
|
|
532
|
+
if ((await this.probeConfig(repoPath, cancellation)).untrackedCacheConfigured) return false;
|
|
533
|
+
if (!await this.testUntrackedCacheSupport(repoPath, cancellation)) {
|
|
534
|
+
await this.markGkConfigSafe(repoPath, "gk.untrackedCacheNotApplicable", "true");
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
return this.withMarkerLock(repoPath, async () => {
|
|
538
|
+
if ((await this.probeConfig(repoPath, cancellation)).untrackedCacheConfigured) return false;
|
|
539
|
+
return this.applyConfigChangesUnlocked(repoPath, [untrackedCacheChange], cancellation);
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
/** Whether git's filesystem probe says the untracked cache can be used here (exit 0). */
|
|
543
|
+
async testUntrackedCacheSupport(repoPath, cancellation) {
|
|
544
|
+
const result = await this.runQuietly(repoPath, cancellation, "update-index", "--test-untracked-cache");
|
|
545
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
546
|
+
if (result.exitCode !== 0 && result.exitCode !== untrackedCacheUnsupportedExitCode) throw new Error(l10n.t("Untracked-cache probe did not complete (git exited {0})", String(result.exitCode)));
|
|
547
|
+
return result.exitCode === 0;
|
|
548
|
+
}
|
|
549
|
+
async applyFsmonitor(repoPath, cancellation) {
|
|
550
|
+
const scope = getScopedLogger();
|
|
551
|
+
if ((await this.probeConfig(repoPath, cancellation)).fsmonitor) return false;
|
|
552
|
+
const fsmonitorFeature = fsmonitorFeatureForPlatform();
|
|
553
|
+
if (fsmonitorFeature == null) return false;
|
|
554
|
+
if (!await this.git.supports(fsmonitorFeature)) return false;
|
|
555
|
+
const probe = await this.runQuietly(repoPath, cancellation, "fsmonitor--daemon", "status");
|
|
556
|
+
this.throwIfDidNotComplete(probe, cancellation);
|
|
557
|
+
if (isFsmonitorDaemonUnsupported(probe)) {
|
|
558
|
+
scope?.warn(`FSMonitor daemon unsupported by this git build for '${repoPath}'; marking not-applicable`);
|
|
559
|
+
await this.markGkConfigSafe(repoPath, "gk.fsmonitorNotApplicable", "true");
|
|
560
|
+
return false;
|
|
561
|
+
}
|
|
562
|
+
if (!await this.withMarkerLock(repoPath, async () => {
|
|
563
|
+
await this.reconcilePendingConfigChangesUnlocked(repoPath, cancellation);
|
|
564
|
+
if ((await this.probeConfig(repoPath, cancellation)).fsmonitor) return false;
|
|
565
|
+
return this.applyConfigChangesUnlocked(repoPath, [fsmonitorChange], cancellation);
|
|
566
|
+
})) return false;
|
|
567
|
+
const result = await this.runQuietly(repoPath, cancellation, "status", "--porcelain");
|
|
568
|
+
if (result.completion.status === "exited" && result.exitCode === 0 && cancellation?.aborted !== true) return true;
|
|
569
|
+
await this.restorePriorAndClear(repoPath, "core.fsmonitor", "gk.applied.fsmonitor");
|
|
570
|
+
await this.runQuietly(repoPath, void 0, "fsmonitor--daemon", "stop");
|
|
571
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
572
|
+
if (!Number.isInteger(result.exitCode)) throw new Error(l10n.t("FSMonitor warm-up did not complete (git exited {0})", String(result.exitCode)));
|
|
573
|
+
const baseline = await this.runQuietly(repoPath, cancellation, "status", "--porcelain");
|
|
574
|
+
this.throwIfDidNotComplete(baseline, cancellation);
|
|
575
|
+
if (baseline.exitCode !== 0) throw new Error(l10n.t("Repository status fails independently of FSMonitor (git exited {0})", String(baseline.exitCode)));
|
|
576
|
+
scope?.warn(`FSMonitor failed to start for '${repoPath}'; reverting and marking not-applicable`);
|
|
577
|
+
await this.markGkConfigSafe(repoPath, "gk.fsmonitorNotApplicable", "true");
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
async applyManyFiles(repoPath, cancellation) {
|
|
581
|
+
if (!await this.git.supports("git:manyFiles")) return false;
|
|
582
|
+
const changes = [manyFilesChange];
|
|
583
|
+
if (await this.git.supports("git:index:skipHash")) changes.push(skipHashChange);
|
|
584
|
+
const initialConfig = await this.probeConfig(repoPath, cancellation);
|
|
585
|
+
if (!initialConfig.untrackedCacheConfigured && await this.provider.config.getGkConfig(repoPath, "gk.untrackedCacheNotApplicable") === "true") return false;
|
|
586
|
+
const initialSupport = initialConfig.untrackedCacheConfigured ? void 0 : await this.testUntrackedCacheSupport(repoPath, cancellation);
|
|
587
|
+
return this.withMarkerLock(repoPath, async () => {
|
|
588
|
+
await this.reconcilePendingConfigChangesUnlocked(repoPath, cancellation);
|
|
589
|
+
const localManyFiles = await this.getLocalConfig(repoPath, manyFilesChange.configKey, cancellation);
|
|
590
|
+
const manyFilesMarker = await this.readGkMarkerUncached(repoPath, manyFilesChange.markerKey, cancellation);
|
|
591
|
+
if (parseGitBoolean(localManyFiles) && manyFilesMarker == null) return false;
|
|
592
|
+
if (!(await this.probeConfig(repoPath, cancellation)).untrackedCacheConfigured) {
|
|
593
|
+
if (!(initialSupport ?? await this.testUntrackedCacheSupport(repoPath, cancellation))) {
|
|
594
|
+
await this.markGkConfigSafe(repoPath, "gk.untrackedCacheNotApplicable", "true");
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
return this.applyConfigChangesUnlocked(repoPath, changes, cancellation);
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
/** Enables sparse-directory index entries for an existing cone-mode sparse checkout. */
|
|
602
|
+
async applySparseIndex(repoPath, cancellation) {
|
|
603
|
+
if (!await this.git.supports("git:sparse-index")) return false;
|
|
604
|
+
const gitDir = await this.provider.config.getGitDir(repoPath);
|
|
605
|
+
const markerPaths = this.getSparseIndexMarkerPaths(gitDir.uri.fsPath);
|
|
606
|
+
return this.withMarkerLock(repoPath, async () => {
|
|
607
|
+
const config = await this.probeConfig(repoPath, cancellation);
|
|
608
|
+
const current = await this.reconcileSparseIndexMarkersUnlocked(markerPaths, config.sparseIndex);
|
|
609
|
+
if (current.enabled) return current.applied;
|
|
610
|
+
if (!config.sparseCheckout || !config.sparseCheckoutCone) return false;
|
|
611
|
+
const [sharedIndex, conflictOperation] = await Promise.all([this.probeSharedIndex(gitDir.uri.fsPath), this.probeConflictOperation(gitDir.uri.fsPath)]);
|
|
612
|
+
if (sharedIndex?.present === true || conflictOperation) return false;
|
|
613
|
+
await mkdir(markerPaths.dir, { recursive: true });
|
|
614
|
+
await (await open(markerPaths.pending, "wx")).close();
|
|
615
|
+
try {
|
|
616
|
+
await this.runSparseCheckoutReapply(repoPath, true, cancellation);
|
|
617
|
+
const completed = await this.reconcileSparseIndexMarkersUnlocked(markerPaths, true);
|
|
618
|
+
return completed.enabled && completed.applied;
|
|
619
|
+
} catch (ex) {
|
|
620
|
+
try {
|
|
621
|
+
const repaired = await this.reconcileSparseIndexMarkersUnlocked(markerPaths, await this.probeSparseIndexEnabled(repoPath));
|
|
622
|
+
if (repaired.enabled && repaired.applied) return true;
|
|
623
|
+
} catch (repairEx) {
|
|
624
|
+
const error = new Error(l10n.t("Unable to enable the sparse index or reconcile its ownership record"), { cause: ex });
|
|
625
|
+
error.errors = [repairEx];
|
|
626
|
+
throw error;
|
|
627
|
+
}
|
|
628
|
+
throw ex;
|
|
629
|
+
}
|
|
630
|
+
}, void 0, markerPaths);
|
|
631
|
+
}
|
|
632
|
+
/** Expands a sparse index only when this worktree's marker proves GitLens enabled it. */
|
|
633
|
+
async revertSparseIndex(repoPath, cancellation) {
|
|
634
|
+
const gitDir = await this.provider.config.getGitDir(repoPath);
|
|
635
|
+
const markerPaths = this.getSparseIndexMarkerPaths(gitDir.uri.fsPath);
|
|
636
|
+
await this.withMarkerLock(repoPath, async () => {
|
|
637
|
+
if (!(await this.reconcileSparseIndexMarkersUnlocked(markerPaths, await this.probeSparseIndexEnabled(repoPath, cancellation))).applied) return;
|
|
638
|
+
try {
|
|
639
|
+
await this.runSparseCheckoutReapply(repoPath, false, cancellation);
|
|
640
|
+
await rm(markerPaths.applied, { force: true });
|
|
641
|
+
} catch (ex) {
|
|
642
|
+
try {
|
|
643
|
+
const repaired = await this.reconcileSparseIndexMarkersUnlocked(markerPaths, await this.probeSparseIndexEnabled(repoPath));
|
|
644
|
+
if (!repaired.enabled && !repaired.applied) return;
|
|
645
|
+
} catch (repairEx) {
|
|
646
|
+
const error = new Error(l10n.t("Unable to disable the sparse index or reconcile its ownership record"), { cause: ex });
|
|
647
|
+
error.errors = [repairEx];
|
|
648
|
+
throw error;
|
|
649
|
+
}
|
|
650
|
+
throw ex;
|
|
651
|
+
}
|
|
652
|
+
}, void 0, markerPaths);
|
|
653
|
+
}
|
|
654
|
+
async runSparseCheckoutReapply(repoPath, enabled, cancellation) {
|
|
655
|
+
await this.git.run({
|
|
656
|
+
cwd: repoPath,
|
|
657
|
+
errors: "throw",
|
|
658
|
+
priority: "background",
|
|
659
|
+
cancellation,
|
|
660
|
+
selfMaintenance: true
|
|
661
|
+
}, "sparse-checkout", "reapply", enabled ? "--sparse-index" : "--no-sparse-index");
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* The `git maintenance start` version gate for the current platform: launchctl/schtasks scheduling
|
|
665
|
+
* (win/mac) needs 2.31; Linux relies on a systemd timer (2.34), since 2.31–2.33 is cron-only and
|
|
666
|
+
* modern distros often ship without cron.
|
|
667
|
+
*/
|
|
668
|
+
get backgroundMaintenanceFeature() {
|
|
669
|
+
return process.platform === "win32" || process.platform === "darwin" ? "git:maintenance:start" : "git:maintenance:start:systemd";
|
|
670
|
+
}
|
|
671
|
+
async startBackgroundMaintenance(repoPath, cancellation) {
|
|
672
|
+
const scope = getScopedLogger();
|
|
673
|
+
if (!await this.git.supports(this.backgroundMaintenanceFeature)) return false;
|
|
674
|
+
const registeredPath = await this.resolveMaintenanceRepoPath(repoPath, cancellation);
|
|
675
|
+
this._registeredMaintenanceRepos = void 0;
|
|
676
|
+
if (await this.isPathRegistered(repoPath, registeredPath, cancellation)) return false;
|
|
677
|
+
await this.recordPriorAndMark(repoPath, "maintenance.auto", "gk.applied.maintenanceAuto", cancellation);
|
|
678
|
+
await this.recordPriorAndMark(repoPath, "maintenance.strategy", "gk.applied.maintenanceStrategy", cancellation);
|
|
679
|
+
await this.provider.config.setGkConfig(repoPath, "gk.applied.backgroundMaintenance", registeredPath);
|
|
680
|
+
try {
|
|
681
|
+
await this.git.run({
|
|
682
|
+
cwd: registeredPath,
|
|
683
|
+
errors: "throw",
|
|
684
|
+
priority: "background",
|
|
685
|
+
cancellation,
|
|
686
|
+
selfMaintenance: true
|
|
687
|
+
}, "maintenance", "start");
|
|
688
|
+
} catch (ex) {
|
|
689
|
+
this._registeredMaintenanceRepos = void 0;
|
|
690
|
+
await this.revertBackgroundMaintenance(repoPath).catch((revertEx) => scope?.error(revertEx, `Unable to roll back a partial 'maintenance start' for '${repoPath}'`));
|
|
691
|
+
throw ex;
|
|
692
|
+
}
|
|
693
|
+
this._registeredMaintenanceRepos = void 0;
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
async revertBackgroundMaintenance(repoPath, cancellation) {
|
|
697
|
+
const scope = getScopedLogger();
|
|
698
|
+
const marker = await this.provider.config.getGkConfig(repoPath, "gk.applied.backgroundMaintenance");
|
|
699
|
+
if (marker == null) return;
|
|
700
|
+
const registeredPath = marker === "true" ? await this.resolveMaintenanceRepoPath(repoPath, cancellation) : marker;
|
|
701
|
+
let unregistered = false;
|
|
702
|
+
if (await this.git.supports("git:maintenance") && await fsExists(registeredPath)) {
|
|
703
|
+
const result = await this.runQuietly(registeredPath, cancellation, "maintenance", "unregister");
|
|
704
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
705
|
+
this._registeredMaintenanceRepos = void 0;
|
|
706
|
+
unregistered = !await this.isPathRegistered(repoPath, registeredPath, cancellation);
|
|
707
|
+
}
|
|
708
|
+
if (!unregistered) {
|
|
709
|
+
for (const candidate of await this.resolveRegistrationCandidates([registeredPath])) await this.runQuietly(repoPath, cancellation, "config", "--global", "--unset", "--fixed-value", "maintenance.repo", candidate);
|
|
710
|
+
this._registeredMaintenanceRepos = void 0;
|
|
711
|
+
if (await this.isPathRegistered(repoPath, registeredPath, cancellation)) throw new Error(l10n.t("Unable to unregister background maintenance"));
|
|
712
|
+
scope?.warn(`Removed the global maintenance.repo entry for '${registeredPath}' directly`);
|
|
713
|
+
}
|
|
714
|
+
const priorAuto = await this.provider.config.getGkConfig(repoPath, "gk.applied.maintenanceAuto");
|
|
715
|
+
if (priorAuto != null) await this.restoreLocalConfig(repoPath, "maintenance.auto", priorAuto, cancellation);
|
|
716
|
+
const priorStrategy = await this.provider.config.getGkConfig(repoPath, "gk.applied.maintenanceStrategy");
|
|
717
|
+
if (priorStrategy != null) {
|
|
718
|
+
await this.restoreLocalConfig(repoPath, "maintenance.strategy", priorStrategy, cancellation);
|
|
719
|
+
await this.provider.config.setGkConfig(repoPath, "gk.applied.maintenanceStrategy", void 0);
|
|
720
|
+
}
|
|
721
|
+
if (priorAuto != null) await this.provider.config.setGkConfig(repoPath, "gk.applied.maintenanceAuto", void 0);
|
|
722
|
+
await this.provider.config.setGkConfig(repoPath, "gk.applied.backgroundMaintenance", void 0);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Records a config lever's prior LOCAL value (or the `unset` sentinel) under its ownership marker BEFORE
|
|
726
|
+
* mutating, so undo restores the exact prior and never a hardcoded inverse; the marker's presence also
|
|
727
|
+
* means "applied by GitLens" (so undo is never offered for a user-enabled lever).
|
|
728
|
+
*/
|
|
729
|
+
async recordPriorAndMark(repoPath, configKey, markerKey, cancellation) {
|
|
730
|
+
await this.withMarkerLock(repoPath, () => this.recordPriorUnlocked(repoPath, configKey, markerKey, cancellation));
|
|
731
|
+
}
|
|
732
|
+
/** The body of {@link recordPriorAndMark}, for callers already holding the marker lock. */
|
|
733
|
+
async recordPriorUnlocked(repoPath, configKey, markerKey, cancellation) {
|
|
734
|
+
if (await this.readGkMarkerUncached(repoPath, markerKey, cancellation) != null) return;
|
|
735
|
+
const prior = await this.getLocalConfig(repoPath, configKey, cancellation);
|
|
736
|
+
await this.provider.config.setGkConfig(repoPath, markerKey, prior == null ? unsetConfigSentinel : prior === "" ? emptyConfigSentinel : prior);
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Reconciles write-ahead records left by an interrupted direct config mutation. The cached namespace read
|
|
740
|
+
* keeps the normal probe free of extra subprocesses; an actual pending record is re-read under the marker
|
|
741
|
+
* lock before it is finalized or cleared.
|
|
742
|
+
*/
|
|
743
|
+
async reconcilePendingConfigChanges(repoPath, cancellation) {
|
|
744
|
+
const markers = await this.provider.config.getGkConfigRegex(repoPath, "^gk\\.pending\\.");
|
|
745
|
+
if (!configLeverChanges.some((change) => markers.has(canonicalizeGitConfigKey(change.pendingKey)))) return;
|
|
746
|
+
await this.withMarkerLock(repoPath, () => this.reconcilePendingConfigChangesUnlocked(repoPath, cancellation));
|
|
747
|
+
}
|
|
748
|
+
/** Body of {@link reconcilePendingConfigChanges} for a caller already holding the marker lock. */
|
|
749
|
+
async reconcilePendingConfigChangesUnlocked(repoPath, cancellation) {
|
|
750
|
+
for (const change of configLeverChanges) {
|
|
751
|
+
const raw = await this.readGkMarkerUncached(repoPath, change.pendingKey, cancellation);
|
|
752
|
+
if (raw == null) continue;
|
|
753
|
+
const pending = decodePendingConfigChange(raw);
|
|
754
|
+
if (pending == null || pending.value !== change.value) {
|
|
755
|
+
await this.provider.config.setGkConfig(repoPath, change.pendingKey, void 0);
|
|
756
|
+
continue;
|
|
757
|
+
}
|
|
758
|
+
if (await this.readGkMarkerUncached(repoPath, change.markerKey, cancellation) == null) {
|
|
759
|
+
if (await this.getLocalConfig(repoPath, change.configKey, cancellation) === pending.value) await this.provider.config.setGkConfig(repoPath, change.markerKey, pending.prior);
|
|
760
|
+
}
|
|
761
|
+
await this.provider.config.setGkConfig(repoPath, change.pendingKey, void 0);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Applies direct config levers for a caller holding the ownership-marker lock. A write-ahead record closes
|
|
766
|
+
* the crash gap between the local config and ownership files; an ordinary failure restores every config
|
|
767
|
+
* value and marker without cancellation.
|
|
768
|
+
*/
|
|
769
|
+
async applyConfigChangesUnlocked(repoPath, changes, cancellation) {
|
|
770
|
+
await this.reconcilePendingConfigChangesUnlocked(repoPath, cancellation);
|
|
771
|
+
const states = [];
|
|
772
|
+
let alreadyApplied = false;
|
|
773
|
+
for (const change of changes) {
|
|
774
|
+
const marker = await this.readGkMarkerUncached(repoPath, change.markerKey, cancellation);
|
|
775
|
+
const current = await this.getLocalConfig(repoPath, change.configKey, cancellation);
|
|
776
|
+
if (current === change.value) {
|
|
777
|
+
alreadyApplied ||= marker != null;
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
const rollbackPrior = current == null ? unsetConfigSentinel : current === "" ? emptyConfigSentinel : current;
|
|
781
|
+
if (marker != null) {
|
|
782
|
+
states.push({
|
|
783
|
+
change,
|
|
784
|
+
prior: marker,
|
|
785
|
+
rollbackPrior,
|
|
786
|
+
alreadyOwned: true
|
|
787
|
+
});
|
|
788
|
+
continue;
|
|
789
|
+
}
|
|
790
|
+
states.push({
|
|
791
|
+
change,
|
|
792
|
+
prior: rollbackPrior,
|
|
793
|
+
rollbackPrior,
|
|
794
|
+
alreadyOwned: false
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
if (states.length === 0) return alreadyApplied;
|
|
798
|
+
const written = [];
|
|
799
|
+
const marked = [];
|
|
800
|
+
const pending = /* @__PURE__ */ new Set();
|
|
801
|
+
try {
|
|
802
|
+
for (const state of states) {
|
|
803
|
+
if (state.alreadyOwned) continue;
|
|
804
|
+
await this.provider.config.setGkConfig(repoPath, state.change.pendingKey, encodePendingConfigChange({
|
|
805
|
+
prior: state.prior,
|
|
806
|
+
value: state.change.value
|
|
807
|
+
}));
|
|
808
|
+
pending.add(state);
|
|
809
|
+
}
|
|
810
|
+
for (const state of states) {
|
|
811
|
+
await this.setLocalConfig(repoPath, state.change.configKey, state.change.value, cancellation);
|
|
812
|
+
written.push(state);
|
|
813
|
+
}
|
|
814
|
+
for (const state of states) {
|
|
815
|
+
if (state.alreadyOwned) continue;
|
|
816
|
+
await this.provider.config.setGkConfig(repoPath, state.change.markerKey, state.prior);
|
|
817
|
+
marked.push(state);
|
|
818
|
+
}
|
|
819
|
+
for (const state of pending) {
|
|
820
|
+
await this.provider.config.setGkConfig(repoPath, state.change.pendingKey, void 0);
|
|
821
|
+
pending.delete(state);
|
|
822
|
+
}
|
|
823
|
+
return true;
|
|
824
|
+
} catch (ex) {
|
|
825
|
+
const rollbackErrors = [];
|
|
826
|
+
for (const state of written.toReversed()) try {
|
|
827
|
+
await this.restoreLocalConfig(repoPath, state.change.configKey, state.rollbackPrior);
|
|
828
|
+
} catch (rollbackEx) {
|
|
829
|
+
rollbackErrors.push(rollbackEx);
|
|
830
|
+
}
|
|
831
|
+
for (const state of marked.toReversed()) try {
|
|
832
|
+
await this.provider.config.setGkConfig(repoPath, state.change.markerKey, void 0);
|
|
833
|
+
} catch (rollbackEx) {
|
|
834
|
+
rollbackErrors.push(rollbackEx);
|
|
835
|
+
}
|
|
836
|
+
for (const state of pending) try {
|
|
837
|
+
await this.provider.config.setGkConfig(repoPath, state.change.pendingKey, void 0);
|
|
838
|
+
} catch (rollbackEx) {
|
|
839
|
+
rollbackErrors.push(rollbackEx);
|
|
840
|
+
}
|
|
841
|
+
if (rollbackErrors.length) {
|
|
842
|
+
const error = new Error(l10n.t("Unable to apply Git maintenance settings and completely restore their prior values"), { cause: ex });
|
|
843
|
+
error.errors = rollbackErrors;
|
|
844
|
+
throw error;
|
|
845
|
+
}
|
|
846
|
+
throw ex;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
async claimMaintenancePass(repoPath, intervalMs) {
|
|
850
|
+
return this.withMarkerLock(repoPath, async () => {
|
|
851
|
+
const raw = await this.readGkMarkerUncached(repoPath, "gk.maintenanceLastRun");
|
|
852
|
+
const last = raw != null ? Date.parse(raw) : NaN;
|
|
853
|
+
if (!Number.isNaN(last) && Date.now() - last < intervalMs) return false;
|
|
854
|
+
await this.provider.config.setGkConfig(repoPath, "gk.maintenanceLastRun", (/* @__PURE__ */ new Date()).toISOString(), { skipInvalidation: ["branchOverviews", "baseBranchName"] });
|
|
855
|
+
return true;
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
/** The `.git/gk/` directory (common dir, so worktrees of a repo share it). */
|
|
859
|
+
async getGkDir(repoPath) {
|
|
860
|
+
const gitDir = await this.provider.config.getGitDir(repoPath);
|
|
861
|
+
return joinPaths((gitDir.commonUri ?? gitDir.uri).fsPath, "gk");
|
|
862
|
+
}
|
|
863
|
+
getSparseIndexMarkerPaths(gitDirPath) {
|
|
864
|
+
const dir = joinPaths(gitDirPath, "gk");
|
|
865
|
+
return {
|
|
866
|
+
dir,
|
|
867
|
+
applied: joinPaths(dir, sparseIndexAppliedMarker),
|
|
868
|
+
contention: "sparseIndex",
|
|
869
|
+
lock: joinPaths(dir, sparseIndexLockFile),
|
|
870
|
+
pending: joinPaths(dir, sparseIndexPendingMarker)
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Reconciles the sparse-index command's worktree-local write-ahead marker. The fast path is filesystem
|
|
875
|
+
* only; a pending or stale-applied marker takes the worktree's sparse-index operation lock and re-reads
|
|
876
|
+
* Git config before mutating anything, so it cannot act on a snapshot that raced another window's
|
|
877
|
+
* apply/undo. A live operation keeps that lock across the index rewrite, but snapshots never wait for it:
|
|
878
|
+
* they return the last committed marker state until the operation publishes its result.
|
|
879
|
+
*/
|
|
880
|
+
async reconcileSparseIndexMarkers(repoPath, gitDirPath, knownEnabled, cancellation) {
|
|
881
|
+
const markerPaths = this.getSparseIndexMarkerPaths(gitDirPath);
|
|
882
|
+
const [pending, applied] = await Promise.all([fsExists(markerPaths.pending), fsExists(markerPaths.applied)]);
|
|
883
|
+
if (knownEnabled == null) return {
|
|
884
|
+
enabled: void 0,
|
|
885
|
+
applied: false
|
|
886
|
+
};
|
|
887
|
+
if (!pending && (!applied || knownEnabled)) return {
|
|
888
|
+
enabled: knownEnabled,
|
|
889
|
+
applied: applied && knownEnabled
|
|
890
|
+
};
|
|
891
|
+
try {
|
|
892
|
+
return await this.withMarkerLock(repoPath, async () => this.reconcileSparseIndexMarkersUnlocked(markerPaths, await this.probeSparseIndexEnabled(repoPath, cancellation)), {
|
|
893
|
+
retryMs: 0,
|
|
894
|
+
maxAttempts: 0
|
|
895
|
+
}, markerPaths);
|
|
896
|
+
} catch (ex) {
|
|
897
|
+
if (!(ex instanceof MarkerLockContentionError)) throw ex;
|
|
898
|
+
return {
|
|
899
|
+
enabled: knownEnabled,
|
|
900
|
+
applied: applied && knownEnabled
|
|
901
|
+
};
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
/** Body of {@link reconcileSparseIndexMarkers} for a caller already holding the ownership lock. */
|
|
905
|
+
async reconcileSparseIndexMarkersUnlocked(markerPaths, enabled) {
|
|
906
|
+
const pending = await fsExists(markerPaths.pending);
|
|
907
|
+
let applied = await fsExists(markerPaths.applied);
|
|
908
|
+
if (pending) {
|
|
909
|
+
if (enabled) {
|
|
910
|
+
await mkdir(markerPaths.dir, { recursive: true });
|
|
911
|
+
if (applied) await rm(markerPaths.pending, { force: true });
|
|
912
|
+
else {
|
|
913
|
+
await rename(markerPaths.pending, markerPaths.applied);
|
|
914
|
+
applied = true;
|
|
915
|
+
}
|
|
916
|
+
} else await rm(markerPaths.pending, { force: true });
|
|
917
|
+
}
|
|
918
|
+
if (applied && !enabled) {
|
|
919
|
+
await rm(markerPaths.applied, { force: true });
|
|
920
|
+
applied = false;
|
|
921
|
+
}
|
|
922
|
+
return {
|
|
923
|
+
enabled,
|
|
924
|
+
applied
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
/** Reads the effective worktree-scoped sparse-index switch without relying on a cached config map. */
|
|
928
|
+
async probeSparseIndexEnabled(repoPath, cancellation) {
|
|
929
|
+
const result = await this.runQuietly(repoPath, cancellation, "config", "--bool", "--get", "index.sparse");
|
|
930
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
931
|
+
if (result.exitCode === gitConfigGetMissingExitCode) return false;
|
|
932
|
+
if (result.exitCode !== 0) throw new Error(l10n.t("Unable to read 'index.sparse' (git exited {0})", String(result.exitCode)));
|
|
933
|
+
return parseGitBoolean(result.stdout);
|
|
934
|
+
}
|
|
935
|
+
/** Reads an ownership marker straight from `.git/gk/config`, bypassing every cache. */
|
|
936
|
+
async readGkMarkerUncached(repoPath, markerKey, cancellation) {
|
|
937
|
+
const result = await this.runQuietly(repoPath, cancellation, "config", "--file", joinPaths(await this.getGkDir(repoPath), "config"), "--get", markerKey);
|
|
938
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
939
|
+
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) throw new Error(l10n.t("Unable to read the '{0}' marker (git exited {1})", markerKey, String(result.exitCode)));
|
|
940
|
+
return result.stdout.trim() || void 0;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Runs `fn` holding an exclusive on-disk lock over one ownership-marker scope. By default that is the
|
|
944
|
+
* repository family's config-marker scope; callers can provide a worktree-local lock location for an
|
|
945
|
+
* operation whose state is isolated per worktree. Two layers make this safe across processes:
|
|
946
|
+
*
|
|
947
|
+
* - **Exclusive-create ownership, with an identity record.** `open(lockPath, 'wx')` — the same `O_EXCL`
|
|
948
|
+
* primitive git uses for its own `*.lock` files — is the only atomic step; a contender that loses the
|
|
949
|
+
* race retries for up to `maxAttempts`, then fails loudly rather than proceeding unlocked (see below).
|
|
950
|
+
* The winner immediately writes its host, pid, and a fresh random `ownerId` into the lock file — an
|
|
951
|
+
* identity record, not a liveness lease, since nothing here ever acts on it while another holder is
|
|
952
|
+
* still running.
|
|
953
|
+
* - **Ownership-verified release.** On the way out, the lock file is removed only if its `ownerId` still
|
|
954
|
+
* matches the one this call wrote — a fresh random value per acquisition can't collide with a
|
|
955
|
+
* re-created lock the way an inode COULD in principle on some filesystems, so it's the primary check;
|
|
956
|
+
* the inode is also compared as a cheap secondary one.
|
|
957
|
+
*
|
|
958
|
+
* A lock left behind by a crashed window is deliberately NOT recovered automatically. Two designs were
|
|
959
|
+
* tried and rejected. Time-based leasing can't tell a dead owner from a slow one — an age alone doesn't
|
|
960
|
+
* distinguish them (git timeouts are user-configurable, and can be disabled entirely), and making it tell
|
|
961
|
+
* them apart takes a full lease-plus-fencing-token protocol this lock has no need for otherwise.
|
|
962
|
+
* Automatic stealing (rename the lock aside once a PID probe says its owner is provably dead) was tried
|
|
963
|
+
* next, and is unsound for a different reason: automatic recovery of an abandoned fixed-path lock cannot
|
|
964
|
+
* be made race-free using only the portable stock-Node primitives available here (exclusive-create and
|
|
965
|
+
* rename) — every recovery attempt separates observation from mutation, so a delayed stealer can rename
|
|
966
|
+
* away a NEW, live lock a fresh contender created in the gap between the probe and the rename, evicting a
|
|
967
|
+
* holder that was never dead. Kernel-managed advisory locking (`flock`) would close that gap, but Node
|
|
968
|
+
* exposes no portable interface to it and a native, platform-sensitive dependency is disproportionate
|
|
969
|
+
* here. Therefore a contender NEVER mutates an existing lock — only the creator removes one, and no stale
|
|
970
|
+
* observation can authorize mutation. Recovery is a guided MANUAL step instead: a give-up runs the same PID
|
|
971
|
+
* probe ONCE, purely to choose the error's wording. For the sparse-operation lock, a confirmed-live owner gets
|
|
972
|
+
* wait-only guidance, a confirmed-dead owner gets crash-recovery guidance, and an unverifiable owner gets the
|
|
973
|
+
* lock path plus guarded manual-recovery guidance. The shared marker lock retains its generic non-dead error.
|
|
974
|
+
* No verdict authorizes an automatic steal.
|
|
975
|
+
*
|
|
976
|
+
* Because a live holder can't lose its lock, `fn` needs no cancellation coupling to the lock itself — the
|
|
977
|
+
* critical section only ever ends on its own terms.
|
|
978
|
+
*
|
|
979
|
+
* Acquisition beyond the initial `open` is not atomic: the ownership record is written in a separate step
|
|
980
|
+
* just after. A crash landing exactly there — not caught by anything, since the process is gone — leaves
|
|
981
|
+
* a permanently-empty orphan lock; the give-up error's manual-deletion instructions are the only recovery
|
|
982
|
+
* for that case, same as for a confirmed-dead owner. A failure our OWN code can observe in that window
|
|
983
|
+
* (the post-`mkdir` setup, or the ownership write itself) is different: it fails closed, removing the
|
|
984
|
+
* lock it just created — ownership is certain there, since we hold the only handle — before rethrowing,
|
|
985
|
+
* so a transient error (e.g. `ENOSPC`) never strands a lock nothing can ever prove dead.
|
|
986
|
+
*
|
|
987
|
+
* Deliberately NOT named `config.lock` — that's the name git takes when writing `.git/gk/config` itself.
|
|
988
|
+
*/
|
|
989
|
+
async withMarkerLock(repoPath, fn, timings, lockLocation) {
|
|
990
|
+
const retryMs = timings?.retryMs ?? markerLockRetryMs;
|
|
991
|
+
const maxAttempts = timings?.maxAttempts ?? markerLockMaxAttempts;
|
|
992
|
+
const dir = lockLocation?.dir ?? await this.getGkDir(repoPath);
|
|
993
|
+
const lockPath = lockLocation?.lock ?? joinPaths(dir, "applied.lock");
|
|
994
|
+
try {
|
|
995
|
+
await mkdir(dir, { recursive: true });
|
|
996
|
+
} catch (ex) {
|
|
997
|
+
throw new Error(l10n.t("Could not acquire the Git maintenance settings lock at '{0}'. If this persists and no other VS Code window is using this repository, delete that file and try again.", lockPath), { cause: ex });
|
|
998
|
+
}
|
|
999
|
+
let handle;
|
|
1000
|
+
for (let attempt = 0; handle == null; attempt++) try {
|
|
1001
|
+
handle = await (timings?.openLock ? timings.openLock(lockPath) : open(lockPath, "wx"));
|
|
1002
|
+
} catch (ex) {
|
|
1003
|
+
if (ex.code !== "EEXIST") throw new Error(l10n.t("Could not acquire the Git maintenance settings lock at '{0}'. If this persists and no other VS Code window is using this repository, delete that file and try again.", lockPath), { cause: ex });
|
|
1004
|
+
if (attempt >= maxAttempts) {
|
|
1005
|
+
const verdict = await this.probeLockOwner(lockPath, timings?.probeOwner).catch(() => "unverifiable");
|
|
1006
|
+
if (verdict === "dead") throw new MarkerLockContentionError(lockLocation?.contention === "sparseIndex" ? l10n.t("A previous VS Code window appears to have crashed while updating the sparse index. Delete '{0}' to recover.", lockPath) : l10n.t("A previous VS Code window appears to have crashed while updating Git maintenance settings. Delete '{0}' to recover.", lockPath), { cause: ex });
|
|
1007
|
+
if (lockLocation?.contention === "sparseIndex" && verdict === "alive") throw new MarkerLockContentionError(l10n.t("A sparse-index update is still in progress. Wait for it to finish and try again."), { cause: ex });
|
|
1008
|
+
throw new MarkerLockContentionError(lockLocation?.contention === "sparseIndex" ? l10n.t("Could not verify whether another window is still updating the sparse index. If no update is in progress, delete '{0}' and try again.", lockPath) : l10n.t("Another window is currently updating Git maintenance settings. If no other VS Code window is using this repository, delete '{0}' and try again.", lockPath), { cause: ex });
|
|
1009
|
+
}
|
|
1010
|
+
await new Promise((resolve) => setTimeout(resolve, retryMs));
|
|
1011
|
+
}
|
|
1012
|
+
const lockHandle = handle;
|
|
1013
|
+
const ownerId = randomUUID();
|
|
1014
|
+
let ino;
|
|
1015
|
+
try {
|
|
1016
|
+
await (timings?.writeRecord ?? (async (h) => {
|
|
1017
|
+
await h.writeFile(JSON.stringify({
|
|
1018
|
+
host: hostname(),
|
|
1019
|
+
pid: process.pid,
|
|
1020
|
+
ownerId
|
|
1021
|
+
}));
|
|
1022
|
+
}))(lockHandle);
|
|
1023
|
+
ino = (await lockHandle.stat()).ino;
|
|
1024
|
+
} catch (ex) {
|
|
1025
|
+
const ourStat = await lockHandle.stat().catch(() => void 0);
|
|
1026
|
+
await lockHandle.close().catch(() => {});
|
|
1027
|
+
const pathStat = await stat(lockPath).catch(() => void 0);
|
|
1028
|
+
if (ourStat != null && ourStat.ino === pathStat?.ino) await rm(lockPath, { force: true }).catch(() => {});
|
|
1029
|
+
throw new Error(l10n.t("Could not acquire the Git maintenance settings lock at '{0}'. If this persists and no other VS Code window is using this repository, delete that file and try again.", lockPath), { cause: ex });
|
|
1030
|
+
}
|
|
1031
|
+
try {
|
|
1032
|
+
return await fn();
|
|
1033
|
+
} finally {
|
|
1034
|
+
await lockHandle.close().catch(() => {});
|
|
1035
|
+
const currentOwner = await readFile(lockPath, "utf8").then((raw) => raw ? JSON.parse(raw) : void 0).catch(() => void 0);
|
|
1036
|
+
const current = await stat(lockPath).catch(() => void 0);
|
|
1037
|
+
if (currentOwner?.ownerId === ownerId && current?.ino === ino) await rm(lockPath, { force: true }).catch(() => {});
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Diagnoses the process recorded in `lockPath` for the give-up error's wording ONLY — see
|
|
1042
|
+
* `withMarkerLock`'s doc comment for why a verdict never causes an automatic steal. Returns 'dead' only when
|
|
1043
|
+
* the OS kill-probe returns `ESRCH`, 'alive' when it succeeds, and 'unverifiable' for unreadable/malformed
|
|
1044
|
+
* content, a lock recorded on another host, or a probe that fails with anything but `ESRCH`.
|
|
1045
|
+
*/
|
|
1046
|
+
async probeLockOwner(lockPath, probeOwner) {
|
|
1047
|
+
const owner = await readFile(lockPath, "utf8").then((raw) => raw ? JSON.parse(raw) : void 0).catch(() => void 0);
|
|
1048
|
+
if (owner == null || typeof owner.host !== "string" || typeof owner.pid !== "number") return "unverifiable";
|
|
1049
|
+
if (probeOwner != null) return probeOwner({
|
|
1050
|
+
host: owner.host,
|
|
1051
|
+
pid: owner.pid
|
|
1052
|
+
});
|
|
1053
|
+
if (owner.host !== hostname()) return "unverifiable";
|
|
1054
|
+
try {
|
|
1055
|
+
process.kill(owner.pid, 0);
|
|
1056
|
+
return "alive";
|
|
1057
|
+
} catch (ex) {
|
|
1058
|
+
return ex.code === "ESRCH" ? "dead" : "unverifiable";
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Reverts a config lever GitLens applied: restores its recorded prior LOCAL value (set it back, or unset
|
|
1063
|
+
* when the prior was absent) and clears the marker. Returns `false` (a no-op) when no marker exists —
|
|
1064
|
+
* a lever the user enabled themselves is never touched.
|
|
1065
|
+
*/
|
|
1066
|
+
async revertConfigLever(repoPath, configKey, markerKey, cancellation) {
|
|
1067
|
+
return this.withMarkerLock(repoPath, async () => {
|
|
1068
|
+
const prior = await this.readGkMarkerUncached(repoPath, markerKey, cancellation);
|
|
1069
|
+
if (prior == null) return false;
|
|
1070
|
+
await this.restoreLocalConfig(repoPath, configKey, prior, cancellation);
|
|
1071
|
+
await this.provider.config.setGkConfig(repoPath, markerKey, void 0);
|
|
1072
|
+
return true;
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
/** Restores a lever's config to its recorded prior after a failed apply, then drops the ownership marker. */
|
|
1076
|
+
async restorePriorAndClear(repoPath, configKey, markerKey, cancellation) {
|
|
1077
|
+
const prior = await this.provider.config.getGkConfig(repoPath, markerKey);
|
|
1078
|
+
if (prior != null) await this.restoreLocalConfig(repoPath, configKey, prior, cancellation);
|
|
1079
|
+
await this.provider.config.setGkConfig(repoPath, markerKey, void 0);
|
|
1080
|
+
}
|
|
1081
|
+
/** Sets a local config value back to a recorded prior, decoding the `unset`/`empty` sentinels. */
|
|
1082
|
+
async restoreLocalConfig(repoPath, key, prior, cancellation) {
|
|
1083
|
+
if (prior === unsetConfigSentinel) await this.unsetLocalConfig(repoPath, key, cancellation);
|
|
1084
|
+
else if (prior === emptyConfigSentinel) await this.setLocalConfig(repoPath, key, "", cancellation);
|
|
1085
|
+
else await this.setLocalConfig(repoPath, key, prior, cancellation);
|
|
1086
|
+
}
|
|
1087
|
+
/** Writes a gk marker, swallowing+logging any failure — a marker write must never fail the apply itself. */
|
|
1088
|
+
async markGkConfigSafe(repoPath, key, value) {
|
|
1089
|
+
const scope = getScopedLogger();
|
|
1090
|
+
try {
|
|
1091
|
+
await this.provider.config.setGkConfig(repoPath, key, value);
|
|
1092
|
+
} catch (ex) {
|
|
1093
|
+
scope?.error(ex, `Failed to record '${key}' marker`);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Throws when a run that swallowed its errors (`errors: 'ignore'`) was actually cancelled or never ran.
|
|
1098
|
+
* Such a run resolves with no meaningful exit code, so `completion` — not `exitCode` — is the only thing
|
|
1099
|
+
* that proves a command ran. Without this a timeout reads as a clean success, and a safety probe or an
|
|
1100
|
+
* undo would act on a command that never happened.
|
|
1101
|
+
*/
|
|
1102
|
+
throwIfDidNotComplete(result, cancellation) {
|
|
1103
|
+
if (result.completion.status === "cancelled" || cancellation?.aborted === true) throw new CancellationError();
|
|
1104
|
+
if (result.completion.status === "failed") throw new Error(l10n.t("Git command did not run"));
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Reads a config key's LOCAL-scope value (independent of global/system config). `undefined` when unset.
|
|
1108
|
+
*
|
|
1109
|
+
* Uses `--get-regex` (anchored to the exact key), not `--get`: `--get` exits 0 with EMPTY stdout for
|
|
1110
|
+
* BOTH a bareword entry (`[section]\n\tkey`, valid syntax, git-boolean TRUE) and an explicit empty value
|
|
1111
|
+
* (`key =`, git-boolean FALSE) — indistinguishable, which would record a bareword-true prior as the
|
|
1112
|
+
* `unset` sentinel and let undo flip the user's true to false. `--get-regex` prints the two differently
|
|
1113
|
+
* (a bareword line has no space; an empty value keeps a trailing one), which `parseConfigRegexOutput`'s
|
|
1114
|
+
* `includeValueless` tells apart; for a multi-valued key it also prints every value in file order, so the
|
|
1115
|
+
* LAST line in the map is still the `--get`-equivalent value.
|
|
1116
|
+
*/
|
|
1117
|
+
async getLocalConfig(repoPath, key, cancellation) {
|
|
1118
|
+
const result = await this.git.run({
|
|
1119
|
+
cwd: repoPath,
|
|
1120
|
+
errors: "ignore",
|
|
1121
|
+
runLocally: true,
|
|
1122
|
+
cancellation,
|
|
1123
|
+
selfMaintenance: true
|
|
1124
|
+
}, "config", "--local", "--get-regex", `^${escapeRegex(key)}$`);
|
|
1125
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
1126
|
+
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) throw new Error(l10n.t("Unable to read '{0}' (git exited {1})", key, String(result.exitCode)));
|
|
1127
|
+
if (result.exitCode !== 0) return void 0;
|
|
1128
|
+
return parseConfigRegexOutput(result.stdout, { includeValueless: true }).get(canonicalizeGitConfigKey(key));
|
|
1129
|
+
}
|
|
1130
|
+
/** Sets a LOCAL config value. Throws the git error on a genuine write failure (config refused). */
|
|
1131
|
+
async setLocalConfig(repoPath, key, value, cancellation) {
|
|
1132
|
+
await this.git.run({
|
|
1133
|
+
cwd: repoPath,
|
|
1134
|
+
errors: "throw",
|
|
1135
|
+
runLocally: true,
|
|
1136
|
+
cancellation,
|
|
1137
|
+
selfMaintenance: true
|
|
1138
|
+
}, "config", "--local", key, value);
|
|
1139
|
+
this.cache.deleteConfig(repoPath, key);
|
|
1140
|
+
}
|
|
1141
|
+
async unsetLocalConfig(repoPath, key, cancellation) {
|
|
1142
|
+
const result = await this.git.run({
|
|
1143
|
+
cwd: repoPath,
|
|
1144
|
+
errors: "ignore",
|
|
1145
|
+
runLocally: true,
|
|
1146
|
+
cancellation,
|
|
1147
|
+
selfMaintenance: true
|
|
1148
|
+
}, "config", "--local", "--unset-all", key);
|
|
1149
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
1150
|
+
if (result.exitCode !== 0 && result.exitCode !== gitConfigUnsetMissingExitCode) throw new Error(l10n.t("Unable to unset '{0}' (git exited {1})", key, String(result.exitCode)));
|
|
1151
|
+
this.cache.deleteConfig(repoPath, key);
|
|
1152
|
+
}
|
|
1153
|
+
/** Best-effort run; returns the result so callers that must distinguish "didn't run" can check it. */
|
|
1154
|
+
async runQuietly(repoPath, cancellation, ...args) {
|
|
1155
|
+
return this.git.run({
|
|
1156
|
+
cwd: repoPath,
|
|
1157
|
+
errors: "ignore",
|
|
1158
|
+
priority: "background",
|
|
1159
|
+
cancellation,
|
|
1160
|
+
selfMaintenance: true
|
|
1161
|
+
}, ...args);
|
|
1162
|
+
}
|
|
1163
|
+
async probeConfig(repoPath, cancellation) {
|
|
1164
|
+
const result = await this.runQuietly(repoPath, cancellation, "config", "--get-regex", "^(core\\.fsmonitor|core\\.untrackedcache|core\\.commitgraph|core\\.multipackindex|core\\.sparsecheckout|core\\.sparsecheckoutcone|core\\.splitindex|extensions\\.refstorage|feature\\.manyfiles|index\\.sparse|maintenance\\.incremental-repack\\.auto)$");
|
|
1165
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
1166
|
+
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) throw new Error(l10n.t("Unable to read git config (git exited {0})", String(result.exitCode)));
|
|
1167
|
+
const map = parseConfigRegexOutput(result.stdout, { includeValueless: true });
|
|
1168
|
+
const incrementalRepackAuto = map.get("maintenance.incremental-repack.auto");
|
|
1169
|
+
const incrementalRepackAutoThreshold = incrementalRepackAuto == null ? defaultIncrementalRepackAutoThreshold : parseGitInteger(incrementalRepackAuto);
|
|
1170
|
+
const multiPackIndex = map.get("core.multipackindex");
|
|
1171
|
+
const multiPackIndexEnabled = multiPackIndex == null ? true : isGitBooleanFalse(multiPackIndex) ? false : parseGitBoolean(multiPackIndex) ? true : void 0;
|
|
1172
|
+
return {
|
|
1173
|
+
fsmonitor: isFsmonitorEnabled(map.get("core.fsmonitor")),
|
|
1174
|
+
untrackedCache: parseGitBoolean(map.get("core.untrackedcache")),
|
|
1175
|
+
untrackedCacheConfigured: map.has("core.untrackedcache"),
|
|
1176
|
+
manyFiles: parseGitBoolean(map.get("feature.manyfiles")),
|
|
1177
|
+
commitGraphReadDisabled: map.has("core.commitgraph") && isGitBooleanFalse(map.get("core.commitgraph") ?? ""),
|
|
1178
|
+
multiPackIndexEnabled,
|
|
1179
|
+
incrementalRepackAutoThreshold,
|
|
1180
|
+
refFormat: map.get("extensions.refstorage") == null ? "files" : map.get("extensions.refstorage") === "reftable" ? "reftable" : "unknown",
|
|
1181
|
+
sparseCheckout: parseGitBoolean(map.get("core.sparsecheckout")),
|
|
1182
|
+
sparseCheckoutCone: parseGitBoolean(map.get("core.sparsecheckoutcone")),
|
|
1183
|
+
sparseIndex: parseGitBoolean(map.get("index.sparse")),
|
|
1184
|
+
splitIndex: parseGitBoolean(map.get("core.splitindex"))
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
_registeredMaintenanceRepos;
|
|
1188
|
+
/** The global `maintenance.repo` list. Throws rather than reporting an unreadable list as "none". */
|
|
1189
|
+
async readRegisteredMaintenancePaths(repoPath, cancellation) {
|
|
1190
|
+
const cached = this._registeredMaintenanceRepos;
|
|
1191
|
+
if (cached != null && Date.now() - cached.at <= registeredMaintenanceReposTtlMs) return cached.paths;
|
|
1192
|
+
const result = await this.runQuietly(repoPath, cancellation, "config", "--global", "--get-all", "maintenance.repo");
|
|
1193
|
+
this.throwIfDidNotComplete(result, cancellation);
|
|
1194
|
+
if (result.exitCode !== 0 && result.exitCode !== gitConfigGetMissingExitCode) throw new Error(l10n.t("Unable to read registered maintenance repos (git exited {0})", String(result.exitCode)));
|
|
1195
|
+
const paths = result.stdout.split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
1196
|
+
this._registeredMaintenanceRepos = {
|
|
1197
|
+
at: Date.now(),
|
|
1198
|
+
paths
|
|
1199
|
+
};
|
|
1200
|
+
return paths;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* `git maintenance register` stores the symlink-RESOLVED worktree path, while GitLens deliberately keeps
|
|
1204
|
+
* the symlinked path as the repo path — so match against both spellings.
|
|
1205
|
+
*/
|
|
1206
|
+
async matchesRegistered(registered, paths) {
|
|
1207
|
+
if (!registered.length) return false;
|
|
1208
|
+
const candidates = await this.resolveRegistrationCandidates(paths);
|
|
1209
|
+
for (const line of registered) for (const candidate of candidates) if (arePathsEqual(line, candidate)) return true;
|
|
1210
|
+
return false;
|
|
1211
|
+
}
|
|
1212
|
+
/** Each path plus its symlink-resolved spelling — `maintenance register` stores the resolved one. */
|
|
1213
|
+
async resolveRegistrationCandidates(paths) {
|
|
1214
|
+
const candidates = new Set(paths);
|
|
1215
|
+
for (const path of paths) {
|
|
1216
|
+
const real = await realpath(path).catch(() => void 0);
|
|
1217
|
+
if (real != null) candidates.add(real);
|
|
1218
|
+
}
|
|
1219
|
+
return [...candidates];
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Whether ANY worktree of this repo family is registered — the DETECTION question ("should we suggest
|
|
1223
|
+
* this?"). Family-wide, because a sibling the user registered already covers the shared object database,
|
|
1224
|
+
* and suggesting it again would leave two scheduled entries for one repo.
|
|
1225
|
+
*/
|
|
1226
|
+
async isMaintenanceRegistered(repoPath, cancellation) {
|
|
1227
|
+
const registered = await this.readRegisteredMaintenancePaths(repoPath, cancellation);
|
|
1228
|
+
return this.matchesRegistered(registered, await this.resolveWorktreePaths(repoPath, cancellation));
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Whether ONE specific path is registered — the OWNERSHIP question ("did our unregister take?"). Never
|
|
1232
|
+
* ask this family-wide: a sibling the user registered is theirs, and it would block undo forever.
|
|
1233
|
+
*/
|
|
1234
|
+
async isPathRegistered(repoPath, path, cancellation) {
|
|
1235
|
+
const registered = await this.readRegisteredMaintenancePaths(repoPath, cancellation);
|
|
1236
|
+
return this.matchesRegistered(registered, [path]);
|
|
1237
|
+
}
|
|
1238
|
+
_worktreePaths = /* @__PURE__ */ new Map();
|
|
1239
|
+
/**
|
|
1240
|
+
* Every worktree path of this repo, MAIN FIRST — git's `worktree list` order, which holds regardless of
|
|
1241
|
+
* which worktree it runs from, and lists the repo itself for a bare one.
|
|
1242
|
+
*
|
|
1243
|
+
* `git maintenance register` records the CURRENT worktree's path, so a repo family can accumulate
|
|
1244
|
+
* several `maintenance.repo` entries — several scheduled runs over a single shared object database —
|
|
1245
|
+
* while the `gk.applied.*` ownership marker lives in the shared common git dir and can only describe
|
|
1246
|
+
* one of them. GitLens therefore REGISTERS the main worktree ({@link resolveMaintenanceRepoPath}) but
|
|
1247
|
+
* DETECTS across the whole family, so a registration the user made from a sibling isn't missed.
|
|
1248
|
+
*/
|
|
1249
|
+
async resolveWorktreePaths(repoPath, cancellation) {
|
|
1250
|
+
const cacheKey = this.cache.getCommonPath(repoPath);
|
|
1251
|
+
const cached = this._worktreePaths.get(cacheKey);
|
|
1252
|
+
if (cached != null && Date.now() - cached.at <= worktreePathsTtlMs) return cached.paths;
|
|
1253
|
+
const result = await this.runQuietly(repoPath, cancellation, "worktree", "list", "--porcelain");
|
|
1254
|
+
if (result.completion.status !== "exited" || result.exitCode !== 0 || cancellation?.aborted === true) return [repoPath];
|
|
1255
|
+
const paths = result.stdout.split("\n").filter((l) => l.startsWith("worktree ")).map((l) => l.slice(9).trim()).filter((l) => l !== "");
|
|
1256
|
+
if (!paths.length) return [repoPath];
|
|
1257
|
+
this._worktreePaths.set(cacheKey, {
|
|
1258
|
+
at: Date.now(),
|
|
1259
|
+
paths
|
|
1260
|
+
});
|
|
1261
|
+
return paths;
|
|
1262
|
+
}
|
|
1263
|
+
/** The path GitLens registers for background maintenance: the repo's MAIN worktree. */
|
|
1264
|
+
async resolveMaintenanceRepoPath(repoPath, cancellation) {
|
|
1265
|
+
return (await this.resolveWorktreePaths(repoPath, cancellation))[0];
|
|
1266
|
+
}
|
|
1267
|
+
async probeCommitGraph(objectsDir) {
|
|
1268
|
+
const infoDir = joinPaths(objectsDir, "info");
|
|
1269
|
+
const [single, split] = await Promise.allSettled([this.statMtime(joinPaths(infoDir, "commit-graph")), this.statMtime(joinPaths(infoDir, "commit-graphs"))]);
|
|
1270
|
+
const mtime = getSettledValue(single) ?? getSettledValue(split);
|
|
1271
|
+
return {
|
|
1272
|
+
present: mtime != null,
|
|
1273
|
+
mtime
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Whether the NEWEST commit-graph layer carries changed-path Bloom filters (the `BIDX` chunk). Only the
|
|
1278
|
+
* newest layer matters here — `--changed-paths` computes filters for the just-written batch, so an older
|
|
1279
|
+
* base layer written without them says nothing about current coverage. Reads only the header + chunk
|
|
1280
|
+
* lookup table (a handful of bytes), never the graph body. Never throws — any failure (missing file, a
|
|
1281
|
+
* malformed chain, a truncated read) reads as "no filters", matching every other probe in this file.
|
|
1282
|
+
*/
|
|
1283
|
+
async probeChangedPathFilters(objectsDir) {
|
|
1284
|
+
try {
|
|
1285
|
+
const infoDir = joinPaths(objectsDir, "info");
|
|
1286
|
+
const graphPath = await this.resolveNewestCommitGraphLayer(infoDir);
|
|
1287
|
+
return await this.hasBloomFilterChunk(graphPath);
|
|
1288
|
+
} catch {
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
/** The newest graph layer's file path: the chain's last-listed layer when split, else the single file. */
|
|
1293
|
+
async resolveNewestCommitGraphLayer(infoDir) {
|
|
1294
|
+
const chainPath = joinPaths(infoDir, "commit-graphs", "commit-graph-chain");
|
|
1295
|
+
try {
|
|
1296
|
+
const hashes = (await readFile(chainPath, "utf8")).split("\n").map((line) => line.trim()).filter((line) => line !== "");
|
|
1297
|
+
if (hashes.length) return joinPaths(infoDir, "commit-graphs", `graph-${hashes.at(-1)}.graph`);
|
|
1298
|
+
} catch {}
|
|
1299
|
+
return joinPaths(infoDir, "commit-graph");
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Reads a commit-graph file's fixed 8-byte header (`CGPH` magic, version, hash version, chunk count,
|
|
1303
|
+
* base-graph count) plus the chunk lookup table (`(chunkCount + 1)` entries of 4-byte id + 8-byte
|
|
1304
|
+
* big-endian offset), and reports whether a `BIDX` (Bloom-filter-index) chunk id is present. Bounded to
|
|
1305
|
+
* the header + table only — never reads the graph body.
|
|
1306
|
+
*/
|
|
1307
|
+
async hasBloomFilterChunk(graphPath) {
|
|
1308
|
+
let handle;
|
|
1309
|
+
try {
|
|
1310
|
+
handle = await open(graphPath, "r");
|
|
1311
|
+
const header = Buffer.alloc(8);
|
|
1312
|
+
const { bytesRead: headerBytesRead } = await handle.read(header, 0, 8, 0);
|
|
1313
|
+
if (headerBytesRead < 8 || header.toString("ascii", 0, 4) !== "CGPH") return false;
|
|
1314
|
+
const chunkCount = header.readUInt8(6);
|
|
1315
|
+
const tableLength = (chunkCount + 1) * 12;
|
|
1316
|
+
const table = Buffer.alloc(tableLength);
|
|
1317
|
+
const { bytesRead: tableBytesRead } = await handle.read(table, 0, tableLength, 8);
|
|
1318
|
+
if (tableBytesRead < tableLength) return false;
|
|
1319
|
+
for (let i = 0; i <= chunkCount; i++) {
|
|
1320
|
+
const offset = i * 12;
|
|
1321
|
+
if (table.toString("ascii", offset, offset + 4) === "BIDX") return true;
|
|
1322
|
+
}
|
|
1323
|
+
return false;
|
|
1324
|
+
} finally {
|
|
1325
|
+
await handle?.close().catch(() => {});
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Reads the pack names represented by the active classic or incremental MIDX. A classic MIDX wins when
|
|
1330
|
+
* both layouts exist, matching Git's own lookup order. Malformed metadata is reported as unknown instead
|
|
1331
|
+
* of treating every pack as uncovered and silently launching repair work.
|
|
1332
|
+
*/
|
|
1333
|
+
async probeMultiPackIndex(packDir) {
|
|
1334
|
+
const classicPath = joinPaths(packDir, "multi-pack-index");
|
|
1335
|
+
try {
|
|
1336
|
+
return {
|
|
1337
|
+
present: true,
|
|
1338
|
+
packNames: await this.readMultiPackIndexPackNames(classicPath)
|
|
1339
|
+
};
|
|
1340
|
+
} catch (ex) {
|
|
1341
|
+
if (ex.code !== "ENOENT") return {
|
|
1342
|
+
present: true,
|
|
1343
|
+
packNames: void 0
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1346
|
+
const chainDir = joinPaths(packDir, "multi-pack-index.d");
|
|
1347
|
+
const chainPath = joinPaths(chainDir, "multi-pack-index-chain");
|
|
1348
|
+
let chain;
|
|
1349
|
+
try {
|
|
1350
|
+
if ((await stat(chainPath)).size > maxMultiPackIndexChainBytes) return {
|
|
1351
|
+
present: true,
|
|
1352
|
+
packNames: void 0
|
|
1353
|
+
};
|
|
1354
|
+
chain = await readFile(chainPath, "utf8");
|
|
1355
|
+
} catch (ex) {
|
|
1356
|
+
return ex.code === "ENOENT" ? {
|
|
1357
|
+
present: false,
|
|
1358
|
+
packNames: /* @__PURE__ */ new Set()
|
|
1359
|
+
} : {
|
|
1360
|
+
present: true,
|
|
1361
|
+
packNames: void 0
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
const hashes = chain.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
1365
|
+
if (hashes.length === 0 || hashes.some((hash) => !/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(hash))) return {
|
|
1366
|
+
present: true,
|
|
1367
|
+
packNames: void 0
|
|
1368
|
+
};
|
|
1369
|
+
const layers = await Promise.allSettled(hashes.map((hash) => this.readMultiPackIndexPackNames(joinPaths(chainDir, `multi-pack-index-${hash}.midx`))));
|
|
1370
|
+
if (layers.some((layer) => layer.status === "rejected")) return {
|
|
1371
|
+
present: true,
|
|
1372
|
+
packNames: void 0
|
|
1373
|
+
};
|
|
1374
|
+
const packNames = /* @__PURE__ */ new Set();
|
|
1375
|
+
for (const layer of layers) {
|
|
1376
|
+
if (layer.status !== "fulfilled") continue;
|
|
1377
|
+
for (const name of layer.value) packNames.add(name);
|
|
1378
|
+
}
|
|
1379
|
+
return {
|
|
1380
|
+
present: true,
|
|
1381
|
+
packNames
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
/** Reads and validates the `PNAM` chunk of one MIDX file. */
|
|
1385
|
+
async readMultiPackIndexPackNames(path) {
|
|
1386
|
+
let handle;
|
|
1387
|
+
try {
|
|
1388
|
+
handle = await open(path, "r");
|
|
1389
|
+
const header = Buffer.alloc(12);
|
|
1390
|
+
const { bytesRead } = await handle.read(header, 0, header.length, 0);
|
|
1391
|
+
if (bytesRead < header.length || header.toString("ascii", 0, 4) !== "MIDX") throw new Error(l10n.t("Invalid multi-pack-index header"));
|
|
1392
|
+
const chunkCount = header.readUInt8(6);
|
|
1393
|
+
const expectedPackCount = header.readUInt32BE(8);
|
|
1394
|
+
const tableLength = (chunkCount + 1) * 12;
|
|
1395
|
+
const table = Buffer.alloc(tableLength);
|
|
1396
|
+
const { bytesRead: tableBytesRead } = await handle.read(table, 0, tableLength, header.length);
|
|
1397
|
+
if (tableBytesRead < tableLength) throw new Error(l10n.t("Invalid multi-pack-index chunk table"));
|
|
1398
|
+
let namesStart;
|
|
1399
|
+
const chunkOffsets = [];
|
|
1400
|
+
for (let i = 0; i <= chunkCount; i++) {
|
|
1401
|
+
const offset = i * 12;
|
|
1402
|
+
const chunkOffset = Number(table.readBigUInt64BE(offset + 4));
|
|
1403
|
+
if (!Number.isSafeInteger(chunkOffset)) throw new Error(l10n.t("Invalid multi-pack-index chunk offset"));
|
|
1404
|
+
chunkOffsets.push(chunkOffset);
|
|
1405
|
+
if (table.toString("ascii", offset, offset + 4) === "PNAM") namesStart = chunkOffset;
|
|
1406
|
+
}
|
|
1407
|
+
if (namesStart == null) throw new Error(l10n.t("Multi-pack-index is missing its pack-name chunk"));
|
|
1408
|
+
const namesEnd = Math.min(...chunkOffsets.filter((offset) => offset > namesStart));
|
|
1409
|
+
const namesLength = namesEnd - namesStart;
|
|
1410
|
+
if (!Number.isSafeInteger(namesEnd) || namesLength < 0 || namesLength > maxMultiPackIndexChunkBytes) throw new Error(l10n.t("Invalid multi-pack-index pack-name chunk"));
|
|
1411
|
+
const namesChunk = Buffer.alloc(namesLength);
|
|
1412
|
+
const { bytesRead: namesBytesRead } = await handle.read(namesChunk, 0, namesLength, namesStart);
|
|
1413
|
+
if (namesBytesRead < namesLength) throw new Error(l10n.t("Short multi-pack-index pack-name chunk"));
|
|
1414
|
+
const names = namesChunk.toString("utf8").split("\0").filter((name) => /^pack-(?:[0-9a-f]{40}|[0-9a-f]{64})\.idx$/.test(name)).map((name) => `${name.slice(0, -4)}.pack`);
|
|
1415
|
+
if (names.length !== expectedPackCount || new Set(names).size !== names.length) throw new Error(l10n.t("Multi-pack-index pack-name count does not match its header"));
|
|
1416
|
+
return new Set(names);
|
|
1417
|
+
} finally {
|
|
1418
|
+
await handle?.close().catch(() => {});
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
async probePacks(objectsDir) {
|
|
1422
|
+
const packDir = joinPaths(objectsDir, "pack");
|
|
1423
|
+
let entries;
|
|
1424
|
+
try {
|
|
1425
|
+
entries = await readdir(packDir);
|
|
1426
|
+
} catch (ex) {
|
|
1427
|
+
if (ex.code === "ENOENT") return {
|
|
1428
|
+
names: [],
|
|
1429
|
+
bytes: 0
|
|
1430
|
+
};
|
|
1431
|
+
throw ex;
|
|
1432
|
+
}
|
|
1433
|
+
const packFiles = entries.filter((name) => name.endsWith(".pack"));
|
|
1434
|
+
return {
|
|
1435
|
+
names: packFiles,
|
|
1436
|
+
bytes: (await Promise.allSettled(packFiles.map((name) => this.fileBytes(joinPaths(packDir, name))))).reduce((sum, r) => sum + (getSettledValue(r) ?? 0), 0)
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
async sampleLooseObjects(objectsDir) {
|
|
1440
|
+
return {
|
|
1441
|
+
objectsInSampledDirs: (await Promise.allSettled(looseObjectSampleDirs.map(async (dir) => {
|
|
1442
|
+
try {
|
|
1443
|
+
return (await readdir(joinPaths(objectsDir, dir))).length;
|
|
1444
|
+
} catch {
|
|
1445
|
+
return 0;
|
|
1446
|
+
}
|
|
1447
|
+
}))).reduce((sum, r) => sum + (getSettledValue(r) ?? 0), 0),
|
|
1448
|
+
dirsSampled: looseObjectSampleDirs.length
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
/**
|
|
1452
|
+
* Counts loose refs without traversing past the point where the recommendation decision is already made.
|
|
1453
|
+
* `readDirectory` is a test seam for deterministic ref-layout races between parent and child reads.
|
|
1454
|
+
*/
|
|
1455
|
+
async probeLooseRefs(refsDir, readDirectory = (dir) => readdir(dir, { withFileTypes: true })) {
|
|
1456
|
+
const pending = [refsDir];
|
|
1457
|
+
let count = 0;
|
|
1458
|
+
while (pending.length !== 0) {
|
|
1459
|
+
const dir = pending.pop();
|
|
1460
|
+
let entries;
|
|
1461
|
+
try {
|
|
1462
|
+
entries = await readDirectory(dir);
|
|
1463
|
+
} catch (ex) {
|
|
1464
|
+
const code = ex.code;
|
|
1465
|
+
if (code === "ENOENT" || dir !== refsDir && code === "ENOTDIR") {
|
|
1466
|
+
if (dir === refsDir) return {
|
|
1467
|
+
count: 0,
|
|
1468
|
+
exact: true
|
|
1469
|
+
};
|
|
1470
|
+
continue;
|
|
1471
|
+
}
|
|
1472
|
+
throw ex;
|
|
1473
|
+
}
|
|
1474
|
+
for (const entry of entries) {
|
|
1475
|
+
if (entry.isDirectory()) {
|
|
1476
|
+
pending.push(joinPaths(dir, entry.name));
|
|
1477
|
+
continue;
|
|
1478
|
+
}
|
|
1479
|
+
if (entry.name.endsWith(".lock")) continue;
|
|
1480
|
+
count++;
|
|
1481
|
+
if (count >= looseRefProbeLimit) return {
|
|
1482
|
+
count,
|
|
1483
|
+
exact: false
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
return {
|
|
1488
|
+
count,
|
|
1489
|
+
exact: true
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
async statMtime(path) {
|
|
1493
|
+
try {
|
|
1494
|
+
return (await stat(path)).mtimeMs;
|
|
1495
|
+
} catch {
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
/** Presence probe that distinguishes a missing path from an unreadable one. */
|
|
1500
|
+
async probePathPresence(path) {
|
|
1501
|
+
try {
|
|
1502
|
+
await stat(path);
|
|
1503
|
+
return true;
|
|
1504
|
+
} catch (ex) {
|
|
1505
|
+
if (ex.code === "ENOENT") return false;
|
|
1506
|
+
throw ex;
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
async fileBytes(path) {
|
|
1510
|
+
try {
|
|
1511
|
+
return (await stat(path)).size;
|
|
1512
|
+
} catch {
|
|
1513
|
+
return 0;
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* Reads the index entry count straight from the index header — `DIRC` signature, version, entry count,
|
|
1518
|
+
* all big-endian, the first 12 bytes of `.git/index` — for free, no `git` invocation needed.
|
|
1519
|
+
* `undefined` on any failure (missing index, short read, wrong signature): never a guess, never a throw.
|
|
1520
|
+
*/
|
|
1521
|
+
async probeIndexEntryCount(indexPath) {
|
|
1522
|
+
let handle;
|
|
1523
|
+
try {
|
|
1524
|
+
handle = await open(indexPath, "r");
|
|
1525
|
+
const header = Buffer.alloc(12);
|
|
1526
|
+
const { bytesRead } = await handle.read(header, 0, 12, 0);
|
|
1527
|
+
if (bytesRead < 12 || header.toString("ascii", 0, 4) !== "DIRC") return void 0;
|
|
1528
|
+
return header.readUInt32BE(8);
|
|
1529
|
+
} catch {
|
|
1530
|
+
return;
|
|
1531
|
+
} finally {
|
|
1532
|
+
await handle?.close().catch(() => {});
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
/**
|
|
1536
|
+
* Conservative split-index detection without spawning git or scanning index bodies. A shared-index file
|
|
1537
|
+
* proves this worktree uses split indexes; its largest base file is included in the byte-size proxy. Stale
|
|
1538
|
+
* bases can only make that explicitly-approximate signal larger.
|
|
1539
|
+
*/
|
|
1540
|
+
async probeSharedIndex(gitDir) {
|
|
1541
|
+
try {
|
|
1542
|
+
const names = (await readdir(gitDir)).filter((name) => name.startsWith("sharedindex."));
|
|
1543
|
+
const sizes = await Promise.all(names.map((name) => this.fileBytes(joinPaths(gitDir, name))));
|
|
1544
|
+
return {
|
|
1545
|
+
present: names.length > 0,
|
|
1546
|
+
bytes: Math.max(0, ...sizes)
|
|
1547
|
+
};
|
|
1548
|
+
} catch {
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
/**
|
|
1553
|
+
* Conflict stages duplicate paths in the header count. Operation-state files conservatively suppress the
|
|
1554
|
+
* exact claim without an unconditional `ls-files --unmerged` index scan on every staging event.
|
|
1555
|
+
*/
|
|
1556
|
+
async probeConflictOperation(gitDir) {
|
|
1557
|
+
return (await Promise.all([
|
|
1558
|
+
fsExists(joinPaths(gitDir, "MERGE_HEAD")),
|
|
1559
|
+
fsExists(joinPaths(gitDir, "CHERRY_PICK_HEAD")),
|
|
1560
|
+
fsExists(joinPaths(gitDir, "REVERT_HEAD")),
|
|
1561
|
+
fsExists(joinPaths(gitDir, "rebase-merge")),
|
|
1562
|
+
fsExists(joinPaths(gitDir, "rebase-apply"))
|
|
1563
|
+
])).some(Boolean);
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "getHealthSnapshot", null);
|
|
1567
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "getHealthDetails", null);
|
|
1568
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "getCapabilities", null);
|
|
1569
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "runMaintenanceTask", null);
|
|
1570
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "applyOptimization", null);
|
|
1571
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "revertOptimization", null);
|
|
1572
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "setCommitGraphDisabled", null);
|
|
1573
|
+
__decorate([debug()], MaintenanceGitSubProvider.prototype, "claimMaintenancePass", null);
|
|
1574
|
+
//#endregion
|
|
1575
|
+
export { MaintenanceGitSubProvider };
|
|
1576
|
+
|
|
2129
1577
|
//# sourceMappingURL=maintenance.js.map
|