@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,1866 +1,1418 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
env.stack.push({ async: true });
|
|
26
|
-
}
|
|
27
|
-
return value;
|
|
28
|
-
};
|
|
29
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
30
|
-
return function (env) {
|
|
31
|
-
function fail(e) {
|
|
32
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
33
|
-
env.hasError = true;
|
|
34
|
-
}
|
|
35
|
-
var r, s = 0;
|
|
36
|
-
function next() {
|
|
37
|
-
while (r = env.stack.pop()) {
|
|
38
|
-
try {
|
|
39
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
40
|
-
if (r.dispose) {
|
|
41
|
-
var result = r.dispose.call(r.value);
|
|
42
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
43
|
-
}
|
|
44
|
-
else s |= 1;
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
fail(e);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
51
|
-
if (env.hasError) throw env.error;
|
|
52
|
-
}
|
|
53
|
-
return next();
|
|
54
|
-
};
|
|
55
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
56
|
-
var e = new Error(message);
|
|
57
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
58
|
-
});
|
|
59
|
-
import { GitSearchError } from '../../git/errors.js';
|
|
60
|
-
import { getBranchId, getBranchNameWithoutRemote, getRemoteNameFromBranchName, } from '../../git/utils/branch.utils.js';
|
|
61
|
-
import { appendRowsAtCursor, mergeAvatarsForward } from '../../git/utils/graph.utils.js';
|
|
62
|
-
import { computeGraphRowContextFlags, createReachabilityTableBuilder } from '../../git/utils/reachability.utils.js';
|
|
63
|
-
import { isUncommitted } from '../../git/utils/revision.utils.js';
|
|
64
|
-
import { getSearchQueryComparisonKey, parseSearchQueryGitCommand } from '../../git/utils/search.utils.js';
|
|
65
|
-
import { getTagId } from '../../git/utils/tag.utils.js';
|
|
66
|
-
import { isUserMatch } from '../../git/utils/user.utils.js';
|
|
67
|
-
import { getWorktreeId, groupWorktreesByBranch } from '../../git/utils/worktree.utils.js';
|
|
68
|
-
import { isCancellationError } from '../../utils/cancellation.js';
|
|
69
|
-
import { debug } from '../../utils/decorators/log.js';
|
|
70
|
-
import { createDisposable } from '../../utils/disposable.js';
|
|
71
|
-
import { fnv1aHash64 } from '../../utils/hash.js';
|
|
72
|
-
import { find, first, join, last } from '../../utils/iterable.js';
|
|
73
|
-
import { getScopedLogger } from '../../utils/logger.scoped.js';
|
|
74
|
-
import { getSettledValue } from '../../utils/promise.js';
|
|
75
|
-
import { classifySearchError, gitConfigsLog } from '../exec/git.js';
|
|
76
|
-
import { getGraphParser, getShaAndDatesLogParser, getShaAndDatesWithFilesLogParser, getShaAndStatsLogParser, getShaLogParser, } from '../parsers/logParser.js';
|
|
77
|
-
import { convertStashesToStdin } from './stash.js';
|
|
78
|
-
const progressiveSearchResultsBatchTimeMs = 500; // Send updates every 500ms (2 updates/second)
|
|
1
|
+
import { find, first, join, last } from "../../utils/iterable.js";
|
|
2
|
+
import { CancellationError, isCancellationError } from "../../utils/cancellation.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 { getBranchId, getBranchNameWithoutRemote, getRemoteNameFromBranchName } from "../../utils/gitRefs.js";
|
|
7
|
+
import { isUncommitted } from "../../git/utils/revision.utils.js";
|
|
8
|
+
import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
|
|
9
|
+
import { GitSearchError } from "../../git/errors.js";
|
|
10
|
+
import { createDisposable } from "../../utils/disposable.js";
|
|
11
|
+
import { classifySearchError, gitConfigsLog } from "../exec/git.js";
|
|
12
|
+
import { fnv1aHash64 } from "../../utils/hash.js";
|
|
13
|
+
import { isUserMatch } from "../../git/utils/user.utils.js";
|
|
14
|
+
import _usingCtx from "../../_virtual/@oxc-project+runtime/helpers/esm/usingCtx.js";
|
|
15
|
+
import { getSearchQueryComparisonKey, parseSearchQueryGitCommand } from "../../git/utils/search.utils.js";
|
|
16
|
+
import { getGraphParser, getShaAndDatesLogParser, getShaAndDatesWithFilesLogParser, getShaAndStatsLogParser, getShaLogParser } from "../parsers/logParser.js";
|
|
17
|
+
import { convertStashesToStdin } from "./stash.js";
|
|
18
|
+
import { GraphSessionWriteQueue } from "../../git/models/graphSession.js";
|
|
19
|
+
import { appendRowsAtCursor, mergeAvatarsForward, restampGraphRowIds } from "../../git/utils/graph.utils.js";
|
|
20
|
+
import { computeGraphRowContextFlags, createReachabilityTableBuilder } from "../../git/utils/reachability.utils.js";
|
|
21
|
+
import { getTagId } from "../../git/utils/tag.utils.js";
|
|
22
|
+
import { getWorktreeId, groupWorktreesByBranch } from "../../git/utils/worktree.utils.js";
|
|
23
|
+
//#region ../git-cli/src/providers/graph.ts
|
|
24
|
+
const progressiveSearchResultsBatchTimeMs = 500;
|
|
79
25
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
26
|
+
* Whether a ref participates in graph row decoration (a branch/remote/tag badge) and so must be diffed by
|
|
27
|
+
* the R6b tip gate. Excludes `refs/stash` (handled by the stash gate) and symbolic `…/HEAD` refs (they
|
|
28
|
+
* mirror another ref and produce no badge of their own).
|
|
29
|
+
*/
|
|
84
30
|
function isMoveableGraphRef(refname) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return refname.startsWith('refs/heads/') || refname.startsWith('refs/remotes/') || refname.startsWith('refs/tags/');
|
|
31
|
+
if (refname === "refs/stash" || refname === "HEAD" || refname.endsWith("/HEAD")) return false;
|
|
32
|
+
return refname.startsWith("refs/heads/") || refname.startsWith("refs/remotes/") || refname.startsWith("refs/tags/");
|
|
88
33
|
}
|
|
89
34
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
35
|
+
* Fingerprints the GLOBAL side inputs row construction embeds into row decorations — the default branch
|
|
36
|
+
* (and whether a local branch shadows it), HEAD's upstream, remote urls/providers, secondary-worktree
|
|
37
|
+
* assignments, and the current user. These can all change WITHOUT moving any ref tip (`git remote
|
|
38
|
+
* set-head`, remote/user config edits, `git worktree add`), and the R6b fast path reuses prior rows
|
|
39
|
+
* wholesale (only flags/reachability are re-derived) — so it compares this against the seed's and falls
|
|
40
|
+
* back to the full walk (which rebuilds every decoration) on ANY change. Deliberately EXCLUDES what other
|
|
41
|
+
* gates already own — ref existence/tips (tip gate), the default worktree's checkout (HEAD gate), and
|
|
42
|
+
* per-branch upstream mappings (checked row-by-row against the seed's embedded pills, so tracking-branch
|
|
43
|
+
* CREATES stay fast) — keeping the high-frequency events (commits, branch/tag creates, fetches,
|
|
44
|
+
* checkouts) on the fast path. Sorted so map/list iteration order can't produce spurious mismatches.
|
|
45
|
+
*/
|
|
101
46
|
function computeDecorationFingerprint(repoPath, defaultBranchName, defaultLocalName, headRefUpstreamName, branches, remotes, worktrees, currentUser) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
let defaultWorktreePath;
|
|
127
|
-
for (const w of worktrees) {
|
|
128
|
-
if (w.isDefault) {
|
|
129
|
-
defaultWorktreeBranch = w.branch?.name;
|
|
130
|
-
defaultWorktreePath = w.path;
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
// Only branch-attached SECONDARY worktrees decorate rows: bare/detached ones are excluded from
|
|
134
|
-
// `worktreesByBranch` (no pill). NOTE: `w.name` is deliberately avoided; it embeds the checked-out
|
|
135
|
-
// branch (and a detached sha), which would bust this on every checkout.
|
|
136
|
-
if (w.type !== 'branch')
|
|
137
|
-
continue;
|
|
138
|
-
parts.push(`w:${w.branch?.name ?? ''}|${w.path}`);
|
|
139
|
-
}
|
|
140
|
-
// The DEFAULT worktree's checkout flips `+checkedout` / the main-path worktree recovery on two branch
|
|
141
|
-
// pills. When the graph IS the default worktree, that's the ordinary HEAD move (the HEAD gate refetches
|
|
142
|
-
// both endpoint rows) — but a graph on a SECONDARY worktree sees no HEAD move when the MAIN worktree
|
|
143
|
-
// checks out, so the assignment must fingerprint there. (`w.path` for the default worktree equals the
|
|
144
|
-
// main repo path in this provider's normalization — pinned by a WorktreesSubProvider test.)
|
|
145
|
-
if (defaultWorktreePath != null && defaultWorktreePath !== repoPath) {
|
|
146
|
-
parts.push(`wd:${defaultWorktreeBranch ?? ''}`);
|
|
147
|
-
}
|
|
148
|
-
parts.sort();
|
|
149
|
-
return fnv1aHash64(parts.join('\x00'));
|
|
47
|
+
const localShadowsDefault = defaultLocalName != null && (branches?.some((b) => b.name === defaultLocalName) ?? false);
|
|
48
|
+
const parts = [
|
|
49
|
+
`d:${defaultBranchName ?? ""}|${localShadowsDefault ? "s" : ""}`,
|
|
50
|
+
`h:${headRefUpstreamName ?? ""}`,
|
|
51
|
+
`u:${currentUser?.name ?? ""}|${currentUser?.email ?? ""}`
|
|
52
|
+
];
|
|
53
|
+
if (branches != null) {
|
|
54
|
+
for (const b of branches) if (b.starred) parts.push(`s:${b.name}`);
|
|
55
|
+
}
|
|
56
|
+
if (remotes != null) for (const r of remotes) parts.push(`r:${r.name}|${r.url}|${r.provider?.gkProviderId ?? ""}`);
|
|
57
|
+
let defaultWorktreeBranch;
|
|
58
|
+
let defaultWorktreePath;
|
|
59
|
+
for (const w of worktrees) {
|
|
60
|
+
if (w.isDefault) {
|
|
61
|
+
defaultWorktreeBranch = w.branch?.name;
|
|
62
|
+
defaultWorktreePath = w.path;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (w.type !== "branch") continue;
|
|
66
|
+
parts.push(`w:${w.branch?.name ?? ""}|${w.path}`);
|
|
67
|
+
}
|
|
68
|
+
if (defaultWorktreePath != null && defaultWorktreePath !== repoPath) parts.push(`wd:${defaultWorktreeBranch ?? ""}`);
|
|
69
|
+
parts.sort();
|
|
70
|
+
return fnv1aHash64(parts.join("\0"));
|
|
150
71
|
}
|
|
151
72
|
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
73
|
+
* Whether the shared reachability TABLE changed between two refresh generations. The table is append-only
|
|
74
|
+
* within a generation (`id`), so a new `id` or a grown dictionary/sets length is an EXACT signal — a per-row
|
|
75
|
+
* index that re-points to an already-present set doesn't grow the table (that change rides the rows channel).
|
|
76
|
+
*/
|
|
156
77
|
function reachabilityTableChanged(prior, next) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return (prior.id !== next.id ||
|
|
160
|
-
prior.dictionary.length !== next.dictionary.length ||
|
|
161
|
-
prior.sets.length !== next.sets.length);
|
|
78
|
+
if (prior == null || next == null) return prior !== next;
|
|
79
|
+
return prior.id !== next.id || prior.dictionary.length !== next.dictionary.length || prior.sets.length !== next.sets.length;
|
|
162
80
|
}
|
|
163
81
|
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
82
|
+
* Whether the downstreams map (upstream name → tracking branch names) changed between two refresh
|
|
83
|
+
* generations. Order-sensitive on the arrays: a mere reorder reports "changed" and re-ships the full map,
|
|
84
|
+
* which is harmless — a false negative would silently drop a real upstream change, so err toward "changed".
|
|
85
|
+
*/
|
|
168
86
|
function downstreamsChanged(prior, next) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (priorNames[i] !== nextNames[i])
|
|
177
|
-
return true;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return false;
|
|
87
|
+
if (prior.size !== next.size) return true;
|
|
88
|
+
for (const [key, priorNames] of prior) {
|
|
89
|
+
const nextNames = next.get(key);
|
|
90
|
+
if (nextNames == null || nextNames.length !== priorNames.length) return true;
|
|
91
|
+
for (let i = 0; i < priorNames.length; i++) if (priorNames[i] !== nextNames[i]) return true;
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
181
94
|
}
|
|
182
95
|
/** The walk-shape key (`ordering|onlyFollowFirstParent`) an incremental seed is gated on — one builder so the
|
|
183
|
-
|
|
96
|
+
* refresh/rebuild sites can't drift in how they stringify it. */
|
|
184
97
|
function buildShapeKey(shape) {
|
|
185
|
-
|
|
98
|
+
return `${shape.ordering}|${shape.onlyFollowFirstParent}`;
|
|
186
99
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.context = context;
|
|
194
|
-
this.git = git;
|
|
195
|
-
this.cache = cache;
|
|
196
|
-
this.provider = provider;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Current ref tips (canonical refname → PEELED commit sha), for the R6b fast path's gate. Peeled so an
|
|
200
|
-
* annotated tag maps to the commit its badge sits on — the same convention {@link GraphIncrementalSeed.tips}
|
|
201
|
-
* uses — and so the seed↔current diff is by commit identity. Covers heads/remotes/tags/replace (all the
|
|
202
|
-
* namespaces the gate consumers read); the caller filters to the ref classes it cares about.
|
|
203
|
-
*/
|
|
204
|
-
async getCurrentRefTips(repoPath, cancellation) {
|
|
205
|
-
const tips = new Map();
|
|
206
|
-
try {
|
|
207
|
-
// `force: true` invalidates the shared refs cache so this spawns fresh (this gate needs a
|
|
208
|
-
// point-in-time read, not a possibly-stale cached one) while ALSO repopulating that cache —
|
|
209
|
-
// one `for-each-ref` serves both this gate and any sibling `getRefs`/`getBranches`/`getTags`
|
|
210
|
-
// call racing it (they attach to the same in-flight spawn).
|
|
211
|
-
const records = await this.provider.refs.getRefs(repoPath, cancellation, { force: true });
|
|
212
|
-
for (const record of records) {
|
|
213
|
-
if (!record.name)
|
|
214
|
-
continue;
|
|
215
|
-
// Peeled objectname is set only for annotated tags; everything else uses objectname.
|
|
216
|
-
tips.set(record.name, record.peeledObjectname || record.objectname);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
catch {
|
|
220
|
-
// Preserve the prelude's "never rejects" contract (see the bare `await` at the call site):
|
|
221
|
-
// a per-caller cancellation race through the shared cache (or any other failure) degrades
|
|
222
|
-
// to no tips, same as the direct `errors: 'ignore'` spawn this replaced.
|
|
223
|
-
}
|
|
224
|
-
return tips;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Whether the repo is a SHALLOW clone right now (a `$GIT_DIR/shallow` file exists). `git` resolves the git
|
|
228
|
-
* dir itself (correct in worktrees / bare / separate git-dirs), so this makes no `.git`-is-a-dir assumption.
|
|
229
|
-
* Returned as {@link GitGraph.shallow} and diffed by the R6b fast path's gate — an un-shallow (or re-shallow)
|
|
230
|
-
* while the graph was closed leaves every branch tip put yet changes what history exists below the window.
|
|
231
|
-
* Errors ignored → treated as NOT shallow: a git too old for `--is-shallow-repository` degrades to no-op
|
|
232
|
-
* detection (consistent on both the seed and the current side, so the gate can't over-fire), and a transient
|
|
233
|
-
* read error biases toward `false`, which — when the seed was shallow — only forces a SAFE full-walk fallback.
|
|
234
|
-
*/
|
|
235
|
-
async getShallowState(repoPath, cancellation) {
|
|
236
|
-
const result = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, errors: 'ignore' }, 'rev-parse', '--is-shallow-repository');
|
|
237
|
-
return result.stdout.trim() === 'true';
|
|
238
|
-
}
|
|
239
|
-
/** Whether `oldSha` is an ancestor of `newSha` (i.e. the ref moved fast-forward). */
|
|
240
|
-
async isFastForward(repoPath, oldSha, newSha, cancellation) {
|
|
241
|
-
const result = await this.git.run({ cwd: repoPath, cancellation: cancellation, errors: 'ignore' }, 'merge-base', '--is-ancestor', oldSha, newSha);
|
|
242
|
-
return result.exitCode === 0;
|
|
243
|
-
}
|
|
244
|
-
async openGraphSession(repoPath, options, cancellation) {
|
|
245
|
-
// The session computes the walk shape (`ordering|onlyFollowFirstParent`) the SAME way `getGraph`
|
|
246
|
-
// derives it, so it can gate its incremental seed on a shape change (which reshapes every row's
|
|
247
|
-
// parents/order) exactly as the host's former `_graphBuildShape` gate did.
|
|
248
|
-
const getWalkShape = () => {
|
|
249
|
-
const cfg = this.context.config;
|
|
250
|
-
return {
|
|
251
|
-
ordering: cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? 'date',
|
|
252
|
-
onlyFollowFirstParent: cfg?.graph?.onlyFollowFirstParent ?? false,
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
const session = new GraphSession(this, repoPath, options?.rowProcessor, getWalkShape);
|
|
256
|
-
await session.initialize(options, cancellation);
|
|
257
|
-
return session;
|
|
258
|
-
}
|
|
259
|
-
async getGraph(repoPath, rev, options, cancellation) {
|
|
260
|
-
const scope = getScopedLogger();
|
|
261
|
-
const cfg = this.context.config;
|
|
262
|
-
const defaultLimit = options?.limit ?? 5000;
|
|
263
|
-
const ordering = cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? 'date';
|
|
264
|
-
const onlyFollowFirstParent = cfg?.graph?.onlyFollowFirstParent ?? false;
|
|
265
|
-
const deferStats = options?.include?.stats;
|
|
266
|
-
// `let`: cleared before the fallback walk when the fast path bailed for a parent-rewriting reason
|
|
267
|
-
// (unshallow / replace-ref change) — those alter boundary commits' true diffs, so per-sha stats
|
|
268
|
-
// carried from the prior generation may be stale and must recompute.
|
|
269
|
-
let rowsStatsSeed = options?.rowsStatsSeed;
|
|
270
|
-
const parser = getGraphParser(options?.include?.stats && !deferStats);
|
|
271
|
-
const shaParser = getShaLogParser();
|
|
272
|
-
const statsParser = getShaAndStatsLogParser();
|
|
273
|
-
const stashPromise = this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation);
|
|
274
|
-
// Pre-BUILD the first walk's stream as soon as the stash list (the spawn's only argv/stdin
|
|
275
|
-
// input) resolves. NOTE: `git.stream` is a lazy async generator — the process does NOT spawn
|
|
276
|
-
// until the walk loop's first iteration, so this achieves argv/stdin PREPARATION overlap only,
|
|
277
|
-
// not the git-startup overlap the original design intended (make the spawn eager — priming the
|
|
278
|
-
// generator — or delete this seam; tracked as a follow-up). Consumed exactly once by the first
|
|
279
|
-
// `getCommitsForGraphCore` call; never iterated = never spawned, so an unconsumed pre-build
|
|
280
|
-
// (fast-path win, error fallback) leaks nothing.
|
|
281
|
-
const prespawnAborter = new AbortController();
|
|
282
|
-
const onPrespawnCancel = () => prespawnAborter.abort();
|
|
283
|
-
cancellation?.addEventListener('abort', onPrespawnCancel, { once: true });
|
|
284
|
-
// An ALREADY-aborted signal never fires listeners added after the fact — propagate it by hand.
|
|
285
|
-
if (cancellation?.aborted) {
|
|
286
|
-
onPrespawnCancel();
|
|
287
|
-
}
|
|
288
|
-
let prespawn = (async () => {
|
|
289
|
-
try {
|
|
290
|
-
const gitStash = await stashPromise;
|
|
291
|
-
const { stdin } = convertStashesToStdin(gitStash?.stashes);
|
|
292
|
-
const args = ['log', ...parser.arguments, `--${ordering}-order`, '--all'];
|
|
293
|
-
if (stdin) {
|
|
294
|
-
args.push('--stdin');
|
|
295
|
-
}
|
|
296
|
-
if (onlyFollowFirstParent) {
|
|
297
|
-
args.push('--first-parent');
|
|
298
|
-
}
|
|
299
|
-
const stream = this.git.stream({
|
|
300
|
-
cwd: repoPath,
|
|
301
|
-
configs: gitConfigsLog,
|
|
302
|
-
cancellation: prespawnAborter.signal,
|
|
303
|
-
stdin: stdin,
|
|
304
|
-
// See the walk spawn below for why GIT_FLUSH=0.
|
|
305
|
-
env: { GIT_FLUSH: '0' },
|
|
306
|
-
}, ...args, '--');
|
|
307
|
-
return { stream: stream };
|
|
308
|
-
}
|
|
309
|
-
catch {
|
|
310
|
-
return undefined;
|
|
311
|
-
}
|
|
312
|
-
})();
|
|
313
|
-
// Current ref tips (peeled), captured ONCE at walk entry, overlapped with the rest of the prelude (a
|
|
314
|
-
// single `for-each-ref`, off the rows-walk critical path). Attached to the returned graph as `refTips`
|
|
315
|
-
// so the host can seed the NEXT rebuild's tip diff; the R6b fast path also reuses this same map for its
|
|
316
|
-
// own tip-diff gate (so there's exactly one `for-each-ref` per call whether it goes fast or full).
|
|
317
|
-
// ALWAYS forced, including on a cold build. It's tempting to skip the force when there's no seed to
|
|
318
|
-
// diff against — the cold build only records these tips for the NEXT build — but the tips it records
|
|
319
|
-
// must describe the same repo state the rows walk observed, and the rows walk always reads live git.
|
|
320
|
-
// A cached (stale) enumeration breaks that pairing in a way a later build can't detect: if a ref moves
|
|
321
|
-
// A→B before the cold load and is then reverted B→A, the seed says A, the next forced read says A, the
|
|
322
|
-
// tip diff sees no change and takes the fast path — while the cached rows were built at B and still
|
|
323
|
-
// carry the discarded commit. Staleness here is not "more work, never wrong"; only the seed side can
|
|
324
|
-
// be stale, so a move-and-revert admits a genuinely wrong fast path.
|
|
325
|
-
const refTipsPromise = this.getCurrentRefTips(repoPath, cancellation);
|
|
326
|
-
// Shallow state (peeled off the same prelude, off the rows-walk critical path) — stamped on the returned
|
|
327
|
-
// graph so the NEXT rebuild's seed can gate on an un-shallow/re-shallow, and reused by the R6b fast path's
|
|
328
|
-
// own shallow gate (one `rev-parse` per call whether it goes fast or full).
|
|
329
|
-
const shallowPromise = this.getShallowState(repoPath, cancellation);
|
|
330
|
-
const [shaResult, stashResult, branchesResult, remotesResult, currentUserResult, worktreesResult, defaultBranchResult,] = await Promise.allSettled([
|
|
331
|
-
!isUncommitted(rev, true)
|
|
332
|
-
? this.git.run({ cwd: repoPath, configs: gitConfigsLog }, 'log', ...shaParser.arguments, '-n1', rev ?? 'HEAD', '--')
|
|
333
|
-
: undefined,
|
|
334
|
-
stashPromise,
|
|
335
|
-
this.provider.branches.getBranches(repoPath, undefined, cancellation),
|
|
336
|
-
this.provider.remotes.getRemotes(repoPath, undefined, cancellation),
|
|
337
|
-
this.provider.config.getCurrentUser(repoPath),
|
|
338
|
-
this.provider.worktrees
|
|
339
|
-
?.getWorktrees(repoPath, cancellation)
|
|
340
|
-
.then((w) => [
|
|
341
|
-
w,
|
|
342
|
-
groupWorktreesByBranch(w, { includeDefault: true }),
|
|
343
|
-
]),
|
|
344
|
-
// Local-only: never contact the remote on the graph's hot fetch path. `isDefault` is additive,
|
|
345
|
-
// so it's simply absent until a background networked caller resolves origin/HEAD.
|
|
346
|
-
this.provider.branches.getDefaultBranchName(repoPath, undefined, { local: true }, cancellation),
|
|
347
|
-
]);
|
|
348
|
-
const branches = getSettledValue(branchesResult)?.values;
|
|
349
|
-
const branchMap = branches != null ? new Map(branches.map(r => [r.name, r])) : new Map();
|
|
350
|
-
const headBranch = branches?.find(b => b.current);
|
|
351
|
-
const headRefUpstreamName = headBranch?.upstream?.name;
|
|
352
|
-
const [worktrees, worktreesByBranch] = getSettledValue(worktreesResult) ?? [[], new Map()];
|
|
353
|
-
// The repo's default branch (e.g. `origin/main`) reduced to its local branch name (`main`) so it
|
|
354
|
-
// can be matched against each local head's `tip` to flag the default-branch head additively.
|
|
355
|
-
const defaultBranchName = getSettledValue(defaultBranchResult);
|
|
356
|
-
const defaultLocalName = defaultBranchName != null ? getBranchNameWithoutRemote(defaultBranchName) : undefined;
|
|
357
|
-
let branchIdOfMainWorktree;
|
|
358
|
-
let mainWorktree;
|
|
359
|
-
if (worktreesByBranch != null) {
|
|
360
|
-
const defaultEntry = find(worktreesByBranch, ([, wt]) => wt.isDefault);
|
|
361
|
-
if (defaultEntry != null) {
|
|
362
|
-
[branchIdOfMainWorktree, mainWorktree] = defaultEntry;
|
|
363
|
-
// Remove the main/default worktree so the branch-row decoration shows `+checkedout`
|
|
364
|
-
// (not `+worktree`) for the main checkout. `mainWorktree` is retained below purely so
|
|
365
|
-
// Undo Commit can still reach the main worktree's HEAD from a secondary worktree's graph.
|
|
366
|
-
worktreesByBranch.delete(branchIdOfMainWorktree);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
const currentUser = getSettledValue(currentUserResult);
|
|
370
|
-
const remotes = getSettledValue(remotesResult);
|
|
371
|
-
const remoteMap = remotes != null ? new Map(remotes.map(r => [r.name, r])) : new Map();
|
|
372
|
-
// Decoration side inputs, fingerprinted for the NEXT rebuild's metadata gate (and compared against
|
|
373
|
-
// the seed's by this call's fast path). Computed from the prelude's fresh queries — the same values
|
|
374
|
-
// row construction below embeds into row decorations.
|
|
375
|
-
const decorationFingerprint = computeDecorationFingerprint(repoPath, defaultBranchName, defaultLocalName, headRefUpstreamName, branches, remotes, worktrees, currentUser);
|
|
376
|
-
const shas = getSettledValue(shaResult)?.stdout;
|
|
377
|
-
const selectSha = shas != null ? first(shaParser.parse(shas)) : undefined;
|
|
378
|
-
// Resolved off the critical path (started in the prelude). Same map for the full walk's `refTips`, the
|
|
379
|
-
// fast path's tip-diff gate, and the fast path's `refTips`. Never rejects (errors ignored → empty map).
|
|
380
|
-
const refTips = await refTipsPromise;
|
|
381
|
-
// Same value for the full walk's `shallow`, the fast path's shallow gate, and the fast path's `shallow`.
|
|
382
|
-
const shallow = await shallowPromise;
|
|
383
|
-
const downstreamMap = new Map();
|
|
384
|
-
// There *HAS* to be a better way to get git log to return stashes, but this is the best we've found
|
|
385
|
-
const gitStash = getSettledValue(stashResult);
|
|
386
|
-
const { stdin, remappedIds } = convertStashesToStdin(gitStash?.stashes);
|
|
387
|
-
const avatars = new Map();
|
|
388
|
-
const ids = new Set();
|
|
389
|
-
const reachableFromHEAD = new Set();
|
|
390
|
-
// SHAs on the first-parent chain from HEAD up to (excluding) the first merge commit — the only
|
|
391
|
-
// commits a plain (non-`--rebase-merges`) interactive rebase can safely rewrite. `headSha` seeds
|
|
392
|
-
// the chain; `rewriteableNextSha` tracks the next sha expected on it. Outer scope so they persist
|
|
393
|
-
// across `more()` pagination, like `reachableFromHEAD`.
|
|
394
|
-
const rewriteableFromHEAD = new Set();
|
|
395
|
-
let headSha;
|
|
396
|
-
let rewriteableNextSha;
|
|
397
|
-
// Undo Commit is offered only on a worktree HEAD that is a LEAF (nothing is built on it) —
|
|
398
|
-
// undoing a commit other work is stacked on is unsafe. The leaf check is only needed for the
|
|
399
|
-
// undo-eligible tips (the active HEAD + each worktree's HEAD), so track just those shas rather
|
|
400
|
-
// than every commit, keeping this O(#worktrees) instead of O(#commits).
|
|
401
|
-
const undoableTipShas = new Set();
|
|
402
|
-
if (headBranch?.sha != null) {
|
|
403
|
-
undoableTipShas.add(headBranch.sha);
|
|
404
|
-
}
|
|
405
|
-
for (const wt of worktrees) {
|
|
406
|
-
if (wt.sha != null) {
|
|
407
|
-
undoableTipShas.add(wt.sha);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
// The subset of `undoableTipShas` that turn out to have a child (are an ancestor of another
|
|
411
|
-
// commit) — i.e. NOT leaves. Built newest-first during the walk, so by the time a tip's row is
|
|
412
|
-
// processed every newer commit (its only possible children) has been seen. Undo is withheld for
|
|
413
|
-
// shas recorded here. Stash rows are excluded (a stash sitting on a tip must not block undoing it).
|
|
414
|
-
const tipShasWithChildren = new Set();
|
|
415
|
-
// SHAs reachable from HEAD's tracking upstream tip. Combined with `reachableFromHEAD`,
|
|
416
|
-
// this lets us mark commits as unpushed (reachable from HEAD but not from HEAD's upstream).
|
|
417
|
-
const reachableFromHeadUpstream = new Set();
|
|
418
|
-
// Map<sha, Map<refKey, ref>> — inner map deduplicates refs during propagation
|
|
419
|
-
const reachableRefs = new Map();
|
|
420
|
-
// Stable, append-only reachability table built as we walk — the PRIMARY representation shipped to
|
|
421
|
-
// consumers. Lives in the outer scope so it accumulates across `more()` pagination; indices
|
|
422
|
-
// already assigned never change, since git reachability only propagates to older (later-walked)
|
|
423
|
-
// commits. Per-row ref arrays are NOT retained — each row keeps only its set index
|
|
424
|
-
// (`contexts.reachabilityIndex`), and the working `reachableRefs` entry is dropped once emitted.
|
|
425
|
-
// The encoder lives next to its decoder in `reachability.utils` so the wire format can't drift.
|
|
426
|
-
// A caller-supplied seed CONTINUES the prior generation's table (same id, stable indices) so
|
|
427
|
-
// rows retained across a rebuild keep valid `reachabilityIndex` values.
|
|
428
|
-
const reachabilityBuilder = createReachabilityTableBuilder(options?.reachabilitySeed);
|
|
429
|
-
// Set-index cache keyed by the working ref-map INSTANCE: the propagation below transfers a
|
|
430
|
-
// row's map wholesale to its (first) parent, so an entire chain interns the same object —
|
|
431
|
-
// one real intern per chain instead of one per row. Maps only ever GROW (ref seeding adds
|
|
432
|
-
// entries), so an unchanged size proves the cached index is still exact.
|
|
433
|
-
const internCache = new WeakMap();
|
|
434
|
-
function finalizeRowReachability(row, sha, refs) {
|
|
435
|
-
let setIndex;
|
|
436
|
-
const cached = refs != null ? internCache.get(refs) : undefined;
|
|
437
|
-
if (cached != null && cached.size === refs.size) {
|
|
438
|
-
setIndex = cached.index;
|
|
439
|
-
}
|
|
440
|
-
else {
|
|
441
|
-
setIndex = reachabilityBuilder.intern(refs?.values());
|
|
442
|
-
if (refs != null) {
|
|
443
|
-
internCache.set(refs, { size: refs.size, index: setIndex });
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (setIndex != null) {
|
|
447
|
-
(row.contexts ??= {}).reachabilityIndex = setIndex;
|
|
448
|
-
}
|
|
449
|
-
// Drop the transient per-row arrays so emitted rows don't retain reachability, and release the
|
|
450
|
-
// working entry — once a commit is emitted its children are all walked and its parents already
|
|
451
|
-
// seeded, so nothing reads `reachableRefs.get(sha)` again (orderings keep parents after children).
|
|
452
|
-
row.reachability = undefined;
|
|
453
|
-
reachableRefs.delete(sha);
|
|
454
|
-
}
|
|
455
|
-
const rowStats = new Map();
|
|
456
|
-
let pendingRowsStatsCount = 0;
|
|
457
|
-
let iterations = 0;
|
|
458
|
-
let total = 0;
|
|
459
|
-
// Hoisted so the ordered walk AND the R6b incremental fast path share one context. It holds the
|
|
460
|
-
// outer accumulator sets BY REFERENCE (they mutate in place across `more()` pagination / replay), so
|
|
461
|
-
// building it once is equivalent to the prior per-call construction.
|
|
462
|
-
const rowProcessor = options?.rowProcessor;
|
|
463
|
-
const graphCtx = rowProcessor != null
|
|
464
|
-
? {
|
|
465
|
-
repoPath: repoPath,
|
|
466
|
-
useAvatars: cfg?.graph?.avatars ?? true,
|
|
467
|
-
branches: branchMap,
|
|
468
|
-
remotes: remoteMap,
|
|
469
|
-
worktreesByBranch: worktreesByBranch,
|
|
470
|
-
branchIdOfMainWorktree: branchIdOfMainWorktree,
|
|
471
|
-
stashes: gitStash?.stashes,
|
|
472
|
-
reachableFromHEAD: reachableFromHEAD,
|
|
473
|
-
rewriteableFromHEAD: rewriteableFromHEAD,
|
|
474
|
-
tipShasWithChildren: tipShasWithChildren,
|
|
475
|
-
// `undefined` when HEAD has no upstream, so the processor flags nothing as
|
|
476
|
-
// unpublished; otherwise the live set (mutated during the walk, read by ref).
|
|
477
|
-
reachableFromHeadUpstream: headRefUpstreamName != null ? reachableFromHeadUpstream : undefined,
|
|
478
|
-
avatars: avatars,
|
|
479
|
-
}
|
|
480
|
-
: undefined;
|
|
481
|
-
// Parses one commit record into a row (ref badges, parents, stash vs commit) but performs NO
|
|
482
|
-
// reachability/HEAD/downstream accumulation — that half lives in `accumulateRowState`, so the ordered
|
|
483
|
-
// walk and the fast path (which replays accumulation over reused rows, deriving ref lists from their
|
|
484
|
-
// own decoration) share one propagation implementation. Returns `undefined` when the record dedups to
|
|
485
|
-
// an already-seen remapped-stash sha. Faithful extraction of the walk's former inline body — must stay
|
|
486
|
-
// byte-identical to it (the equivalence harness pins this).
|
|
487
|
-
function buildRowFromCommit(commit) {
|
|
488
|
-
total++;
|
|
489
|
-
let shaOrRemapped = remappedIds.get(commit.sha);
|
|
490
|
-
if (shaOrRemapped && ids.has(shaOrRemapped))
|
|
491
|
-
return undefined;
|
|
492
|
-
shaOrRemapped ??= commit.sha;
|
|
493
|
-
ids.add(shaOrRemapped);
|
|
494
|
-
const refHeads = [];
|
|
495
|
-
const refRemoteHeads = [];
|
|
496
|
-
const refTags = [];
|
|
497
|
-
// `head` is per-tip (drives `isCurrentHead` on the branch it decorates); `sawHead` sticks once ANY
|
|
498
|
-
// tip is HEAD so `accumulateRowState` seeds `reachableFromHEAD` even when HEAD isn't the last tip.
|
|
499
|
-
let head = false;
|
|
500
|
-
let sawHead = false;
|
|
501
|
-
if (commit.tips) {
|
|
502
|
-
for (let tip of commit.tips.split(', ')) {
|
|
503
|
-
head = false;
|
|
504
|
-
if (tip === 'refs/stash')
|
|
505
|
-
continue;
|
|
506
|
-
if (tip.startsWith('tag: ')) {
|
|
507
|
-
const tagName = tip.substring(5);
|
|
508
|
-
refTags.push({
|
|
509
|
-
id: getTagId(repoPath, tagName),
|
|
510
|
-
name: tagName,
|
|
511
|
-
// Not currently used, so don't bother looking it up
|
|
512
|
-
annotated: true,
|
|
513
|
-
});
|
|
514
|
-
continue;
|
|
515
|
-
}
|
|
516
|
-
if (tip.startsWith('HEAD')) {
|
|
517
|
-
head = true;
|
|
518
|
-
sawHead = true;
|
|
519
|
-
if (tip !== 'HEAD') {
|
|
520
|
-
tip = tip.substring(8);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const remoteName = getRemoteNameFromBranchName(tip);
|
|
524
|
-
if (remoteName) {
|
|
525
|
-
const remote = remoteMap.get(remoteName);
|
|
526
|
-
if (remote != null) {
|
|
527
|
-
const branchName = getBranchNameWithoutRemote(tip);
|
|
528
|
-
if (branchName === 'HEAD')
|
|
529
|
-
continue;
|
|
530
|
-
refRemoteHeads.push({
|
|
531
|
-
id: getBranchId(repoPath, true, tip),
|
|
532
|
-
name: branchName,
|
|
533
|
-
owner: remote.name,
|
|
534
|
-
url: remote.url,
|
|
535
|
-
current: tip === headRefUpstreamName,
|
|
536
|
-
// `defaultLocalName!` is non-null here because `tip === defaultBranchName` short-circuits when `defaultBranchName` is null.
|
|
537
|
-
isDefault: tip === defaultBranchName && !branchMap.has(defaultLocalName),
|
|
538
|
-
hostingServiceType: remote.provider?.gkProviderId,
|
|
539
|
-
// `branchMap` is keyed by full name, so the remote ref resolves here — the same
|
|
540
|
-
// lookup the host does today to bake `+starred` into the context string.
|
|
541
|
-
starred: branchMap.get(tip)?.starred || undefined,
|
|
542
|
-
});
|
|
543
|
-
continue;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
const branch = branchMap.get(tip);
|
|
547
|
-
const branchId = branch?.id ?? getBranchId(repoPath, false, tip);
|
|
548
|
-
// `worktreesByBranch` has the main/default worktree removed, so recover it here.
|
|
549
|
-
const worktree = worktreesByBranch?.get(branchId) ??
|
|
550
|
-
(branchId === branchIdOfMainWorktree ? mainWorktree : undefined);
|
|
551
|
-
const worktreeRef = worktree != null
|
|
552
|
-
? {
|
|
553
|
-
id: getWorktreeId(repoPath, worktree.name),
|
|
554
|
-
path: worktree.path,
|
|
555
|
-
isDefault: worktree.isDefault === true,
|
|
556
|
-
}
|
|
557
|
-
: undefined;
|
|
558
|
-
refHeads.push({
|
|
559
|
-
id: branchId,
|
|
560
|
-
name: tip,
|
|
561
|
-
isCurrentHead: head,
|
|
562
|
-
upstream: branch?.upstream != null
|
|
563
|
-
? {
|
|
564
|
-
name: branch.upstream.name,
|
|
565
|
-
id: getBranchId(repoPath, true, branch.upstream.name),
|
|
566
|
-
missing: branch.upstream.missing,
|
|
567
|
-
state: {
|
|
568
|
-
ahead: branch.upstream.state.ahead,
|
|
569
|
-
behind: branch.upstream.state.behind,
|
|
570
|
-
},
|
|
571
|
-
}
|
|
572
|
-
: undefined,
|
|
573
|
-
worktree: worktreeRef,
|
|
574
|
-
isDefault: defaultLocalName != null && tip === defaultLocalName,
|
|
575
|
-
starred: branch?.starred || undefined,
|
|
576
|
-
});
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
const parents = commit.parents ? commit.parents.split(' ') : [];
|
|
580
|
-
const stash = gitStash?.stashes.get(shaOrRemapped);
|
|
581
|
-
let row;
|
|
582
|
-
if (stash != null) {
|
|
583
|
-
row = {
|
|
584
|
-
sha: shaOrRemapped,
|
|
585
|
-
// Always only return the first parent for stashes, as it is a Git implementation for the index and untracked files
|
|
586
|
-
parents: parents.slice(0, 1),
|
|
587
|
-
author: currentUser?.name ?? commit.author,
|
|
588
|
-
email: commit.authorEmail,
|
|
589
|
-
date: Number(ordering === 'author-date' ? commit.authorDate : commit.committerDate) * 1000,
|
|
590
|
-
commitDate: Number(commit.committerDate) * 1000,
|
|
591
|
-
message: (stash.message ?? commit.message).trim(),
|
|
592
|
-
kind: 'stash',
|
|
593
|
-
stashNumber: stash.stashNumber,
|
|
594
|
-
heads: refHeads.length ? refHeads : undefined,
|
|
595
|
-
remotes: refRemoteHeads.length ? refRemoteHeads : undefined,
|
|
596
|
-
tags: refTags.length ? refTags : undefined,
|
|
597
|
-
isCurrentUser: true,
|
|
598
|
-
};
|
|
599
|
-
// Don't seed `rowStats` from `stash.stats` here: the graph's stash list is fetched with
|
|
600
|
-
// `includeFiles: false`, so the commit model SYNTHESIZES a zero-stats object from its empty
|
|
601
|
-
// fileset — seeding it marks the stash "covered" and permanently blanks it. The deferred
|
|
602
|
-
// stats pass owns stash stats (first-parent diff, keyed by stash sha).
|
|
603
|
-
}
|
|
604
|
-
else {
|
|
605
|
-
const isCurrentUser = isUserMatch(currentUser, commit.author, commit.authorEmail);
|
|
606
|
-
row = {
|
|
607
|
-
sha: shaOrRemapped,
|
|
608
|
-
parents: onlyFollowFirstParent ? parents.slice(0, 1) : parents,
|
|
609
|
-
author: commit.author,
|
|
610
|
-
email: commit.authorEmail,
|
|
611
|
-
date: Number(ordering === 'author-date' ? commit.authorDate : commit.committerDate) * 1000,
|
|
612
|
-
commitDate: Number(commit.committerDate) * 1000,
|
|
613
|
-
message: commit.message.trim(),
|
|
614
|
-
kind: parents.length > 1 ? 'merge' : 'commit',
|
|
615
|
-
heads: refHeads.length ? refHeads : undefined,
|
|
616
|
-
remotes: refRemoteHeads.length ? refRemoteHeads : undefined,
|
|
617
|
-
tags: refTags.length ? refTags : undefined,
|
|
618
|
-
isCurrentUser: isCurrentUser || undefined,
|
|
619
|
-
};
|
|
620
|
-
if (commit.stats != null) {
|
|
621
|
-
rowStats.set(shaOrRemapped, commit.stats);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
return {
|
|
625
|
-
row: row,
|
|
626
|
-
refHeads: refHeads,
|
|
627
|
-
refRemoteHeads: refRemoteHeads,
|
|
628
|
-
refTags: refTags,
|
|
629
|
-
head: sawHead,
|
|
630
|
-
parents: parents,
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
// The propagation half of the walk, factored out so the fast path can replay it in memory over reused
|
|
634
|
-
// rows (passing their own `heads`/`remotes`/`tags` as the ref lists and their full `parents`). Mutates
|
|
635
|
-
// the shared reachability/HEAD/downstream accumulators and returns the row's post-propagation
|
|
636
|
-
// reachable-ref map (for interning + flag derivation). `parents` is the FULL parent list (the walk
|
|
637
|
-
// always propagates through every parent, even when the emitted row stores a sliced set). Faithful
|
|
638
|
-
// extraction of the walk's former inline body — must stay byte-identical to it.
|
|
639
|
-
function accumulateRowState(sha, parents, refHeads, refRemoteHeads, refTags, head, isStash) {
|
|
640
|
-
if (head) {
|
|
641
|
-
reachableFromHEAD.add(sha);
|
|
642
|
-
headSha ??= sha;
|
|
643
|
-
}
|
|
644
|
-
if (reachableFromHEAD.has(sha)) {
|
|
645
|
-
for (const parent of parents) {
|
|
646
|
-
reachableFromHEAD.add(parent);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
// First-parent rewriteable chain from HEAD (see the field's declaration for the full rationale).
|
|
650
|
-
if (sha === headSha || sha === rewriteableNextSha) {
|
|
651
|
-
if (parents.length === 1) {
|
|
652
|
-
rewriteableFromHEAD.add(sha);
|
|
653
|
-
rewriteableNextSha = parents[0];
|
|
654
|
-
}
|
|
655
|
-
else {
|
|
656
|
-
rewriteableNextSha = undefined;
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
// A remote head with `current` set IS HEAD's tracking upstream tip (see `buildRowFromCommit`).
|
|
660
|
-
if (refRemoteHeads.some(r => r.current)) {
|
|
661
|
-
reachableFromHeadUpstream.add(sha);
|
|
662
|
-
}
|
|
663
|
-
if (reachableFromHeadUpstream.has(sha)) {
|
|
664
|
-
for (const parent of parents) {
|
|
665
|
-
reachableFromHeadUpstream.add(parent);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
// Seed reachability from all ref types on this commit.
|
|
669
|
-
if (refHeads.length > 0 || refRemoteHeads.length > 0 || refTags.length > 0) {
|
|
670
|
-
let refs = reachableRefs.get(sha);
|
|
671
|
-
if (refs == null) {
|
|
672
|
-
refs = new Map();
|
|
673
|
-
reachableRefs.set(sha, refs);
|
|
674
|
-
}
|
|
675
|
-
for (const h of refHeads) {
|
|
676
|
-
refs.set(`b:${h.name}`, {
|
|
677
|
-
refType: 'branch',
|
|
678
|
-
name: h.name,
|
|
679
|
-
remote: false,
|
|
680
|
-
current: h.isCurrentHead,
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
for (const r of refRemoteHeads) {
|
|
684
|
-
const name = `${r.owner}/${r.name}`;
|
|
685
|
-
refs.set(`r:${name}`, { refType: 'branch', name: name, remote: true });
|
|
686
|
-
}
|
|
687
|
-
for (const t of refTags) {
|
|
688
|
-
refs.set(`t:${t.name}`, { refType: 'tag', name: t.name });
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
// Propagate reachability to parents (ownership-transfer fast path; see the `reachableRefs`
|
|
692
|
-
// declaration + `finalizeRowReachability` for why the first childless parent may alias the map).
|
|
693
|
-
const currentRefs = reachableRefs.get(sha);
|
|
694
|
-
if (currentRefs != null && currentRefs.size > 0) {
|
|
695
|
-
let transferred = false;
|
|
696
|
-
for (const parent of parents) {
|
|
697
|
-
const parentRefs = reachableRefs.get(parent);
|
|
698
|
-
if (parentRefs == null) {
|
|
699
|
-
if (transferred) {
|
|
700
|
-
reachableRefs.set(parent, new Map(currentRefs));
|
|
701
|
-
}
|
|
702
|
-
else {
|
|
703
|
-
transferred = true;
|
|
704
|
-
reachableRefs.set(parent, currentRefs);
|
|
705
|
-
}
|
|
706
|
-
continue;
|
|
707
|
-
}
|
|
708
|
-
for (const [key, ref] of currentRefs) {
|
|
709
|
-
if (!parentRefs.has(key)) {
|
|
710
|
-
parentRefs.set(key, ref);
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
// Mark any undo-eligible tip that THIS non-stash commit builds on as non-leaf (stash rows excluded).
|
|
716
|
-
if (!isStash) {
|
|
717
|
-
for (const parent of parents) {
|
|
718
|
-
if (undoableTipShas.has(parent)) {
|
|
719
|
-
tipShasWithChildren.add(parent);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
// Downstreams: each branch tip → its upstream name.
|
|
724
|
-
for (const h of refHeads) {
|
|
725
|
-
if (h.upstream?.name != null) {
|
|
726
|
-
let downstreams = downstreamMap.get(h.upstream.name);
|
|
727
|
-
if (downstreams == null) {
|
|
728
|
-
downstreams = [];
|
|
729
|
-
downstreamMap.set(h.upstream.name, downstreams);
|
|
730
|
-
}
|
|
731
|
-
downstreams.push(h.name);
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
return reachableRefs.get(sha);
|
|
735
|
-
}
|
|
736
|
-
// Builds the deferred `--shortstat` query for the given rows (only shas the seed doesn't cover),
|
|
737
|
-
// shared by the ordered walk and the fast path. Increments `pendingRowsStatsCount` and resolves it
|
|
738
|
-
// when the background query completes; returns `undefined` when stats aren't requested.
|
|
739
|
-
const buildRowsStatsDeferred = (rows) => {
|
|
740
|
-
if (!deferStats)
|
|
741
|
-
return undefined;
|
|
742
|
-
pendingRowsStatsCount++;
|
|
743
|
-
// oxlint-disable-next-line no-async-promise-executor
|
|
744
|
-
const promise = new Promise(async (resolve) => {
|
|
745
|
-
try {
|
|
746
|
-
// Stats are immutable per sha — only query shas the seed doesn't already cover.
|
|
747
|
-
let missingStdin = '';
|
|
748
|
-
let missingStashStdin = '';
|
|
749
|
-
for (const row of rows) {
|
|
750
|
-
if (rowStats.has(row.sha))
|
|
751
|
-
continue;
|
|
752
|
-
const seeded = rowsStatsSeed?.get(row.sha);
|
|
753
|
-
if (seeded != null) {
|
|
754
|
-
rowStats.set(row.sha, seeded);
|
|
755
|
-
continue;
|
|
756
|
-
}
|
|
757
|
-
if (row.kind === 'stash') {
|
|
758
|
-
missingStashStdin += `${row.sha}\n`;
|
|
759
|
-
}
|
|
760
|
-
else {
|
|
761
|
-
missingStdin += `${row.sha}\n`;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
// Fully seeded — nothing new to compute, so no git process at all.
|
|
765
|
-
if (!missingStdin && !missingStashStdin)
|
|
766
|
-
return;
|
|
767
|
-
// A stash is a merge commit, so its own shortstat record is empty. Stashes get their own
|
|
768
|
-
// query diffed against the first parent (`-m --first-parent` — what `git stash show`
|
|
769
|
-
// reports), keyed directly by stash sha: no parent remapping, so none of the old
|
|
770
|
-
// `--no-walk` time-order races that could let the empty record win and blank the stash.
|
|
771
|
-
const [statsResult, stashStatsResult] = await Promise.allSettled([
|
|
772
|
-
missingStdin
|
|
773
|
-
? this.git.run({
|
|
774
|
-
cwd: repoPath,
|
|
775
|
-
configs: gitConfigsLog,
|
|
776
|
-
stdin: missingStdin,
|
|
777
|
-
priority: 'background',
|
|
778
|
-
}, 'log', '--no-walk', '--stdin', ...statsParser.arguments, '--')
|
|
779
|
-
: undefined,
|
|
780
|
-
missingStashStdin
|
|
781
|
-
? this.git.run({
|
|
782
|
-
cwd: repoPath,
|
|
783
|
-
configs: gitConfigsLog,
|
|
784
|
-
stdin: missingStashStdin,
|
|
785
|
-
priority: 'background',
|
|
786
|
-
}, 'log', '--no-walk', '--stdin', '-m', '--first-parent', ...statsParser.arguments, '--')
|
|
787
|
-
: undefined,
|
|
788
|
-
]);
|
|
789
|
-
for (const result of [getSettledValue(statsResult), getSettledValue(stashStatsResult)]) {
|
|
790
|
-
if (!result?.stdout)
|
|
791
|
-
continue;
|
|
792
|
-
for (const stat of statsParser.parse(result.stdout)) {
|
|
793
|
-
// Don't overwrite stats already populated for this sha
|
|
794
|
-
if (rowStats.has(stat.sha))
|
|
795
|
-
continue;
|
|
796
|
-
rowStats.set(stat.sha, stat.stats);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
finally {
|
|
801
|
-
pendingRowsStatsCount--;
|
|
802
|
-
resolve();
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
return { isLoaded: () => pendingRowsStatsCount === 0, promise: promise };
|
|
806
|
-
};
|
|
807
|
-
const args = ['log', ...parser.arguments, `--${ordering}-order`, '--all'];
|
|
808
|
-
if (stdin) {
|
|
809
|
-
args.push('--stdin');
|
|
810
|
-
}
|
|
811
|
-
if (onlyFollowFirstParent) {
|
|
812
|
-
args.push('--first-parent');
|
|
813
|
-
}
|
|
814
|
-
async function getCommitsForGraphCore(limit, sha, cursor, cancellation) {
|
|
815
|
-
try {
|
|
816
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
817
|
-
try {
|
|
818
|
-
iterations++;
|
|
819
|
-
// Consume the pre-spawned first walk when available (argv identical by construction:
|
|
820
|
-
// no cursor on the first call); paging/retry calls spawn normally. The pre-spawn's
|
|
821
|
-
// aborter doubles as this call's so the limit-stop kills the right process.
|
|
822
|
-
const prespawned = cursor == null && prespawn != null ? await prespawn : undefined;
|
|
823
|
-
prespawn = undefined;
|
|
824
|
-
const aborter = prespawned != null ? prespawnAborter : new AbortController();
|
|
825
|
-
const onAbort = () => {
|
|
826
|
-
aborter.abort();
|
|
827
|
-
};
|
|
828
|
-
cancellation?.addEventListener('abort', onAbort, { once: true });
|
|
829
|
-
// An ALREADY-aborted signal (e.g. `toAbortSignal` of a cancelled token) never fires listeners
|
|
830
|
-
// added after the fact — without this the walk would run to completion unabortably.
|
|
831
|
-
if (cancellation?.aborted) {
|
|
832
|
-
onAbort();
|
|
833
|
-
}
|
|
834
|
-
const _disposable = __addDisposableResource(env_1, createDisposable(() => cancellation?.removeEventListener('abort', onAbort)), false);
|
|
835
|
-
const stream = prespawned?.stream ??
|
|
836
|
-
this.git.stream({
|
|
837
|
-
cwd: repoPath,
|
|
838
|
-
configs: gitConfigsLog,
|
|
839
|
-
cancellation: aborter.signal,
|
|
840
|
-
stdin: stdin,
|
|
841
|
-
// Git flushes stdout per record to a pipe, producing thousands of tiny chunks the
|
|
842
|
-
// node side must individually await. Full stdio buffering delivers the same bytes
|
|
843
|
-
// in far fewer, larger chunks — right for this bulk walk (an incremental consumer
|
|
844
|
-
// wanting per-record latency should NOT set this).
|
|
845
|
-
env: { GIT_FLUSH: '0' },
|
|
846
|
-
}, ...args, cursor?.skip ? `--skip=${cursor.skip}` : undefined, '--');
|
|
847
|
-
const _streamDisposer = __addDisposableResource(env_1, createDisposable(() => void stream.return?.(undefined)), false);
|
|
848
|
-
const rows = [];
|
|
849
|
-
let count = 0;
|
|
850
|
-
let found = false;
|
|
851
|
-
let hasMore = false;
|
|
852
|
-
// Batched parse when available: one awaited yield per stream chunk instead of two
|
|
853
|
-
// promise hops per record — the walk's async-iterator overhead collapses. The
|
|
854
|
-
// with-stats parser (unused here — stats are always deferred) has no batched mode,
|
|
855
|
-
// so wrap its per-record stream into singleton batches to keep one loop shape.
|
|
856
|
-
const batches = parser.parseAsyncBatched?.(stream) ??
|
|
857
|
-
(async function* (it) {
|
|
858
|
-
for await (const commit of it) {
|
|
859
|
-
yield [commit];
|
|
860
|
-
}
|
|
861
|
-
})(parser.parseAsync(stream));
|
|
862
|
-
outer: for await (const batch of batches) {
|
|
863
|
-
for (const commit of batch) {
|
|
864
|
-
// Stopping logic (check AFTER processing the commit):
|
|
865
|
-
// - SHA + limit > 0: Find SHA, ensure at least `limit` commits loaded
|
|
866
|
-
// - SHA + limit = 0: Find SHA, stop immediately
|
|
867
|
-
// - No SHA + limit > 0: Load exactly `limit` commits
|
|
868
|
-
// - No SHA + limit = 0: Load everything remaining
|
|
869
|
-
// - SHA + limit > 0 + still unfound past 10× limit: defensive cap so an unreachable
|
|
870
|
-
// SHA (e.g. a stale merge-base the webview hasn't yet seen invalidated) can't
|
|
871
|
-
// walk the entire history. `hasMore=true` lets callers retry; the graph-wrapper
|
|
872
|
-
// side deduplicates re-requests so the cap doesn't loop.
|
|
873
|
-
if ((limit && count >= limit && (!sha || found || count >= limit * 10)) ||
|
|
874
|
-
(!limit && sha && found)) {
|
|
875
|
-
hasMore = true;
|
|
876
|
-
aborter.abort();
|
|
877
|
-
break outer;
|
|
878
|
-
}
|
|
879
|
-
if (sha && !found && commit.sha === sha) {
|
|
880
|
-
found = true;
|
|
881
|
-
}
|
|
882
|
-
count++;
|
|
883
|
-
if (ids.has(commit.sha))
|
|
884
|
-
continue;
|
|
885
|
-
const built = buildRowFromCommit(commit);
|
|
886
|
-
if (built == null)
|
|
887
|
-
continue; // remapped-stash dedup
|
|
888
|
-
const { row, refHeads, refRemoteHeads, refTags, head, parents } = built;
|
|
889
|
-
const refs = accumulateRowState(row.sha, parents, refHeads, refRemoteHeads, refTags, head, row.kind === 'stash');
|
|
890
|
-
// Transient: the row processor's `+unique` decision reads this; stripped by finalize.
|
|
891
|
-
// Unsorted (the consumer re-sorts after decoding) — order doesn't affect interning.
|
|
892
|
-
row.reachability = refs?.size ? { partial: true, refs: [...refs.values()] } : undefined;
|
|
893
|
-
rowProcessor?.processRow(row, graphCtx);
|
|
894
|
-
finalizeRowReachability(row, row.sha, refs);
|
|
895
|
-
rows.push(row);
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
const startingCursor = cursor?.sha;
|
|
899
|
-
const lastSha = last(ids);
|
|
900
|
-
cursor = lastSha != null ? { sha: lastSha, skip: total - iterations } : undefined;
|
|
901
|
-
const rowsStatsDeferred = buildRowsStatsDeferred(rows);
|
|
902
|
-
return {
|
|
903
|
-
repoPath: repoPath,
|
|
904
|
-
avatars: avatars,
|
|
905
|
-
ids: ids,
|
|
906
|
-
includes: options?.include,
|
|
907
|
-
branches: branchMap,
|
|
908
|
-
remotes: remoteMap,
|
|
909
|
-
downstreams: downstreamMap,
|
|
910
|
-
stashes: gitStash?.stashes,
|
|
911
|
-
worktrees: worktrees,
|
|
912
|
-
worktreesByBranch: worktreesByBranch,
|
|
913
|
-
reachableFromHEAD: reachableFromHEAD,
|
|
914
|
-
rewriteableFromHEAD: rewriteableFromHEAD,
|
|
915
|
-
reachability: reachabilityBuilder.build(),
|
|
916
|
-
refTips: refTips,
|
|
917
|
-
decorationFingerprint: decorationFingerprint,
|
|
918
|
-
shallow: shallow,
|
|
919
|
-
rows: rows,
|
|
920
|
-
id: sha ?? rev,
|
|
921
|
-
rowsStats: rowStats,
|
|
922
|
-
rowsStatsDeferred: rowsStatsDeferred,
|
|
923
|
-
paging: {
|
|
924
|
-
limit: limit === 0 ? count : limit,
|
|
925
|
-
startingCursor: startingCursor,
|
|
926
|
-
hasMore: hasMore,
|
|
927
|
-
},
|
|
928
|
-
more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation),
|
|
929
|
-
};
|
|
930
|
-
}
|
|
931
|
-
catch (e_1) {
|
|
932
|
-
env_1.error = e_1;
|
|
933
|
-
env_1.hasError = true;
|
|
934
|
-
}
|
|
935
|
-
finally {
|
|
936
|
-
__disposeResources(env_1);
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
catch (ex) {
|
|
940
|
-
scope?.error(ex);
|
|
941
|
-
debugger;
|
|
942
|
-
throw ex;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
// R6b incremental head-walk fast path: enumerate ONLY the new commits, stitch the seed's cached tail,
|
|
946
|
-
// and re-derive flags/reachability in memory — instead of re-walking every loaded row. Returns
|
|
947
|
-
// `undefined` (→ full walk below) on any structural change. Reports the outcome via `onIncrementalResult`.
|
|
948
|
-
let incrementalFallbackReason;
|
|
949
|
-
const tryIncrementalGraph = async (seed) => {
|
|
950
|
-
const onResult = options?.onIncrementalResult;
|
|
951
|
-
// Reports a fallback outcome; callers then `return undefined` to take the full walk.
|
|
952
|
-
const fallback = (reason) => {
|
|
953
|
-
incrementalFallbackReason = reason;
|
|
954
|
-
onResult?.({ path: 'fallback', reason: reason });
|
|
955
|
-
};
|
|
956
|
-
// Cheap gates (no git).
|
|
957
|
-
if (rowProcessor == null || graphCtx == null) {
|
|
958
|
-
fallback('no-row-processor');
|
|
959
|
-
return undefined;
|
|
960
|
-
}
|
|
961
|
-
// The convergence + date-boundary reasoning is only sound for `date` order.
|
|
962
|
-
if (ordering !== 'date' || seed.ordering !== 'date') {
|
|
963
|
-
fallback('ordering-not-date');
|
|
964
|
-
return undefined;
|
|
965
|
-
}
|
|
966
|
-
const seedShas = new Set(seed.rows.map(r => r.sha));
|
|
967
|
-
// A `rev` narrows the walk's find/stop semantics. The host's same-repo rebuild passes a rebuild
|
|
968
|
-
// ANCHOR sha (the loaded window's bottom) to pin that boundary — the anchor is by construction inside
|
|
969
|
-
// the seed, and the stitch + trim below preserve the seed tail, so the fast path can honor it (it
|
|
970
|
-
// grows the window down to the anchor; see the window/limit shape below). A rev NOT in the seed is a
|
|
971
|
-
// real out-of-window target (deep link, reveal) the fast path can't reach → full walk.
|
|
972
|
-
if (rev != null && !seedShas.has(rev)) {
|
|
973
|
-
fallback('rev-outside-seed');
|
|
974
|
-
return undefined;
|
|
975
|
-
}
|
|
976
|
-
// First-parent (now or in the seed) means the emitted rows carry sliced parents the in-memory
|
|
977
|
-
// re-derivation can't expand back to the full set the walk propagates through.
|
|
978
|
-
if (onlyFollowFirstParent || seed.onlyFollowFirstParent) {
|
|
979
|
-
fallback('first-parent');
|
|
980
|
-
return undefined;
|
|
981
|
-
}
|
|
982
|
-
// The ACTUAL current HEAD sha (to seed reachable-from-HEAD and detect a checkout). Distinct from
|
|
983
|
-
// `selectSha`, which resolves the `rev` ANCHOR — not HEAD — when a rev is passed: with no rev
|
|
984
|
-
// `selectSha` already IS the resolved HEAD, otherwise take the current branch tip (also populated for
|
|
985
|
-
// a detached HEAD). The graph `id` still mirrors the full walk's `selectSha ?? rev` (below).
|
|
986
|
-
const currentHeadSha = rev == null ? selectSha : headBranch?.sha;
|
|
987
|
-
// Reuse the prelude's tips (same repo state — nothing mutates between the prelude and here).
|
|
988
|
-
const currentTips = refTips;
|
|
989
|
-
// Shallow-state gate: an un-shallow (or re-shallow) while the graph was closed leaves every branch
|
|
990
|
-
// tip put — so it passes the tip diff below — yet changes what history exists BELOW the loaded window
|
|
991
|
-
// (a stale-false `hasMore` would hide the newly deepened commits). Any change → full walk. Checked
|
|
992
|
-
// against the prelude's already-captured `shallow` (no extra git).
|
|
993
|
-
if ((seed.shallow ?? false) !== shallow) {
|
|
994
|
-
fallback('shallow-changed');
|
|
995
|
-
return undefined;
|
|
996
|
-
}
|
|
997
|
-
// Replace-ref gate: `git replace` (and grafts) rewrite ancestry PRESENTATION globally, so any
|
|
998
|
-
// change to the replace-ref set (`refs/replace/*`) invalidates the cached rows' parent links even when
|
|
999
|
-
// no branch tip moved. An UNCHANGED set (including non-empty) stays fast-path-eligible — the seed rows
|
|
1000
|
-
// were built under the same replacement view. Replace refs aren't `isMoveableGraphRef`s (no badge), so
|
|
1001
|
-
// the tip diff below skips them; diff them here on their own.
|
|
1002
|
-
let seedReplaceCount = 0;
|
|
1003
|
-
for (const [refname, oldSha] of seed.tips) {
|
|
1004
|
-
if (!refname.startsWith('refs/replace/'))
|
|
1005
|
-
continue;
|
|
1006
|
-
seedReplaceCount++;
|
|
1007
|
-
// Removed (gone from current) or retargeted (points at a different replacement object).
|
|
1008
|
-
if (currentTips.get(refname) !== oldSha) {
|
|
1009
|
-
fallback('replace-refs-changed');
|
|
1010
|
-
return undefined;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
let currentReplaceCount = 0;
|
|
1014
|
-
for (const refname of currentTips.keys()) {
|
|
1015
|
-
if (refname.startsWith('refs/replace/')) {
|
|
1016
|
-
currentReplaceCount++;
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
// Every seed replace ref is present-and-equal in current (checked above); an unequal count means a
|
|
1020
|
-
// replace ref was ADDED.
|
|
1021
|
-
if (seedReplaceCount !== currentReplaceCount) {
|
|
1022
|
-
fallback('replace-refs-changed');
|
|
1023
|
-
return undefined;
|
|
1024
|
-
}
|
|
1025
|
-
// Ref-tip diff gate: deletions + non-fast-forward moves force a full walk.
|
|
1026
|
-
// Reused rows whose ref badges / current-HEAD flag changed and must be rebuilt from raw git.
|
|
1027
|
-
const affected = new Set();
|
|
1028
|
-
const ffPairs = [];
|
|
1029
|
-
// A moved/new REMOTE ref also changes its tracking branches' ahead/behind — baked into those
|
|
1030
|
-
// branch pills' serialized contexts (`+ahead`/`+behind` drive Push/Pull menu gating) — while the
|
|
1031
|
-
// LOCAL tips stay put; refetch those rows too so a plain fetch corrects them without a full walk.
|
|
1032
|
-
const addTrackingBranchRows = (remoteRefname) => {
|
|
1033
|
-
if (branches == null || !remoteRefname.startsWith('refs/remotes/'))
|
|
1034
|
-
return;
|
|
1035
|
-
const upstreamName = remoteRefname.substring('refs/remotes/'.length);
|
|
1036
|
-
for (const b of branches) {
|
|
1037
|
-
if (b.upstream?.name === upstreamName && b.sha != null && seedShas.has(b.sha)) {
|
|
1038
|
-
affected.add(b.sha);
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
};
|
|
1042
|
-
for (const [refname, oldSha] of seed.tips) {
|
|
1043
|
-
if (!isMoveableGraphRef(refname))
|
|
1044
|
-
continue;
|
|
1045
|
-
const cur = currentTips.get(refname);
|
|
1046
|
-
if (cur == null) {
|
|
1047
|
-
fallback('ref-deleted');
|
|
1048
|
-
return undefined;
|
|
1049
|
-
}
|
|
1050
|
-
if (cur !== oldSha) {
|
|
1051
|
-
ffPairs.push([oldSha, cur]);
|
|
1052
|
-
if (seedShas.has(oldSha)) {
|
|
1053
|
-
affected.add(oldSha);
|
|
1054
|
-
}
|
|
1055
|
-
if (seedShas.has(cur)) {
|
|
1056
|
-
affected.add(cur);
|
|
1057
|
-
}
|
|
1058
|
-
addTrackingBranchRows(refname);
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
// New refs (present now, absent from the seed) landing on an already-loaded row.
|
|
1062
|
-
for (const [refname, cur] of currentTips) {
|
|
1063
|
-
if (!isMoveableGraphRef(refname) || seed.tips.has(refname))
|
|
1064
|
-
continue;
|
|
1065
|
-
if (seedShas.has(cur)) {
|
|
1066
|
-
affected.add(cur);
|
|
1067
|
-
}
|
|
1068
|
-
addTrackingBranchRows(refname);
|
|
1069
|
-
}
|
|
1070
|
-
if (ffPairs.length > 0) {
|
|
1071
|
-
// Bounded fan-out: a mass-moved-ref fetch can produce hundreds of pairs — an unbounded
|
|
1072
|
-
// `Promise.all` would monopolize (or overflow) the git queue. Small chunks stay well under the
|
|
1073
|
-
// queue's slot count, and the first non-fast-forward bails without paying for the rest.
|
|
1074
|
-
const ffCheckChunkSize = 4;
|
|
1075
|
-
for (let i = 0; i < ffPairs.length; i += ffCheckChunkSize) {
|
|
1076
|
-
const results = await Promise.all(ffPairs
|
|
1077
|
-
.slice(i, i + ffCheckChunkSize)
|
|
1078
|
-
.map(([oldSha, newSha]) => this.isFastForward(repoPath, oldSha, newSha, cancellation)));
|
|
1079
|
-
if (results.some(ok => !ok)) {
|
|
1080
|
-
fallback('ref-non-fast-forward');
|
|
1081
|
-
return undefined;
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
// HEAD move (checkout) — old/new HEAD rows need their `isCurrentHead` re-derived from raw git. A
|
|
1086
|
-
// checkout between two branches sitting on the SAME commit moves no sha yet flips which head carries
|
|
1087
|
-
// `isCurrentHead`, so compare the current-head ref NAME too (both are git short refnames; a detached
|
|
1088
|
-
// HEAD has an undefined branch name). Either sha or name differing re-derives both endpoints' rows.
|
|
1089
|
-
const priorHeadRow = seed.rows.find(r => r.heads?.some(h => h.isCurrentHead));
|
|
1090
|
-
const priorHeadSha = priorHeadRow?.sha;
|
|
1091
|
-
const priorHeadName = priorHeadRow?.heads?.find(h => h.isCurrentHead)?.name;
|
|
1092
|
-
const currentHeadName = headBranch?.name;
|
|
1093
|
-
if (priorHeadSha !== currentHeadSha || priorHeadName !== currentHeadName) {
|
|
1094
|
-
if (priorHeadSha != null && seedShas.has(priorHeadSha)) {
|
|
1095
|
-
affected.add(priorHeadSha);
|
|
1096
|
-
}
|
|
1097
|
-
if (currentHeadSha != null && seedShas.has(currentHeadSha)) {
|
|
1098
|
-
affected.add(currentHeadSha);
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
// Stash-set gate: any push/pop/drop changes the injected rows.
|
|
1102
|
-
const currentStashShas = gitStash?.stashes != null ? new Set(gitStash.stashes.keys()) : new Set();
|
|
1103
|
-
const priorStashShas = seed.rows.filter(r => r.kind === 'stash').map(r => r.sha);
|
|
1104
|
-
if (priorStashShas.length !== currentStashShas.size || priorStashShas.some(s => !currentStashShas.has(s))) {
|
|
1105
|
-
fallback('stash-changed');
|
|
1106
|
-
return undefined;
|
|
1107
|
-
}
|
|
1108
|
-
// Decoration-metadata gate: rows EMBED metadata derived from side inputs (default branch,
|
|
1109
|
-
// upstreams, worktree assignments, remote urls/providers, current user) that can change without
|
|
1110
|
-
// moving any ref tip — e.g. `git remote set-head`, `branch --set-upstream-to`, `worktree add`.
|
|
1111
|
-
// Reused rows keep their prior decorations (only flags/reachability are re-derived below), so ANY
|
|
1112
|
-
// change here must take the full walk that rebuilds them. An absent seed fingerprint never matches —
|
|
1113
|
-
// safe full fallback. Deliberately LAST of the gates so the structural gates above keep their precise
|
|
1114
|
-
// reasons (a deleted tracking branch reports `ref-deleted`, not this).
|
|
1115
|
-
if (seed.decorationFingerprint !== decorationFingerprint) {
|
|
1116
|
-
fallback('metadata-changed');
|
|
1117
|
-
return undefined;
|
|
1118
|
-
}
|
|
1119
|
-
// Per-branch upstream retargets/removals/additions on RETAINED rows: a branch pill embeds its
|
|
1120
|
-
// upstream, and a tip-stationary branch's row is reused as-is — so compare every seed-row pill's
|
|
1121
|
-
// embedded upstream against the current mapping. Kept OUT of the fingerprint so a NEW tracking
|
|
1122
|
-
// branch stays fast (its row is rebuilt via the `affected` refetch; a deleted one is `ref-deleted`).
|
|
1123
|
-
for (const r of seed.rows) {
|
|
1124
|
-
if (r.heads == null)
|
|
1125
|
-
continue;
|
|
1126
|
-
for (const h of r.heads) {
|
|
1127
|
-
const currentBranch = branchMap.get(h.name);
|
|
1128
|
-
if (currentBranch == null)
|
|
1129
|
-
continue;
|
|
1130
|
-
if (h.upstream?.name !== currentBranch.upstream?.name) {
|
|
1131
|
-
fallback('metadata-changed');
|
|
1132
|
-
return undefined;
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
// Enumerate the new commits (reachable now but not from any prior tip) + boundary check.
|
|
1137
|
-
// Stashes' rows are already in the seed, so their shas join the EXCLUSIONS (passing them via
|
|
1138
|
-
// `--all` would re-emit them as "new"). The exclusions are fed as `^sha` lines over stdin, NOT
|
|
1139
|
-
// argv — a repo can carry more distinct ref tips (tags, PR refs) than a command line holds
|
|
1140
|
-
// (Windows caps ~32K chars), and stdin is unbounded.
|
|
1141
|
-
const notShas = new Set(seed.tips.values());
|
|
1142
|
-
for (const s of currentStashShas) {
|
|
1143
|
-
notShas.add(s);
|
|
1144
|
-
}
|
|
1145
|
-
let exclusionsStdin = '';
|
|
1146
|
-
for (const s of notShas) {
|
|
1147
|
-
exclusionsStdin += `^${s}\n`;
|
|
1148
|
-
}
|
|
1149
|
-
const enumResult = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, stdin: exclusionsStdin }, 'log', ...parser.arguments, '--date-order', '--all', '--stdin', '--');
|
|
1150
|
-
const newCommits = [...parser.parse(enumResult.stdout)];
|
|
1151
|
-
// Stitch soundness: the result must equal [...new, ...seed]. That holds iff every new commit is
|
|
1152
|
-
// strictly newer than the seam (the max date across the seed window) — an equal/older date could
|
|
1153
|
-
// interleave under `--date-order`, so bail. Checked on raw dates BEFORE any mutation.
|
|
1154
|
-
let maxSeedDate = Number.NEGATIVE_INFINITY;
|
|
1155
|
-
for (const r of seed.rows) {
|
|
1156
|
-
if (r.date > maxSeedDate) {
|
|
1157
|
-
maxSeedDate = r.date;
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
for (const c of newCommits) {
|
|
1161
|
-
if (Number(c.committerDate) * 1000 <= maxSeedDate) {
|
|
1162
|
-
fallback('date-boundary');
|
|
1163
|
-
return undefined;
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
// Window/limit shape.
|
|
1167
|
-
const stitchedSize = newCommits.length + seed.rows.length;
|
|
1168
|
-
const seedHasMore = seed.hasMore === true;
|
|
1169
|
-
const noLimit = defaultLimit === 0;
|
|
1170
|
-
// The rev anchor (a seed sha) bounds the walk's BOTTOM: the full walk with `sha=rev` grows its window
|
|
1171
|
-
// down to (and INCLUDING) rev before honoring the limit — and with no limit it stops the instant it
|
|
1172
|
-
// finds rev — so the anchor row survives the trim even when `limit` alone would cut above it. Its index
|
|
1173
|
-
// in the assembled window `[new…, seed…]` (new commits never dedup, so `newRows.length` equals
|
|
1174
|
-
// `newCommits.length`): `newCommits.length + <its index in seed.rows>`.
|
|
1175
|
-
const revWindowIndex = rev != null ? newCommits.length + seed.rows.findIndex(r => r.sha === rev) : -1;
|
|
1176
|
-
// Rows the walk targets: `defaultLimit`, raised to at least include the rev anchor (with no limit + rev,
|
|
1177
|
-
// exactly `revWindowIndex + 1`, since the walk stops on finding rev).
|
|
1178
|
-
const targetRows = rev != null
|
|
1179
|
-
? noLimit
|
|
1180
|
-
? revWindowIndex + 1
|
|
1181
|
-
: Math.max(defaultLimit, revWindowIndex + 1)
|
|
1182
|
-
: defaultLimit;
|
|
1183
|
-
// The fast path can only serve rows the seed carries; if more is wanted than it holds AND there was
|
|
1184
|
-
// more below it, git is needed for the gap → full walk. (No rev + no limit wants everything below.)
|
|
1185
|
-
const wantsBelowWindow = rev != null ? targetRows > stitchedSize : noLimit || defaultLimit > stitchedSize;
|
|
1186
|
-
if (wantsBelowWindow && seedHasMore) {
|
|
1187
|
-
fallback('limit-exceeds-seed');
|
|
1188
|
-
return undefined;
|
|
1189
|
-
}
|
|
1190
|
-
const trimTo = rev != null
|
|
1191
|
-
? Math.min(targetRows, stitchedSize)
|
|
1192
|
-
: noLimit
|
|
1193
|
-
? stitchedSize
|
|
1194
|
-
: Math.min(defaultLimit, stitchedSize);
|
|
1195
|
-
const hasMore = trimTo < stitchedSize || seedHasMore;
|
|
1196
|
-
// Stashes present in the window make the `more()` skip math (records vs unique ids) ambiguous —
|
|
1197
|
-
// only take the fast path when nothing pages below.
|
|
1198
|
-
if (currentStashShas.size > 0 && hasMore) {
|
|
1199
|
-
fallback('stash-window-conflict');
|
|
1200
|
-
return undefined;
|
|
1201
|
-
}
|
|
1202
|
-
// Commit to the fast path — mutations begin here (all fallbacks are above).
|
|
1203
|
-
const newRows = [];
|
|
1204
|
-
for (const c of newCommits) {
|
|
1205
|
-
const built = buildRowFromCommit(c);
|
|
1206
|
-
if (built != null) {
|
|
1207
|
-
newRows.push(built.row);
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
// Rebuild the affected reused rows from raw git (bounded `--no-walk`) so their ref badges + emojified
|
|
1211
|
-
// message + current-HEAD flag are exactly what a full walk would produce (git owns %D ordering).
|
|
1212
|
-
const refetched = new Map();
|
|
1213
|
-
if (affected.size > 0) {
|
|
1214
|
-
// SHAs over stdin, not argv — a mass-moved-ref fetch can put hundreds of retained rows in
|
|
1215
|
-
// `affected`, past what a command line holds (see the enumeration above).
|
|
1216
|
-
const refetchResult = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, stdin: join(affected, '\n') }, 'log', ...parser.arguments, '--no-walk', '--stdin', '--');
|
|
1217
|
-
for (const c of parser.parse(refetchResult.stdout)) {
|
|
1218
|
-
const built = buildRowFromCommit(c);
|
|
1219
|
-
if (built != null) {
|
|
1220
|
-
refetched.set(built.row.sha, built.row);
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
const freshShas = new Set([...newRows.map(r => r.sha), ...refetched.keys()]);
|
|
1225
|
-
// Assemble [new…, reused/refetched…] and trim to the requested window (new commits push the
|
|
1226
|
-
// bottom rows out — exactly what a full walk at this limit does).
|
|
1227
|
-
const windowRows = [...newRows];
|
|
1228
|
-
for (const r of seed.rows) {
|
|
1229
|
-
windowRows.push(refetched.get(r.sha) ?? r);
|
|
1230
|
-
}
|
|
1231
|
-
windowRows.length = Math.min(windowRows.length, trimTo);
|
|
1232
|
-
// Building the fresh rows above populated `ids`/`total` (via `buildRowFromCommit`); reset and rebuild
|
|
1233
|
-
// them from the FINAL trimmed window so `ids`/`total`/the reachability boundary match a full walk
|
|
1234
|
-
// exactly (this is what makes `more()` continue identically).
|
|
1235
|
-
ids.clear();
|
|
1236
|
-
total = 0;
|
|
1237
|
-
for (const row of windowRows) {
|
|
1238
|
-
ids.add(row.sha);
|
|
1239
|
-
total++;
|
|
1240
|
-
const refs = accumulateRowState(row.sha, row.parents, row.heads ?? [], row.remotes ?? [], row.tags ?? [], row.sha === currentHeadSha, row.kind === 'stash');
|
|
1241
|
-
if (freshShas.has(row.sha)) {
|
|
1242
|
-
// Fresh rows are raw — run the full processor (contexts, emojify, avatar). Reused rows keep
|
|
1243
|
-
// their already-processed contexts/message; only their flags (below) are recomputed.
|
|
1244
|
-
row.reachability = refs?.size ? { partial: true, refs: [...refs.values()] } : undefined;
|
|
1245
|
-
rowProcessor.processRow(row, graphCtx);
|
|
1246
|
-
}
|
|
1247
|
-
// Authoritative flags for every commit row (membership can shift on reused rows too — e.g. a new
|
|
1248
|
-
// interior branch flips `+unique`). Stash rows carry none.
|
|
1249
|
-
if (row.kind !== 'stash') {
|
|
1250
|
-
(row.contexts ??= {}).flags = computeGraphRowContextFlags(row.sha, refs?.values(), graphCtx);
|
|
1251
|
-
}
|
|
1252
|
-
finalizeRowReachability(row, row.sha, refs);
|
|
1253
|
-
}
|
|
1254
|
-
// Reconstruct the walk's first-call cursor so `more()` (which re-spawns git from `--skip`) continues
|
|
1255
|
-
// byte-identically off the trimmed window.
|
|
1256
|
-
iterations = 1;
|
|
1257
|
-
const lastSha = last(ids);
|
|
1258
|
-
const cursor = lastSha != null ? { sha: lastSha, skip: total - iterations } : undefined;
|
|
1259
|
-
const rowsStatsDeferred = buildRowsStatsDeferred(windowRows);
|
|
1260
|
-
onResult?.({ path: 'fast', added: newRows.length });
|
|
1261
|
-
return {
|
|
1262
|
-
repoPath: repoPath,
|
|
1263
|
-
avatars: avatars,
|
|
1264
|
-
ids: ids,
|
|
1265
|
-
includes: options?.include,
|
|
1266
|
-
branches: branchMap,
|
|
1267
|
-
remotes: remoteMap,
|
|
1268
|
-
downstreams: downstreamMap,
|
|
1269
|
-
stashes: gitStash?.stashes,
|
|
1270
|
-
worktrees: worktrees,
|
|
1271
|
-
worktreesByBranch: worktreesByBranch,
|
|
1272
|
-
reachableFromHEAD: reachableFromHEAD,
|
|
1273
|
-
rewriteableFromHEAD: rewriteableFromHEAD,
|
|
1274
|
-
reachability: reachabilityBuilder.build(),
|
|
1275
|
-
refTips: refTips,
|
|
1276
|
-
decorationFingerprint: decorationFingerprint,
|
|
1277
|
-
shallow: shallow,
|
|
1278
|
-
rows: windowRows,
|
|
1279
|
-
// Mirror the full walk's `id` (`sha ?? rev`, sha = the resolved rev-or-HEAD) — NOT the actual HEAD,
|
|
1280
|
-
// which `currentHeadSha` now tracks separately when a rev anchor is passed.
|
|
1281
|
-
id: selectSha ?? rev,
|
|
1282
|
-
rowsStats: rowStats,
|
|
1283
|
-
rowsStatsDeferred: rowsStatsDeferred,
|
|
1284
|
-
paging: {
|
|
1285
|
-
limit: noLimit ? total : defaultLimit,
|
|
1286
|
-
startingCursor: undefined,
|
|
1287
|
-
hasMore: hasMore,
|
|
1288
|
-
},
|
|
1289
|
-
more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation),
|
|
1290
|
-
};
|
|
1291
|
-
};
|
|
1292
|
-
if (options?.incrementalSeed != null) {
|
|
1293
|
-
let fast;
|
|
1294
|
-
try {
|
|
1295
|
-
fast = await tryIncrementalGraph(options.incrementalSeed);
|
|
1296
|
-
}
|
|
1297
|
-
catch (ex) {
|
|
1298
|
-
// The fast path must never fail where the full walk it accelerates would succeed — its git
|
|
1299
|
-
// operations have failure modes the `--all` walk doesn't (per-tip `--not` argv on huge ref
|
|
1300
|
-
// sets, queue-depth overflow fanning out FF checks, transient git errors). Cancellation
|
|
1301
|
-
// still propagates; anything else degrades to the full walk below.
|
|
1302
|
-
if (isCancellationError(ex) || cancellation?.aborted)
|
|
1303
|
-
throw ex;
|
|
1304
|
-
// The fast path may have died AFTER its mutation barrier (the affected-row refetch, or the
|
|
1305
|
-
// row processor) with the walk accumulators partially populated — a full walk over polluted
|
|
1306
|
-
// `ids` would silently DROP those rows (its loop dedups on `ids.has`). Reset every closure
|
|
1307
|
-
// accumulator to its pristine pre-walk state; the seeded reachability builder is append-only
|
|
1308
|
-
// and tolerates orphaned interns by design, and mutated reused-row objects are superseded by
|
|
1309
|
-
// the full walk's fresh rows.
|
|
1310
|
-
ids.clear();
|
|
1311
|
-
total = 0;
|
|
1312
|
-
iterations = 0;
|
|
1313
|
-
rowStats.clear();
|
|
1314
|
-
avatars.clear();
|
|
1315
|
-
reachableFromHEAD.clear();
|
|
1316
|
-
rewriteableFromHEAD.clear();
|
|
1317
|
-
reachableFromHeadUpstream.clear();
|
|
1318
|
-
reachableRefs.clear();
|
|
1319
|
-
tipShasWithChildren.clear();
|
|
1320
|
-
downstreamMap.clear();
|
|
1321
|
-
headSha = undefined;
|
|
1322
|
-
rewriteableNextSha = undefined;
|
|
1323
|
-
scope?.warn(`incremental graph walk failed; falling back to full walk; ${String(ex)}`);
|
|
1324
|
-
incrementalFallbackReason = 'error';
|
|
1325
|
-
options.onIncrementalResult?.({ path: 'fallback', reason: 'error' });
|
|
1326
|
-
}
|
|
1327
|
-
if (fast != null) {
|
|
1328
|
-
void this.provider.maintenance?.request(repoPath, 'commit-graph');
|
|
1329
|
-
return fast;
|
|
1330
|
-
}
|
|
1331
|
-
// Parent-rewriting fallbacks change boundary commits' true diffs — an unshallowed parent or a
|
|
1332
|
-
// replace-ref retarget makes previously-computed per-sha stats stale, so the fallback walk must
|
|
1333
|
-
// recompute them instead of carrying the prior generation's values forward. An `error` fallback
|
|
1334
|
-
// recomputes too: the throw may have preceded the replace-ref/shallow gates, so staleness can't
|
|
1335
|
-
// be ruled out.
|
|
1336
|
-
if (incrementalFallbackReason === 'shallow-changed' ||
|
|
1337
|
-
incrementalFallbackReason === 'replace-refs-changed' ||
|
|
1338
|
-
incrementalFallbackReason === 'error') {
|
|
1339
|
-
rowsStatsSeed = undefined;
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
let graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, undefined, cancellation);
|
|
1343
|
-
// Spurious-empty guard: the repo has branches (so `git log --all` should yield commits) yet the
|
|
1344
|
-
// log returned no rows. That's an inconsistent result — almost always a transient ref-read race
|
|
1345
|
-
// while a concurrent git operation rewrites refs/packed-refs — not a genuinely empty repo.
|
|
1346
|
-
// Returning it would flash "No commits" in the graph. Retry once (transient glitches clear within
|
|
1347
|
-
// ms). A truly empty repo has no branches and is left untouched.
|
|
1348
|
-
if (graph.rows.length === 0 && branches?.length && !cancellation?.aborted) {
|
|
1349
|
-
scope?.warn(`graph returned 0 rows but repo has ${branches.length} branches; retrying`);
|
|
1350
|
-
graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, undefined, cancellation);
|
|
1351
|
-
}
|
|
1352
|
-
// After the first load, hint the maintenance service to backfill the commit-graph file (background)
|
|
1353
|
-
// so the NEXT open's ordered walk starts emitting rows immediately instead of sorting the whole
|
|
1354
|
-
// history first. Fire-and-forget — the service's demand throttle decides whether it actually runs.
|
|
1355
|
-
void this.provider.maintenance?.request(repoPath, 'commit-graph');
|
|
1356
|
-
return graph;
|
|
1357
|
-
}
|
|
1358
|
-
async *searchGraph(repoPath, search, options, cancellation) {
|
|
1359
|
-
return yield* this.searchGraphCore(repoPath, search, undefined, undefined, options, cancellation);
|
|
1360
|
-
}
|
|
1361
|
-
async *continueSearchGraph(repoPath, cursor, existingResults, options, cancellation) {
|
|
1362
|
-
return yield* this.searchGraphCore(repoPath, cursor.search, cursor, existingResults, options, cancellation);
|
|
1363
|
-
}
|
|
1364
|
-
/**
|
|
1365
|
-
* Cheap commit count for `search`, no result materialization — used to probe a candidate relaxed
|
|
1366
|
-
* query before offering it. Never throws: any failure (including a sha-only `commit:` query, which
|
|
1367
|
-
* can't be meaningfully "relaxed") returns 0, since this is a probe, not a search.
|
|
1368
|
-
*/
|
|
1369
|
-
async countSearchResults(repoPath, search, options, cancellation) {
|
|
1370
|
-
try {
|
|
1371
|
-
search = { matchAll: false, matchCase: false, matchRegex: true, matchWholeWord: false, ...search };
|
|
1372
|
-
const currentUser = search.query.includes('@me')
|
|
1373
|
-
? await this.provider.config.getCurrentUser(repoPath)
|
|
1374
|
-
: undefined;
|
|
1375
|
-
const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
|
|
1376
|
-
// An exact sha lookup can't be relaxed by dropping filter groups — nothing to count.
|
|
1377
|
-
if (shas?.size)
|
|
1378
|
-
return 0;
|
|
1379
|
-
// `--merges` matches stash commits too (they have 2-3 parents). `rev-list` gets no stdin, so the
|
|
1380
|
-
// only stash that can leak in here is refs/stash's tip via `--all` -- exclude it up front
|
|
1381
|
-
if (filters.type === 'merge') {
|
|
1382
|
-
const allIndex = searchArgs.indexOf('--all');
|
|
1383
|
-
if (allIndex !== -1) {
|
|
1384
|
-
searchArgs.splice(allIndex, 0, '--exclude=refs/stash');
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
const maxCount = options?.maxCount ?? 1000;
|
|
1388
|
-
const result = await this.git.run({ cwd: repoPath, configs: gitConfigsLog, cancellation: cancellation, errors: 'ignore' }, 'rev-list', '--count', `--max-count=${maxCount}`, ...searchArgs, '--', ...files);
|
|
1389
|
-
const count = Number.parseInt(result.stdout.trim(), 10);
|
|
1390
|
-
return Number.isFinite(count) ? count : 0;
|
|
1391
|
-
}
|
|
1392
|
-
catch {
|
|
1393
|
-
return 0;
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
async *searchGraphCore(repoPath, search, cursor, existingResults, options, cancellation) {
|
|
1397
|
-
search = { matchAll: false, matchCase: false, matchRegex: true, matchWholeWord: false, ...search };
|
|
1398
|
-
const comparisonKey = getSearchQueryComparisonKey(search);
|
|
1399
|
-
try {
|
|
1400
|
-
const currentUser = search.query.includes('@me')
|
|
1401
|
-
? await this.provider.config.getCurrentUser(repoPath)
|
|
1402
|
-
: undefined;
|
|
1403
|
-
const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
|
|
1404
|
-
const tipsOnly = filters.type === 'tip';
|
|
1405
|
-
// Stash commits have 2-3 parents, so `--merges` matches them; excluded from results below.
|
|
1406
|
-
// Derived from the args git actually runs rather than `filters.type`, since a multi-value
|
|
1407
|
-
// `type:` query (e.g. `type:merge type:tip`) leaves `--merges` in the args while
|
|
1408
|
-
// `filters.type` reflects only the last value parsed
|
|
1409
|
-
const mergesOnly = searchArgs.includes('--merges');
|
|
1410
|
-
const parser = filters.files
|
|
1411
|
-
? getShaAndDatesWithFilesLogParser(tipsOnly)
|
|
1412
|
-
: getShaAndDatesLogParser(tipsOnly);
|
|
1413
|
-
const similarityThreshold = this.context.config?.commits.similarityThreshold ?? undefined;
|
|
1414
|
-
const args = [
|
|
1415
|
-
'log',
|
|
1416
|
-
...parser.arguments,
|
|
1417
|
-
`-M${similarityThreshold == null ? '' : `${similarityThreshold}%`}`,
|
|
1418
|
-
'--use-mailmap',
|
|
1419
|
-
];
|
|
1420
|
-
let stashes;
|
|
1421
|
-
let stdin;
|
|
1422
|
-
let remappedIds;
|
|
1423
|
-
let resolvedShas;
|
|
1424
|
-
if (shas?.size) {
|
|
1425
|
-
resolvedShas = await this.provider.revision.resolveShas(repoPath, shas, cancellation);
|
|
1426
|
-
// Never throw on cancellation here: the outer catch wraps non-GitSearchError into
|
|
1427
|
-
// GitSearchError, which surfaces as a false "Invalid search pattern". Return instead.
|
|
1428
|
-
if (cancellation?.aborted) {
|
|
1429
|
-
return {
|
|
1430
|
-
repoPath: repoPath,
|
|
1431
|
-
query: search,
|
|
1432
|
-
queryFilters: filters,
|
|
1433
|
-
comparisonKey: comparisonKey,
|
|
1434
|
-
results: existingResults ?? new Map(),
|
|
1435
|
-
hasMore: true,
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
|
-
// Short SHA(s) matched no commit: return empty (empty stdin to `--no-walk --stdin`
|
|
1439
|
-
// would return HEAD, so we must not fall through to git).
|
|
1440
|
-
if (!resolvedShas.size) {
|
|
1441
|
-
return {
|
|
1442
|
-
repoPath: repoPath,
|
|
1443
|
-
query: search,
|
|
1444
|
-
queryFilters: filters,
|
|
1445
|
-
comparisonKey: comparisonKey,
|
|
1446
|
-
results: existingResults ?? new Map(),
|
|
1447
|
-
hasMore: false,
|
|
1448
|
-
};
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
if (resolvedShas?.size) {
|
|
1452
|
-
stdin = join(resolvedShas, '\n');
|
|
1453
|
-
args.push('--no-walk');
|
|
1454
|
-
remappedIds = new Map();
|
|
1455
|
-
}
|
|
1456
|
-
else if (!filters.refs) {
|
|
1457
|
-
// Don't include stashes when using ref: filter, as they would add unrelated commits
|
|
1458
|
-
// There *HAS* to be a better way to get git log to return stashes, but this is the best we've found
|
|
1459
|
-
const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
|
|
1460
|
-
stashes = converted.stashes;
|
|
1461
|
-
remappedIds = converted.remappedIds;
|
|
1462
|
-
// `--all` already surfaces refs/stash's tip on its own, so when merges-only there's no need
|
|
1463
|
-
// to walk the rest of the stash stack via stdin -- the results filter below still excludes
|
|
1464
|
-
// any stash sha that slips through via refs/stash
|
|
1465
|
-
stdin = mergesOnly ? undefined : converted.stdin;
|
|
1466
|
-
}
|
|
1467
|
-
else if (mergesOnly) {
|
|
1468
|
-
// `ref:` skips walking stashes into the results (they're unrelated to the ref), but a
|
|
1469
|
-
// stash's tip can still leak in via `--merges` if the ref reaches refs/stash -- fetch
|
|
1470
|
-
// stashes here purely so the results filter below can exclude them, without widening
|
|
1471
|
-
// the walk via stdin
|
|
1472
|
-
const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
|
|
1473
|
-
stashes = converted.stashes;
|
|
1474
|
-
remappedIds = converted.remappedIds;
|
|
1475
|
-
}
|
|
1476
|
-
else {
|
|
1477
|
-
remappedIds = new Map();
|
|
1478
|
-
}
|
|
1479
|
-
if (stdin) {
|
|
1480
|
-
args.push('--stdin');
|
|
1481
|
-
}
|
|
1482
|
-
const limit = options?.limit ?? this.context.config?.graph?.maxSearchItems ?? 0;
|
|
1483
|
-
const ordering = options?.ordering ?? this.context.config?.commits.ordering ?? undefined;
|
|
1484
|
-
if (ordering) {
|
|
1485
|
-
args.push(`--${ordering}-order`);
|
|
1486
|
-
}
|
|
1487
|
-
// Add the search args, but skip any shas (as they are already included in the stdin)
|
|
1488
|
-
for (const arg of searchArgs) {
|
|
1489
|
-
if (shas?.has(arg) || args.includes(arg))
|
|
1490
|
-
continue;
|
|
1491
|
-
args.push(arg);
|
|
1492
|
-
}
|
|
1493
|
-
const results = existingResults ?? new Map();
|
|
1494
|
-
// Use state from cursor, if provided
|
|
1495
|
-
const cursorState = cursor?.state != null && typeof cursor.state === 'object' ? cursor.state : undefined;
|
|
1496
|
-
let iterations = cursorState?.iterations ?? 0;
|
|
1497
|
-
let totalSeen = cursorState?.totalSeen ?? 0;
|
|
1498
|
-
let skipCursor = cursorState ? { sha: cursorState.sha, skip: cursorState.skip } : undefined;
|
|
1499
|
-
let count = 0;
|
|
1500
|
-
try {
|
|
1501
|
-
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
1502
|
-
try {
|
|
1503
|
-
iterations++;
|
|
1504
|
-
const aborter = new AbortController();
|
|
1505
|
-
const onAbort = () => {
|
|
1506
|
-
aborter.abort();
|
|
1507
|
-
};
|
|
1508
|
-
cancellation?.addEventListener('abort', onAbort, { once: true });
|
|
1509
|
-
// An ALREADY-aborted signal (e.g. `toAbortSignal` of a cancelled token) never fires listeners
|
|
1510
|
-
// added after the fact — without this the walk would run to completion unabortably.
|
|
1511
|
-
if (cancellation?.aborted) {
|
|
1512
|
-
onAbort();
|
|
1513
|
-
}
|
|
1514
|
-
const _disposable = __addDisposableResource(env_2, createDisposable(() => cancellation?.removeEventListener('abort', onAbort)), false);
|
|
1515
|
-
const stream = this.git.stream({
|
|
1516
|
-
cwd: repoPath,
|
|
1517
|
-
cancellation: aborter.signal,
|
|
1518
|
-
configs: ['-C', repoPath, ...gitConfigsLog],
|
|
1519
|
-
stdin: stdin,
|
|
1520
|
-
}, ...args, skipCursor?.skip ? `--skip=${skipCursor.skip}` : undefined, '--', ...files);
|
|
1521
|
-
const _streamDisposer = __addDisposableResource(env_2, createDisposable(() => void stream.return?.(undefined)), false);
|
|
1522
|
-
let hasMore = false;
|
|
1523
|
-
let sha;
|
|
1524
|
-
const stashesOnly = filters.type === 'stash';
|
|
1525
|
-
// Progressive results support - time-based batching for consistent UI updates
|
|
1526
|
-
const batch = [];
|
|
1527
|
-
let lastProgressTime = Date.now();
|
|
1528
|
-
for await (const r of parser.parseAsync(stream)) {
|
|
1529
|
-
// Check for cancellation early in each iteration
|
|
1530
|
-
if (cancellation?.aborted) {
|
|
1531
|
-
// When paused/cancelled, assume there are more results
|
|
1532
|
-
hasMore = true;
|
|
1533
|
-
break;
|
|
1534
|
-
}
|
|
1535
|
-
count++;
|
|
1536
|
-
if (limit && count > limit) {
|
|
1537
|
-
hasMore = true;
|
|
1538
|
-
aborter.abort();
|
|
1539
|
-
break;
|
|
1540
|
-
}
|
|
1541
|
-
sha = remappedIds.get(r.sha) ?? r.sha;
|
|
1542
|
-
if (results.has(sha) ||
|
|
1543
|
-
(stashesOnly && !stashes?.has(sha)) ||
|
|
1544
|
-
(mergesOnly && stashes?.has(sha)) ||
|
|
1545
|
-
(tipsOnly && !r.tips)) {
|
|
1546
|
-
continue;
|
|
1547
|
-
}
|
|
1548
|
-
const resultData = {
|
|
1549
|
-
i: results.size,
|
|
1550
|
-
date: Number(options?.ordering === 'author-date' ? r.authorDate : r.committerDate) * 1000,
|
|
1551
|
-
files: r.files,
|
|
1552
|
-
};
|
|
1553
|
-
results.set(sha, resultData);
|
|
1554
|
-
batch.push([sha, resultData]);
|
|
1555
|
-
// Send progress updates with incremental results
|
|
1556
|
-
const timeSinceLastProgress = Date.now() - lastProgressTime;
|
|
1557
|
-
// Send batch when enough time has passed and we have new results
|
|
1558
|
-
const shouldSendBatch = timeSinceLastProgress >= progressiveSearchResultsBatchTimeMs && batch.length > 0;
|
|
1559
|
-
if (shouldSendBatch) {
|
|
1560
|
-
// Send only the NEW results since last batch (incremental)
|
|
1561
|
-
yield {
|
|
1562
|
-
repoPath: repoPath,
|
|
1563
|
-
query: search,
|
|
1564
|
-
queryFilters: filters,
|
|
1565
|
-
comparisonKey: comparisonKey,
|
|
1566
|
-
results: new Map(batch),
|
|
1567
|
-
runningTotal: results.size,
|
|
1568
|
-
hasMore: true,
|
|
1569
|
-
};
|
|
1570
|
-
batch.length = 0;
|
|
1571
|
-
lastProgressTime = Date.now();
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
// Send final progress update if there are remaining results
|
|
1575
|
-
if (batch.length) {
|
|
1576
|
-
yield {
|
|
1577
|
-
repoPath: repoPath,
|
|
1578
|
-
query: search,
|
|
1579
|
-
queryFilters: filters,
|
|
1580
|
-
comparisonKey: comparisonKey,
|
|
1581
|
-
results: new Map(batch),
|
|
1582
|
-
runningTotal: results.size,
|
|
1583
|
-
hasMore: hasMore,
|
|
1584
|
-
};
|
|
1585
|
-
}
|
|
1586
|
-
totalSeen += count;
|
|
1587
|
-
const lastSha = last(results)?.[0];
|
|
1588
|
-
skipCursor = lastSha != null ? { sha: lastSha, skip: totalSeen - iterations } : undefined;
|
|
1589
|
-
return {
|
|
1590
|
-
repoPath: repoPath,
|
|
1591
|
-
query: search,
|
|
1592
|
-
queryFilters: filters,
|
|
1593
|
-
comparisonKey: comparisonKey,
|
|
1594
|
-
results: results,
|
|
1595
|
-
hasMore: hasMore,
|
|
1596
|
-
paging: limit || hasMore
|
|
1597
|
-
? {
|
|
1598
|
-
limit: limit || count,
|
|
1599
|
-
cursor: hasMore && skipCursor
|
|
1600
|
-
? {
|
|
1601
|
-
search: search,
|
|
1602
|
-
state: {
|
|
1603
|
-
iterations: iterations,
|
|
1604
|
-
totalSeen: totalSeen,
|
|
1605
|
-
sha: skipCursor.sha,
|
|
1606
|
-
skip: skipCursor.skip,
|
|
1607
|
-
},
|
|
1608
|
-
}
|
|
1609
|
-
: undefined,
|
|
1610
|
-
}
|
|
1611
|
-
: undefined,
|
|
1612
|
-
};
|
|
1613
|
-
}
|
|
1614
|
-
catch (e_2) {
|
|
1615
|
-
env_2.error = e_2;
|
|
1616
|
-
env_2.hasError = true;
|
|
1617
|
-
}
|
|
1618
|
-
finally {
|
|
1619
|
-
__disposeResources(env_2);
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
catch (ex) {
|
|
1623
|
-
if (isCancellationError(ex) || cancellation?.aborted) {
|
|
1624
|
-
// When cancelled, preserve cursor so search can be resumed
|
|
1625
|
-
// Update totalSeen with the count from this iteration
|
|
1626
|
-
totalSeen += count;
|
|
1627
|
-
const lastSha = last(results)?.[0];
|
|
1628
|
-
const skipCursor = lastSha != null ? { sha: lastSha, skip: totalSeen - iterations } : undefined;
|
|
1629
|
-
return {
|
|
1630
|
-
repoPath: repoPath,
|
|
1631
|
-
query: search,
|
|
1632
|
-
queryFilters: filters,
|
|
1633
|
-
comparisonKey: comparisonKey,
|
|
1634
|
-
results: results,
|
|
1635
|
-
hasMore: true, // Assume there are more results since we were cancelled mid-search
|
|
1636
|
-
paging: limit || skipCursor
|
|
1637
|
-
? {
|
|
1638
|
-
limit: limit || count,
|
|
1639
|
-
cursor: skipCursor
|
|
1640
|
-
? {
|
|
1641
|
-
search: search,
|
|
1642
|
-
state: {
|
|
1643
|
-
iterations: iterations,
|
|
1644
|
-
totalSeen: totalSeen,
|
|
1645
|
-
sha: skipCursor.sha,
|
|
1646
|
-
skip: skipCursor.skip,
|
|
1647
|
-
},
|
|
1648
|
-
}
|
|
1649
|
-
: undefined,
|
|
1650
|
-
}
|
|
1651
|
-
: undefined,
|
|
1652
|
-
};
|
|
1653
|
-
}
|
|
1654
|
-
const classified = classifySearchError(ex);
|
|
1655
|
-
throw new GitSearchError(ex, classified?.reason, classified?.detail);
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
catch (ex) {
|
|
1659
|
-
if (ex instanceof GitSearchError)
|
|
1660
|
-
throw ex;
|
|
1661
|
-
const classified = classifySearchError(ex);
|
|
1662
|
-
throw new GitSearchError(ex, classified?.reason, classified?.detail);
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
100
|
+
/** Compare the inputs that can rewrite existing commits without moving branch tips. */
|
|
101
|
+
function getAncestryChange(prior, current) {
|
|
102
|
+
if (prior.shallowBoundary == null || current.shallowBoundary == null || prior.shallowBoundary !== current.shallowBoundary) return "shallow-changed";
|
|
103
|
+
if (prior.refTips == null || current.refTips == null) return "replace-refs-changed";
|
|
104
|
+
for (const [ref, sha] of prior.refTips) if (ref.startsWith("refs/replace/") && current.refTips.get(ref) !== sha) return "replace-refs-changed";
|
|
105
|
+
for (const ref of current.refTips.keys()) if (ref.startsWith("refs/replace/") && !prior.refTips.has(ref)) return "replace-refs-changed";
|
|
1665
106
|
}
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
107
|
+
var GraphGitSubProvider = class {
|
|
108
|
+
context;
|
|
109
|
+
git;
|
|
110
|
+
cache;
|
|
111
|
+
provider;
|
|
112
|
+
constructor(context, git, cache, provider) {
|
|
113
|
+
this.context = context;
|
|
114
|
+
this.git = git;
|
|
115
|
+
this.cache = cache;
|
|
116
|
+
this.provider = provider;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Current ref tips (canonical refname → PEELED commit sha), for the R6b fast path's gate. Peeled so an
|
|
120
|
+
* annotated tag maps to the commit its badge sits on — the same convention {@link GraphIncrementalSeed.tips}
|
|
121
|
+
* uses — and so the seed↔current diff is by commit identity. Covers heads/remotes/tags/replace (all the
|
|
122
|
+
* namespaces the gate consumers read); the caller filters to the ref classes it cares about.
|
|
123
|
+
*/
|
|
124
|
+
async getCurrentRefTips(repoPath, cancellation) {
|
|
125
|
+
const tips = /* @__PURE__ */ new Map();
|
|
126
|
+
try {
|
|
127
|
+
const records = await this.provider.refs.getRefs(repoPath, cancellation, { force: true });
|
|
128
|
+
for (const record of records) {
|
|
129
|
+
if (!record.name) continue;
|
|
130
|
+
tips.set(record.name, record.peeledObjectname || record.objectname);
|
|
131
|
+
}
|
|
132
|
+
} catch (ex) {
|
|
133
|
+
if (isCancellationError(ex) || cancellation?.aborted) throw ex;
|
|
134
|
+
}
|
|
135
|
+
return tips;
|
|
136
|
+
}
|
|
137
|
+
/** Read the actual boundary from the common git directory, including linked worktrees and bare repos. */
|
|
138
|
+
async getShallowBoundary(repoPath, cancellation) {
|
|
139
|
+
const scope = getScopedLogger();
|
|
140
|
+
try {
|
|
141
|
+
const path = (await this.git.run({
|
|
142
|
+
cwd: repoPath,
|
|
143
|
+
configs: gitConfigsLog,
|
|
144
|
+
cancellation,
|
|
145
|
+
errors: "throw"
|
|
146
|
+
}, "rev-parse", "--git-path", "shallow")).stdout.trim();
|
|
147
|
+
if (!path) return void 0;
|
|
148
|
+
const contents = await this.context.fs.readFile(this.provider.getAbsoluteUri(path, repoPath)).catch((ex) => {
|
|
149
|
+
const code = ex.code;
|
|
150
|
+
if (code === "ENOENT" || code === "FileNotFound") return void 0;
|
|
151
|
+
throw ex;
|
|
152
|
+
});
|
|
153
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
154
|
+
return contents == null ? "" : new TextDecoder().decode(contents).trim().split(/\s+/).sort().join("\n");
|
|
155
|
+
} catch (ex) {
|
|
156
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
157
|
+
if (isCancellationError(ex)) throw ex;
|
|
158
|
+
scope?.warn(`Unable to read shallow boundary for '${repoPath}': ${String(ex)}`);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** Whether `oldSha` is an ancestor of `newSha` (i.e. the ref moved fast-forward). */
|
|
163
|
+
async isFastForward(repoPath, oldSha, newSha, cancellation) {
|
|
164
|
+
return (await this.git.run({
|
|
165
|
+
cwd: repoPath,
|
|
166
|
+
cancellation,
|
|
167
|
+
errors: "ignore"
|
|
168
|
+
}, "merge-base", "--is-ancestor", oldSha, newSha)).exitCode === 0;
|
|
169
|
+
}
|
|
170
|
+
async openGraphSession(repoPath, options, cancellation) {
|
|
171
|
+
const getWalkShape = () => {
|
|
172
|
+
const cfg = this.context.config;
|
|
173
|
+
return {
|
|
174
|
+
ordering: cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? "date",
|
|
175
|
+
onlyFollowFirstParent: cfg?.graph?.onlyFollowFirstParent ?? false
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
const session = new GraphSession(this, repoPath, options?.rowProcessor, getWalkShape);
|
|
179
|
+
await session.initialize(options, cancellation);
|
|
180
|
+
return session;
|
|
181
|
+
}
|
|
182
|
+
async getGraph(repoPath, rev, options, cancellation) {
|
|
183
|
+
const scope = getScopedLogger();
|
|
184
|
+
const cfg = this.context.config;
|
|
185
|
+
const defaultLimit = options?.limit ?? 5e3;
|
|
186
|
+
const ordering = cfg?.graph?.commitOrdering ?? cfg?.commits.ordering ?? "date";
|
|
187
|
+
const onlyFollowFirstParent = cfg?.graph?.onlyFollowFirstParent ?? false;
|
|
188
|
+
const deferStats = options?.include?.stats;
|
|
189
|
+
let rowsStatsSeed = options?.rowsStatsSeed;
|
|
190
|
+
const parser = getGraphParser(options?.include?.stats && !deferStats);
|
|
191
|
+
const shaParser = getShaLogParser();
|
|
192
|
+
const statsParser = getShaAndStatsLogParser();
|
|
193
|
+
const stashPromise = this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation);
|
|
194
|
+
const prespawnAborter = new AbortController();
|
|
195
|
+
const onPrespawnCancel = () => prespawnAborter.abort();
|
|
196
|
+
cancellation?.addEventListener("abort", onPrespawnCancel, { once: true });
|
|
197
|
+
if (cancellation?.aborted) onPrespawnCancel();
|
|
198
|
+
let prespawn = (async () => {
|
|
199
|
+
try {
|
|
200
|
+
const gitStash = await stashPromise;
|
|
201
|
+
const { stdin } = convertStashesToStdin(gitStash?.stashes);
|
|
202
|
+
const args = [
|
|
203
|
+
"log",
|
|
204
|
+
...parser.arguments,
|
|
205
|
+
`--${ordering}-order`,
|
|
206
|
+
"--all"
|
|
207
|
+
];
|
|
208
|
+
if (stdin) args.push("--stdin");
|
|
209
|
+
if (onlyFollowFirstParent) args.push("--first-parent");
|
|
210
|
+
return { stream: this.git.stream({
|
|
211
|
+
cwd: repoPath,
|
|
212
|
+
configs: gitConfigsLog,
|
|
213
|
+
cancellation: prespawnAborter.signal,
|
|
214
|
+
stdin,
|
|
215
|
+
env: { GIT_FLUSH: "0" }
|
|
216
|
+
}, ...args, "--") };
|
|
217
|
+
} catch {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
})();
|
|
221
|
+
const refTipsPromise = this.getCurrentRefTips(repoPath, cancellation);
|
|
222
|
+
const shallowBoundaryPromise = this.getShallowBoundary(repoPath, cancellation);
|
|
223
|
+
const [shaResult, stashResult, branchesResult, remotesResult, currentUserResult, worktreesResult, defaultBranchResult, refTipsResult, shallowBoundaryResult] = await Promise.allSettled([
|
|
224
|
+
!isUncommitted(rev, true) ? this.git.run({
|
|
225
|
+
cwd: repoPath,
|
|
226
|
+
configs: gitConfigsLog
|
|
227
|
+
}, "log", ...shaParser.arguments, "-n1", rev ?? "HEAD", "--") : void 0,
|
|
228
|
+
stashPromise,
|
|
229
|
+
this.provider.branches.getBranches(repoPath, void 0, cancellation),
|
|
230
|
+
this.provider.remotes.getRemotes(repoPath, void 0, cancellation),
|
|
231
|
+
this.provider.config.getCurrentUser(repoPath),
|
|
232
|
+
this.provider.worktrees?.getWorktrees(repoPath, cancellation).then((w) => [w, groupWorktreesByBranch(w, { includeDefault: true })]),
|
|
233
|
+
this.provider.branches.getDefaultBranchName(repoPath, void 0, { local: true }, cancellation),
|
|
234
|
+
refTipsPromise,
|
|
235
|
+
shallowBoundaryPromise
|
|
236
|
+
]);
|
|
237
|
+
const branches = getSettledValue(branchesResult)?.values;
|
|
238
|
+
const branchMap = branches != null ? new Map(branches.map((r) => [r.name, r])) : /* @__PURE__ */ new Map();
|
|
239
|
+
const headBranch = branches?.find((b) => b.current);
|
|
240
|
+
const headRefUpstreamName = headBranch?.upstream?.name;
|
|
241
|
+
const [worktrees, worktreesByBranch] = getSettledValue(worktreesResult) ?? [[], /* @__PURE__ */ new Map()];
|
|
242
|
+
const defaultBranchName = getSettledValue(defaultBranchResult);
|
|
243
|
+
const defaultLocalName = defaultBranchName != null ? getBranchNameWithoutRemote(defaultBranchName) : void 0;
|
|
244
|
+
let branchIdOfMainWorktree;
|
|
245
|
+
let mainWorktree;
|
|
246
|
+
if (worktreesByBranch != null) {
|
|
247
|
+
const defaultEntry = find(worktreesByBranch, ([, wt]) => wt.isDefault);
|
|
248
|
+
if (defaultEntry != null) {
|
|
249
|
+
[branchIdOfMainWorktree, mainWorktree] = defaultEntry;
|
|
250
|
+
worktreesByBranch.delete(branchIdOfMainWorktree);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const currentUser = getSettledValue(currentUserResult);
|
|
254
|
+
const remotes = getSettledValue(remotesResult);
|
|
255
|
+
const remoteMap = remotes != null ? new Map(remotes.map((r) => [r.name, r])) : /* @__PURE__ */ new Map();
|
|
256
|
+
const decorationFingerprint = computeDecorationFingerprint(repoPath, defaultBranchName, defaultLocalName, headRefUpstreamName, branches, remotes, worktrees, currentUser);
|
|
257
|
+
const shas = getSettledValue(shaResult)?.stdout;
|
|
258
|
+
const selectSha = shas != null ? first(shaParser.parse(shas)) : void 0;
|
|
259
|
+
let refTips;
|
|
260
|
+
if (refTipsResult.status === "rejected") throw refTipsResult.reason;
|
|
261
|
+
else refTips = refTipsResult.value;
|
|
262
|
+
if (shallowBoundaryResult.status === "rejected") throw shallowBoundaryResult.reason;
|
|
263
|
+
const shallowBoundary = shallowBoundaryResult.value;
|
|
264
|
+
const ancestrySeed = options?.ancestrySeed ?? (options?.incrementalSeed != null ? {
|
|
265
|
+
shallowBoundary: options.incrementalSeed.shallowBoundary,
|
|
266
|
+
refTips: options.incrementalSeed.tips
|
|
267
|
+
} : void 0);
|
|
268
|
+
const ancestryChange = ancestrySeed != null ? getAncestryChange(ancestrySeed, {
|
|
269
|
+
shallowBoundary,
|
|
270
|
+
refTips
|
|
271
|
+
}) : void 0;
|
|
272
|
+
if (ancestryChange != null || ancestrySeed == null) rowsStatsSeed = void 0;
|
|
273
|
+
const downstreamMap = /* @__PURE__ */ new Map();
|
|
274
|
+
const gitStash = getSettledValue(stashResult);
|
|
275
|
+
const { stdin, remappedIds } = convertStashesToStdin(gitStash?.stashes);
|
|
276
|
+
const avatars = /* @__PURE__ */ new Map();
|
|
277
|
+
const ids = /* @__PURE__ */ new Set();
|
|
278
|
+
const reachableFromHEAD = /* @__PURE__ */ new Set();
|
|
279
|
+
const rewriteableFromHEAD = /* @__PURE__ */ new Set();
|
|
280
|
+
let headSha;
|
|
281
|
+
let rewriteableNextSha;
|
|
282
|
+
const undoableTipShas = /* @__PURE__ */ new Set();
|
|
283
|
+
if (headBranch?.sha != null) undoableTipShas.add(headBranch.sha);
|
|
284
|
+
for (const wt of worktrees) if (wt.sha != null) undoableTipShas.add(wt.sha);
|
|
285
|
+
const tipShasWithChildren = /* @__PURE__ */ new Set();
|
|
286
|
+
const reachableFromHeadUpstream = /* @__PURE__ */ new Set();
|
|
287
|
+
const reachableRefs = /* @__PURE__ */ new Map();
|
|
288
|
+
const reachabilityBuilder = createReachabilityTableBuilder(options?.reachabilitySeed);
|
|
289
|
+
const internCache = /* @__PURE__ */ new WeakMap();
|
|
290
|
+
function finalizeRowReachability(row, sha, refs) {
|
|
291
|
+
let setIndex;
|
|
292
|
+
const cached = refs != null ? internCache.get(refs) : void 0;
|
|
293
|
+
if (cached != null && cached.size === refs.size) setIndex = cached.index;
|
|
294
|
+
else {
|
|
295
|
+
setIndex = reachabilityBuilder.intern(refs?.values());
|
|
296
|
+
if (refs != null) internCache.set(refs, {
|
|
297
|
+
size: refs.size,
|
|
298
|
+
index: setIndex
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
if (setIndex != null) (row.contexts ??= {}).reachabilityIndex = setIndex;
|
|
302
|
+
row.reachability = void 0;
|
|
303
|
+
reachableRefs.delete(sha);
|
|
304
|
+
}
|
|
305
|
+
const rowStats = /* @__PURE__ */ new Map();
|
|
306
|
+
let pendingRowsStatsCount = 0;
|
|
307
|
+
let iterations = 0;
|
|
308
|
+
let total = 0;
|
|
309
|
+
const rowProcessor = options?.rowProcessor;
|
|
310
|
+
const graphCtx = rowProcessor != null ? {
|
|
311
|
+
repoPath,
|
|
312
|
+
useAvatars: cfg?.graph?.avatars ?? true,
|
|
313
|
+
branches: branchMap,
|
|
314
|
+
remotes: remoteMap,
|
|
315
|
+
worktreesByBranch,
|
|
316
|
+
branchIdOfMainWorktree,
|
|
317
|
+
stashes: gitStash?.stashes,
|
|
318
|
+
reachableFromHEAD,
|
|
319
|
+
rewriteableFromHEAD,
|
|
320
|
+
tipShasWithChildren,
|
|
321
|
+
reachableFromHeadUpstream: headRefUpstreamName != null ? reachableFromHeadUpstream : void 0,
|
|
322
|
+
avatars
|
|
323
|
+
} : void 0;
|
|
324
|
+
function buildRowFromCommit(commit) {
|
|
325
|
+
total++;
|
|
326
|
+
let shaOrRemapped = remappedIds.get(commit.sha);
|
|
327
|
+
if (shaOrRemapped && ids.has(shaOrRemapped)) return void 0;
|
|
328
|
+
shaOrRemapped ??= commit.sha;
|
|
329
|
+
ids.add(shaOrRemapped);
|
|
330
|
+
const refHeads = [];
|
|
331
|
+
const refRemoteHeads = [];
|
|
332
|
+
const refTags = [];
|
|
333
|
+
let head = false;
|
|
334
|
+
let sawHead = false;
|
|
335
|
+
if (commit.tips) for (let tip of commit.tips.split(", ")) {
|
|
336
|
+
head = false;
|
|
337
|
+
if (tip === "refs/stash") continue;
|
|
338
|
+
if (tip.startsWith("tag: ")) {
|
|
339
|
+
const tagName = tip.substring(5);
|
|
340
|
+
refTags.push({
|
|
341
|
+
id: getTagId(repoPath, tagName),
|
|
342
|
+
name: tagName,
|
|
343
|
+
annotated: true
|
|
344
|
+
});
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
if (tip.startsWith("HEAD")) {
|
|
348
|
+
head = true;
|
|
349
|
+
sawHead = true;
|
|
350
|
+
if (tip !== "HEAD") tip = tip.substring(8);
|
|
351
|
+
}
|
|
352
|
+
const remoteName = getRemoteNameFromBranchName(tip);
|
|
353
|
+
if (remoteName) {
|
|
354
|
+
const remote = remoteMap.get(remoteName);
|
|
355
|
+
if (remote != null) {
|
|
356
|
+
const branchName = getBranchNameWithoutRemote(tip);
|
|
357
|
+
if (branchName === "HEAD") continue;
|
|
358
|
+
refRemoteHeads.push({
|
|
359
|
+
id: getBranchId(repoPath, true, tip),
|
|
360
|
+
name: branchName,
|
|
361
|
+
owner: remote.name,
|
|
362
|
+
url: remote.url,
|
|
363
|
+
current: tip === headRefUpstreamName,
|
|
364
|
+
isDefault: tip === defaultBranchName && !branchMap.has(defaultLocalName),
|
|
365
|
+
hostingServiceType: remote.provider?.gkProviderId,
|
|
366
|
+
starred: branchMap.get(tip)?.starred || void 0
|
|
367
|
+
});
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
const branch = branchMap.get(tip);
|
|
372
|
+
const branchId = branch?.id ?? getBranchId(repoPath, false, tip);
|
|
373
|
+
const worktree = worktreesByBranch?.get(branchId) ?? (branchId === branchIdOfMainWorktree ? mainWorktree : void 0);
|
|
374
|
+
const worktreeRef = worktree != null ? {
|
|
375
|
+
id: getWorktreeId(repoPath, worktree.name),
|
|
376
|
+
path: worktree.path,
|
|
377
|
+
isDefault: worktree.isDefault === true
|
|
378
|
+
} : void 0;
|
|
379
|
+
refHeads.push({
|
|
380
|
+
id: branchId,
|
|
381
|
+
name: tip,
|
|
382
|
+
isCurrentHead: head,
|
|
383
|
+
upstream: branch?.upstream != null ? {
|
|
384
|
+
name: branch.upstream.name,
|
|
385
|
+
id: getBranchId(repoPath, true, branch.upstream.name),
|
|
386
|
+
missing: branch.upstream.missing,
|
|
387
|
+
state: {
|
|
388
|
+
ahead: branch.upstream.state.ahead,
|
|
389
|
+
behind: branch.upstream.state.behind
|
|
390
|
+
}
|
|
391
|
+
} : void 0,
|
|
392
|
+
worktree: worktreeRef,
|
|
393
|
+
isDefault: defaultLocalName != null && tip === defaultLocalName,
|
|
394
|
+
starred: branch?.starred || void 0
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
const parents = commit.parents ? commit.parents.split(" ") : [];
|
|
398
|
+
const stash = gitStash?.stashes.get(shaOrRemapped);
|
|
399
|
+
let row;
|
|
400
|
+
if (stash != null) row = {
|
|
401
|
+
sha: shaOrRemapped,
|
|
402
|
+
parents: parents.slice(0, 1),
|
|
403
|
+
author: currentUser?.name ?? commit.author,
|
|
404
|
+
email: commit.authorEmail,
|
|
405
|
+
date: Number(ordering === "author-date" ? commit.authorDate : commit.committerDate) * 1e3,
|
|
406
|
+
commitDate: Number(commit.committerDate) * 1e3,
|
|
407
|
+
message: (stash.message ?? commit.message).trim(),
|
|
408
|
+
kind: "stash",
|
|
409
|
+
stashNumber: stash.stashNumber,
|
|
410
|
+
heads: refHeads.length ? refHeads : void 0,
|
|
411
|
+
remotes: refRemoteHeads.length ? refRemoteHeads : void 0,
|
|
412
|
+
tags: refTags.length ? refTags : void 0,
|
|
413
|
+
isCurrentUser: true
|
|
414
|
+
};
|
|
415
|
+
else {
|
|
416
|
+
const isCurrentUser = isUserMatch(currentUser, commit.author, commit.authorEmail);
|
|
417
|
+
row = {
|
|
418
|
+
sha: shaOrRemapped,
|
|
419
|
+
parents: onlyFollowFirstParent ? parents.slice(0, 1) : parents,
|
|
420
|
+
author: commit.author,
|
|
421
|
+
email: commit.authorEmail,
|
|
422
|
+
date: Number(ordering === "author-date" ? commit.authorDate : commit.committerDate) * 1e3,
|
|
423
|
+
commitDate: Number(commit.committerDate) * 1e3,
|
|
424
|
+
message: commit.message.trim(),
|
|
425
|
+
kind: parents.length > 1 ? "merge" : "commit",
|
|
426
|
+
heads: refHeads.length ? refHeads : void 0,
|
|
427
|
+
remotes: refRemoteHeads.length ? refRemoteHeads : void 0,
|
|
428
|
+
tags: refTags.length ? refTags : void 0,
|
|
429
|
+
isCurrentUser: isCurrentUser || void 0
|
|
430
|
+
};
|
|
431
|
+
if (commit.stats != null) rowStats.set(shaOrRemapped, commit.stats);
|
|
432
|
+
}
|
|
433
|
+
return {
|
|
434
|
+
row,
|
|
435
|
+
refHeads,
|
|
436
|
+
refRemoteHeads,
|
|
437
|
+
refTags,
|
|
438
|
+
head: sawHead,
|
|
439
|
+
parents
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
function accumulateRowState(sha, parents, refHeads, refRemoteHeads, refTags, head, isStash) {
|
|
443
|
+
if (head) {
|
|
444
|
+
reachableFromHEAD.add(sha);
|
|
445
|
+
headSha ??= sha;
|
|
446
|
+
}
|
|
447
|
+
if (reachableFromHEAD.has(sha)) for (const parent of parents) reachableFromHEAD.add(parent);
|
|
448
|
+
if (sha === headSha || sha === rewriteableNextSha) {
|
|
449
|
+
if (parents.length === 1) {
|
|
450
|
+
rewriteableFromHEAD.add(sha);
|
|
451
|
+
rewriteableNextSha = parents[0];
|
|
452
|
+
} else rewriteableNextSha = void 0;
|
|
453
|
+
}
|
|
454
|
+
if (refRemoteHeads.some((r) => r.current)) reachableFromHeadUpstream.add(sha);
|
|
455
|
+
if (reachableFromHeadUpstream.has(sha)) for (const parent of parents) reachableFromHeadUpstream.add(parent);
|
|
456
|
+
if (refHeads.length > 0 || refRemoteHeads.length > 0 || refTags.length > 0) {
|
|
457
|
+
let refs = reachableRefs.get(sha);
|
|
458
|
+
if (refs == null) {
|
|
459
|
+
refs = /* @__PURE__ */ new Map();
|
|
460
|
+
reachableRefs.set(sha, refs);
|
|
461
|
+
}
|
|
462
|
+
for (const h of refHeads) refs.set(`b:${h.name}`, {
|
|
463
|
+
refType: "branch",
|
|
464
|
+
name: h.name,
|
|
465
|
+
remote: false,
|
|
466
|
+
current: h.isCurrentHead
|
|
467
|
+
});
|
|
468
|
+
for (const r of refRemoteHeads) {
|
|
469
|
+
const name = `${r.owner}/${r.name}`;
|
|
470
|
+
refs.set(`r:${name}`, {
|
|
471
|
+
refType: "branch",
|
|
472
|
+
name,
|
|
473
|
+
remote: true
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
for (const t of refTags) refs.set(`t:${t.name}`, {
|
|
477
|
+
refType: "tag",
|
|
478
|
+
name: t.name
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
const currentRefs = reachableRefs.get(sha);
|
|
482
|
+
if (currentRefs != null && currentRefs.size > 0) {
|
|
483
|
+
let transferred = false;
|
|
484
|
+
for (const parent of parents) {
|
|
485
|
+
const parentRefs = reachableRefs.get(parent);
|
|
486
|
+
if (parentRefs == null) {
|
|
487
|
+
if (transferred) reachableRefs.set(parent, new Map(currentRefs));
|
|
488
|
+
else {
|
|
489
|
+
transferred = true;
|
|
490
|
+
reachableRefs.set(parent, currentRefs);
|
|
491
|
+
}
|
|
492
|
+
continue;
|
|
493
|
+
}
|
|
494
|
+
for (const [key, ref] of currentRefs) if (!parentRefs.has(key)) parentRefs.set(key, ref);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (!isStash) {
|
|
498
|
+
for (const parent of parents) if (undoableTipShas.has(parent)) tipShasWithChildren.add(parent);
|
|
499
|
+
}
|
|
500
|
+
for (const h of refHeads) if (h.upstream?.name != null) {
|
|
501
|
+
let downstreams = downstreamMap.get(h.upstream.name);
|
|
502
|
+
if (downstreams == null) {
|
|
503
|
+
downstreams = [];
|
|
504
|
+
downstreamMap.set(h.upstream.name, downstreams);
|
|
505
|
+
}
|
|
506
|
+
downstreams.push(h.name);
|
|
507
|
+
}
|
|
508
|
+
return reachableRefs.get(sha);
|
|
509
|
+
}
|
|
510
|
+
const buildRowsStatsDeferred = (rows) => {
|
|
511
|
+
if (!deferStats) return void 0;
|
|
512
|
+
pendingRowsStatsCount++;
|
|
513
|
+
return {
|
|
514
|
+
isLoaded: () => pendingRowsStatsCount === 0,
|
|
515
|
+
promise: new Promise(async (resolve) => {
|
|
516
|
+
try {
|
|
517
|
+
let missingStdin = "";
|
|
518
|
+
let missingStashStdin = "";
|
|
519
|
+
for (const row of rows) {
|
|
520
|
+
if (rowStats.has(row.sha)) continue;
|
|
521
|
+
const seeded = rowsStatsSeed?.get(row.sha);
|
|
522
|
+
if (seeded != null) {
|
|
523
|
+
rowStats.set(row.sha, seeded);
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
if (row.kind === "stash") missingStashStdin += `${row.sha}\n`;
|
|
527
|
+
else missingStdin += `${row.sha}\n`;
|
|
528
|
+
}
|
|
529
|
+
if (!missingStdin && !missingStashStdin) return;
|
|
530
|
+
const [statsResult, stashStatsResult] = await Promise.allSettled([missingStdin ? this.git.run({
|
|
531
|
+
cwd: repoPath,
|
|
532
|
+
configs: gitConfigsLog,
|
|
533
|
+
stdin: missingStdin,
|
|
534
|
+
priority: "background"
|
|
535
|
+
}, "log", "--no-walk", "--stdin", ...statsParser.arguments, "--") : void 0, missingStashStdin ? this.git.run({
|
|
536
|
+
cwd: repoPath,
|
|
537
|
+
configs: gitConfigsLog,
|
|
538
|
+
stdin: missingStashStdin,
|
|
539
|
+
priority: "background"
|
|
540
|
+
}, "log", "--no-walk", "--stdin", "-m", "--first-parent", ...statsParser.arguments, "--") : void 0]);
|
|
541
|
+
for (const result of [getSettledValue(statsResult), getSettledValue(stashStatsResult)]) {
|
|
542
|
+
if (!result?.stdout) continue;
|
|
543
|
+
for (const stat of statsParser.parse(result.stdout)) {
|
|
544
|
+
if (rowStats.has(stat.sha)) continue;
|
|
545
|
+
rowStats.set(stat.sha, stat.stats);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
} finally {
|
|
549
|
+
pendingRowsStatsCount--;
|
|
550
|
+
resolve();
|
|
551
|
+
}
|
|
552
|
+
})
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
const args = [
|
|
556
|
+
"log",
|
|
557
|
+
...parser.arguments,
|
|
558
|
+
`--${ordering}-order`,
|
|
559
|
+
"--all"
|
|
560
|
+
];
|
|
561
|
+
if (stdin) args.push("--stdin");
|
|
562
|
+
if (onlyFollowFirstParent) args.push("--first-parent");
|
|
563
|
+
async function getCommitsForGraphCore(limit, sha, cursor, cancellation) {
|
|
564
|
+
try {
|
|
565
|
+
try {
|
|
566
|
+
var _usingCtx$1 = _usingCtx();
|
|
567
|
+
iterations++;
|
|
568
|
+
const prespawned = cursor == null && prespawn != null ? await prespawn : void 0;
|
|
569
|
+
prespawn = void 0;
|
|
570
|
+
const aborter = prespawned != null ? prespawnAborter : new AbortController();
|
|
571
|
+
const onAbort = () => {
|
|
572
|
+
aborter.abort();
|
|
573
|
+
};
|
|
574
|
+
cancellation?.addEventListener("abort", onAbort, { once: true });
|
|
575
|
+
if (cancellation?.aborted) onAbort();
|
|
576
|
+
_usingCtx$1.u(createDisposable(() => cancellation?.removeEventListener("abort", onAbort)));
|
|
577
|
+
const stream = prespawned?.stream ?? this.git.stream({
|
|
578
|
+
cwd: repoPath,
|
|
579
|
+
configs: gitConfigsLog,
|
|
580
|
+
cancellation: aborter.signal,
|
|
581
|
+
stdin,
|
|
582
|
+
env: { GIT_FLUSH: "0" }
|
|
583
|
+
}, ...args, cursor?.skip ? `--skip=${cursor.skip}` : void 0, "--");
|
|
584
|
+
_usingCtx$1.u(createDisposable(() => void stream.return?.(void 0)));
|
|
585
|
+
const rows = [];
|
|
586
|
+
let count = 0;
|
|
587
|
+
let found = false;
|
|
588
|
+
let hasMore = false;
|
|
589
|
+
const batches = parser.parseAsyncBatched?.(stream) ?? (async function* (it) {
|
|
590
|
+
for await (const commit of it) yield [commit];
|
|
591
|
+
})(parser.parseAsync(stream));
|
|
592
|
+
outer: for await (const batch of batches) for (const commit of batch) {
|
|
593
|
+
if (limit && count >= limit && (!sha || found || count >= limit * 10) || !limit && sha && found) {
|
|
594
|
+
hasMore = true;
|
|
595
|
+
aborter.abort();
|
|
596
|
+
break outer;
|
|
597
|
+
}
|
|
598
|
+
if (sha && !found && commit.sha === sha) found = true;
|
|
599
|
+
count++;
|
|
600
|
+
if (ids.has(commit.sha)) continue;
|
|
601
|
+
const built = buildRowFromCommit(commit);
|
|
602
|
+
if (built == null) continue;
|
|
603
|
+
const { row, refHeads, refRemoteHeads, refTags, head, parents } = built;
|
|
604
|
+
const refs = accumulateRowState(row.sha, parents, refHeads, refRemoteHeads, refTags, head, row.kind === "stash");
|
|
605
|
+
row.reachability = refs?.size ? {
|
|
606
|
+
partial: true,
|
|
607
|
+
refs: [...refs.values()]
|
|
608
|
+
} : void 0;
|
|
609
|
+
rowProcessor?.processRow(row, graphCtx);
|
|
610
|
+
finalizeRowReachability(row, row.sha, refs);
|
|
611
|
+
rows.push(row);
|
|
612
|
+
}
|
|
613
|
+
const startingCursor = cursor?.sha;
|
|
614
|
+
const lastSha = last(ids);
|
|
615
|
+
cursor = lastSha != null ? {
|
|
616
|
+
sha: lastSha,
|
|
617
|
+
skip: total - iterations
|
|
618
|
+
} : void 0;
|
|
619
|
+
const rowsStatsDeferred = buildRowsStatsDeferred(rows);
|
|
620
|
+
return {
|
|
621
|
+
repoPath,
|
|
622
|
+
avatars,
|
|
623
|
+
ids,
|
|
624
|
+
includes: options?.include,
|
|
625
|
+
branches: branchMap,
|
|
626
|
+
remotes: remoteMap,
|
|
627
|
+
downstreams: downstreamMap,
|
|
628
|
+
stashes: gitStash?.stashes,
|
|
629
|
+
worktrees,
|
|
630
|
+
worktreesByBranch,
|
|
631
|
+
reachableFromHEAD,
|
|
632
|
+
rewriteableFromHEAD,
|
|
633
|
+
reachability: reachabilityBuilder.build(),
|
|
634
|
+
refTips,
|
|
635
|
+
decorationFingerprint,
|
|
636
|
+
shallowBoundary,
|
|
637
|
+
rows,
|
|
638
|
+
id: sha ?? rev,
|
|
639
|
+
rowsStats: rowStats,
|
|
640
|
+
rowsStatsDeferred,
|
|
641
|
+
paging: {
|
|
642
|
+
limit: limit === 0 ? count : limit,
|
|
643
|
+
startingCursor,
|
|
644
|
+
hasMore
|
|
645
|
+
},
|
|
646
|
+
more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation)
|
|
647
|
+
};
|
|
648
|
+
} catch (_) {
|
|
649
|
+
_usingCtx$1.e = _;
|
|
650
|
+
} finally {
|
|
651
|
+
_usingCtx$1.d();
|
|
652
|
+
}
|
|
653
|
+
} catch (ex) {
|
|
654
|
+
scope?.error(ex);
|
|
655
|
+
debugger;
|
|
656
|
+
throw ex;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
let incrementalFallbackReason;
|
|
660
|
+
const tryIncrementalGraph = async (seed) => {
|
|
661
|
+
const onResult = options?.onIncrementalResult;
|
|
662
|
+
const rebindFromRepoPath = options?.rebindFromRepoPath;
|
|
663
|
+
const fallback = (reason) => {
|
|
664
|
+
incrementalFallbackReason = reason;
|
|
665
|
+
onResult?.({
|
|
666
|
+
path: "fallback",
|
|
667
|
+
reason
|
|
668
|
+
});
|
|
669
|
+
};
|
|
670
|
+
if (ancestryChange != null) {
|
|
671
|
+
fallback(ancestryChange);
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
if (rowProcessor == null || graphCtx == null) {
|
|
675
|
+
fallback("no-row-processor");
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
if (ordering !== "date" || seed.ordering !== "date") {
|
|
679
|
+
fallback("ordering-not-date");
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
const seedShas = new Set(seed.rows.map((r) => r.sha));
|
|
683
|
+
if (rev != null && !seedShas.has(rev)) {
|
|
684
|
+
fallback("rev-outside-seed");
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
if (onlyFollowFirstParent || seed.onlyFollowFirstParent) {
|
|
688
|
+
fallback("first-parent");
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
const currentHeadSha = rev == null ? selectSha : headBranch?.sha;
|
|
692
|
+
const currentTips = refTips;
|
|
693
|
+
const affected = /* @__PURE__ */ new Set();
|
|
694
|
+
const ffPairs = [];
|
|
695
|
+
const addTrackingBranchRows = (remoteRefname) => {
|
|
696
|
+
if (branches == null || !remoteRefname.startsWith("refs/remotes/")) return;
|
|
697
|
+
const upstreamName = remoteRefname.substring(13);
|
|
698
|
+
for (const b of branches) if (b.upstream?.name === upstreamName && b.sha != null && seedShas.has(b.sha)) affected.add(b.sha);
|
|
699
|
+
};
|
|
700
|
+
for (const [refname, oldSha] of seed.tips) {
|
|
701
|
+
if (!isMoveableGraphRef(refname)) continue;
|
|
702
|
+
const cur = currentTips.get(refname);
|
|
703
|
+
if (cur == null) {
|
|
704
|
+
fallback("ref-deleted");
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
if (cur !== oldSha) {
|
|
708
|
+
ffPairs.push([oldSha, cur]);
|
|
709
|
+
if (seedShas.has(oldSha)) affected.add(oldSha);
|
|
710
|
+
if (seedShas.has(cur)) affected.add(cur);
|
|
711
|
+
addTrackingBranchRows(refname);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
for (const [refname, cur] of currentTips) {
|
|
715
|
+
if (!isMoveableGraphRef(refname) || seed.tips.has(refname)) continue;
|
|
716
|
+
if (seedShas.has(cur)) affected.add(cur);
|
|
717
|
+
addTrackingBranchRows(refname);
|
|
718
|
+
}
|
|
719
|
+
if (ffPairs.length > 0) {
|
|
720
|
+
const ffCheckChunkSize = 4;
|
|
721
|
+
for (let i = 0; i < ffPairs.length; i += ffCheckChunkSize) if ((await Promise.all(ffPairs.slice(i, i + ffCheckChunkSize).map(([oldSha, newSha]) => this.isFastForward(repoPath, oldSha, newSha, cancellation)))).some((ok) => !ok)) {
|
|
722
|
+
fallback("ref-non-fast-forward");
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
const priorHeadRow = seed.rows.find((r) => r.heads?.some((h) => h.isCurrentHead));
|
|
727
|
+
const priorHeadSha = priorHeadRow?.sha;
|
|
728
|
+
const priorHeadName = priorHeadRow?.heads?.find((h) => h.isCurrentHead)?.name;
|
|
729
|
+
const currentHeadName = headBranch?.name;
|
|
730
|
+
if (priorHeadSha !== currentHeadSha || priorHeadName !== currentHeadName) {
|
|
731
|
+
if (priorHeadSha != null && seedShas.has(priorHeadSha)) affected.add(priorHeadSha);
|
|
732
|
+
if (currentHeadSha != null && seedShas.has(currentHeadSha)) affected.add(currentHeadSha);
|
|
733
|
+
}
|
|
734
|
+
const currentStashShas = gitStash?.stashes != null ? new Set(gitStash.stashes.keys()) : /* @__PURE__ */ new Set();
|
|
735
|
+
const priorStashShas = seed.rows.filter((r) => r.kind === "stash").map((r) => r.sha);
|
|
736
|
+
if (priorStashShas.length !== currentStashShas.size || priorStashShas.some((s) => !currentStashShas.has(s))) {
|
|
737
|
+
fallback("stash-changed");
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
const seedComparableFingerprint = rebindFromRepoPath != null ? computeDecorationFingerprint(rebindFromRepoPath, defaultBranchName, defaultLocalName, seed.headRefUpstreamName, branches, remotes, worktrees, currentUser) : decorationFingerprint;
|
|
741
|
+
if (seed.decorationFingerprint !== seedComparableFingerprint) {
|
|
742
|
+
fallback("metadata-changed");
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
if (rebindFromRepoPath != null) {
|
|
746
|
+
const defaultWorktree = worktrees.find((w) => w.isDefault);
|
|
747
|
+
if (rebindFromRepoPath === defaultWorktree?.path) {
|
|
748
|
+
if (priorHeadName !== defaultWorktree.branch?.name) {
|
|
749
|
+
fallback("metadata-changed");
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
for (const r of seed.rows) {
|
|
755
|
+
if (r.heads == null) continue;
|
|
756
|
+
for (const h of r.heads) {
|
|
757
|
+
const currentBranch = branchMap.get(h.name);
|
|
758
|
+
if (currentBranch == null) continue;
|
|
759
|
+
if (h.upstream?.name !== currentBranch.upstream?.name) {
|
|
760
|
+
fallback("metadata-changed");
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
const notShas = new Set(seed.tips.values());
|
|
766
|
+
for (const s of currentStashShas) notShas.add(s);
|
|
767
|
+
let exclusionsStdin = "";
|
|
768
|
+
for (const s of notShas) exclusionsStdin += `^${s}\n`;
|
|
769
|
+
const enumResult = await this.git.run({
|
|
770
|
+
cwd: repoPath,
|
|
771
|
+
configs: gitConfigsLog,
|
|
772
|
+
cancellation,
|
|
773
|
+
stdin: exclusionsStdin
|
|
774
|
+
}, "log", ...parser.arguments, "--date-order", "--all", "--stdin", "--");
|
|
775
|
+
const newCommits = [...parser.parse(enumResult.stdout)];
|
|
776
|
+
let maxSeedDate = Number.NEGATIVE_INFINITY;
|
|
777
|
+
for (const r of seed.rows) if (r.date > maxSeedDate) maxSeedDate = r.date;
|
|
778
|
+
for (const c of newCommits) if (Number(c.committerDate) * 1e3 <= maxSeedDate) {
|
|
779
|
+
fallback("date-boundary");
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
const stitchedSize = newCommits.length + seed.rows.length;
|
|
783
|
+
const seedHasMore = seed.hasMore === true;
|
|
784
|
+
const noLimit = defaultLimit === 0;
|
|
785
|
+
const revWindowIndex = rev != null ? newCommits.length + seed.rows.findIndex((r) => r.sha === rev) : -1;
|
|
786
|
+
const targetRows = rev != null ? noLimit ? revWindowIndex + 1 : Math.max(defaultLimit, revWindowIndex + 1) : defaultLimit;
|
|
787
|
+
if ((rev != null ? targetRows > stitchedSize : noLimit || defaultLimit > stitchedSize) && seedHasMore) {
|
|
788
|
+
fallback("limit-exceeds-seed");
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
const trimTo = rev != null ? Math.min(targetRows, stitchedSize) : noLimit ? stitchedSize : Math.min(defaultLimit, stitchedSize);
|
|
792
|
+
const hasMore = trimTo < stitchedSize || seedHasMore;
|
|
793
|
+
if (currentStashShas.size > 0 && hasMore) {
|
|
794
|
+
fallback("stash-window-conflict");
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
const newRows = [];
|
|
798
|
+
for (const c of newCommits) {
|
|
799
|
+
const built = buildRowFromCommit(c);
|
|
800
|
+
if (built != null) newRows.push(built.row);
|
|
801
|
+
}
|
|
802
|
+
const refetched = /* @__PURE__ */ new Map();
|
|
803
|
+
if (affected.size > 0) {
|
|
804
|
+
const refetchResult = await this.git.run({
|
|
805
|
+
cwd: repoPath,
|
|
806
|
+
configs: gitConfigsLog,
|
|
807
|
+
cancellation,
|
|
808
|
+
stdin: join(affected, "\n")
|
|
809
|
+
}, "log", ...parser.arguments, "--no-walk", "--stdin", "--");
|
|
810
|
+
for (const c of parser.parse(refetchResult.stdout)) {
|
|
811
|
+
const built = buildRowFromCommit(c);
|
|
812
|
+
if (built != null) refetched.set(built.row.sha, built.row);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
const freshShas = /* @__PURE__ */ new Set([...newRows.map((r) => r.sha), ...refetched.keys()]);
|
|
816
|
+
const windowRows = [...newRows];
|
|
817
|
+
for (const r of seed.rows) windowRows.push(refetched.get(r.sha) ?? r);
|
|
818
|
+
windowRows.length = Math.min(windowRows.length, trimTo);
|
|
819
|
+
ids.clear();
|
|
820
|
+
total = 0;
|
|
821
|
+
for (const row of windowRows) {
|
|
822
|
+
ids.add(row.sha);
|
|
823
|
+
total++;
|
|
824
|
+
const fresh = freshShas.has(row.sha);
|
|
825
|
+
if (!fresh) options?.onMutationStart?.();
|
|
826
|
+
if (rebindFromRepoPath != null && !fresh && row.remotes != null) for (const remoteHead of row.remotes) remoteHead.current = `${remoteHead.owner}/${remoteHead.name}` === headRefUpstreamName;
|
|
827
|
+
const refs = accumulateRowState(row.sha, row.parents, row.heads ?? [], row.remotes ?? [], row.tags ?? [], row.sha === currentHeadSha, row.kind === "stash");
|
|
828
|
+
if (fresh) {
|
|
829
|
+
row.reachability = refs?.size ? {
|
|
830
|
+
partial: true,
|
|
831
|
+
refs: [...refs.values()]
|
|
832
|
+
} : void 0;
|
|
833
|
+
rowProcessor.processRow(row, graphCtx);
|
|
834
|
+
} else if (rebindFromRepoPath != null && restampGraphRowIds(row, rebindFromRepoPath, repoPath)) rowProcessor.restampRow?.(row, graphCtx);
|
|
835
|
+
if (row.kind !== "stash") (row.contexts ??= {}).flags = computeGraphRowContextFlags(row.sha, refs?.values(), graphCtx);
|
|
836
|
+
finalizeRowReachability(row, row.sha, refs);
|
|
837
|
+
}
|
|
838
|
+
iterations = 1;
|
|
839
|
+
const lastSha = last(ids);
|
|
840
|
+
const cursor = lastSha != null ? {
|
|
841
|
+
sha: lastSha,
|
|
842
|
+
skip: total - iterations
|
|
843
|
+
} : void 0;
|
|
844
|
+
const rowsStatsDeferred = buildRowsStatsDeferred(windowRows);
|
|
845
|
+
onResult?.({
|
|
846
|
+
path: "fast",
|
|
847
|
+
added: newRows.length
|
|
848
|
+
});
|
|
849
|
+
return {
|
|
850
|
+
repoPath,
|
|
851
|
+
avatars,
|
|
852
|
+
ids,
|
|
853
|
+
includes: options?.include,
|
|
854
|
+
branches: branchMap,
|
|
855
|
+
remotes: remoteMap,
|
|
856
|
+
downstreams: downstreamMap,
|
|
857
|
+
stashes: gitStash?.stashes,
|
|
858
|
+
worktrees,
|
|
859
|
+
worktreesByBranch,
|
|
860
|
+
reachableFromHEAD,
|
|
861
|
+
rewriteableFromHEAD,
|
|
862
|
+
reachability: reachabilityBuilder.build(),
|
|
863
|
+
refTips,
|
|
864
|
+
decorationFingerprint,
|
|
865
|
+
shallowBoundary,
|
|
866
|
+
rows: windowRows,
|
|
867
|
+
id: selectSha ?? rev,
|
|
868
|
+
rowsStats: rowStats,
|
|
869
|
+
rowsStatsDeferred,
|
|
870
|
+
paging: {
|
|
871
|
+
limit: noLimit ? total : defaultLimit,
|
|
872
|
+
startingCursor: void 0,
|
|
873
|
+
hasMore
|
|
874
|
+
},
|
|
875
|
+
more: async (limit, sha, cancellation) => getCommitsForGraphCore.call(this, limit, sha, cursor, cancellation)
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
if (options?.incrementalSeed != null) {
|
|
879
|
+
let fast;
|
|
880
|
+
try {
|
|
881
|
+
fast = await tryIncrementalGraph(options.incrementalSeed);
|
|
882
|
+
} catch (ex) {
|
|
883
|
+
if (isCancellationError(ex) || cancellation?.aborted) throw ex;
|
|
884
|
+
ids.clear();
|
|
885
|
+
total = 0;
|
|
886
|
+
iterations = 0;
|
|
887
|
+
rowStats.clear();
|
|
888
|
+
avatars.clear();
|
|
889
|
+
reachableFromHEAD.clear();
|
|
890
|
+
rewriteableFromHEAD.clear();
|
|
891
|
+
reachableFromHeadUpstream.clear();
|
|
892
|
+
reachableRefs.clear();
|
|
893
|
+
tipShasWithChildren.clear();
|
|
894
|
+
downstreamMap.clear();
|
|
895
|
+
headSha = void 0;
|
|
896
|
+
rewriteableNextSha = void 0;
|
|
897
|
+
scope?.warn(`incremental graph walk failed; falling back to full walk; ${String(ex)}`);
|
|
898
|
+
incrementalFallbackReason = "error";
|
|
899
|
+
options.onIncrementalResult?.({
|
|
900
|
+
path: "fallback",
|
|
901
|
+
reason: "error"
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
if (fast != null) {
|
|
905
|
+
this.provider.maintenance?.request(repoPath, "commit-graph");
|
|
906
|
+
return fast;
|
|
907
|
+
}
|
|
908
|
+
if (incrementalFallbackReason === "error") rowsStatsSeed = void 0;
|
|
909
|
+
}
|
|
910
|
+
let graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, void 0, cancellation);
|
|
911
|
+
if (graph.rows.length === 0 && branches?.length && !cancellation?.aborted) {
|
|
912
|
+
scope?.warn(`graph returned 0 rows but repo has ${branches.length} branches; retrying`);
|
|
913
|
+
graph = await getCommitsForGraphCore.call(this, defaultLimit, selectSha, void 0, cancellation);
|
|
914
|
+
}
|
|
915
|
+
this.provider.maintenance?.request(repoPath, "commit-graph");
|
|
916
|
+
return graph;
|
|
917
|
+
}
|
|
918
|
+
async *searchGraph(repoPath, search, options, cancellation) {
|
|
919
|
+
return yield* this.searchGraphCore(repoPath, search, void 0, void 0, options, cancellation);
|
|
920
|
+
}
|
|
921
|
+
async *continueSearchGraph(repoPath, cursor, existingResults, options, cancellation) {
|
|
922
|
+
return yield* this.searchGraphCore(repoPath, cursor.search, cursor, existingResults, options, cancellation);
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* Cheap commit count for `search`, no result materialization — used to probe a candidate relaxed
|
|
926
|
+
* query before offering it. Never throws: any failure (including a sha-only `commit:` query, which
|
|
927
|
+
* can't be meaningfully "relaxed") returns 0, since this is a probe, not a search.
|
|
928
|
+
*/
|
|
929
|
+
async countSearchResults(repoPath, search, options, cancellation) {
|
|
930
|
+
try {
|
|
931
|
+
search = {
|
|
932
|
+
matchAll: false,
|
|
933
|
+
matchCase: false,
|
|
934
|
+
matchRegex: true,
|
|
935
|
+
matchWholeWord: false,
|
|
936
|
+
...search
|
|
937
|
+
};
|
|
938
|
+
const currentUser = search.query.includes("@me") ? await this.provider.config.getCurrentUser(repoPath) : void 0;
|
|
939
|
+
const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
|
|
940
|
+
if (shas?.size) return 0;
|
|
941
|
+
if (filters.type === "merge") {
|
|
942
|
+
const allIndex = searchArgs.indexOf("--all");
|
|
943
|
+
if (allIndex !== -1) searchArgs.splice(allIndex, 0, "--exclude=refs/stash");
|
|
944
|
+
}
|
|
945
|
+
const maxCount = options?.maxCount ?? 1e3;
|
|
946
|
+
const result = await this.git.run({
|
|
947
|
+
cwd: repoPath,
|
|
948
|
+
configs: gitConfigsLog,
|
|
949
|
+
cancellation,
|
|
950
|
+
errors: "ignore"
|
|
951
|
+
}, "rev-list", "--count", `--max-count=${maxCount}`, ...searchArgs, "--", ...files);
|
|
952
|
+
const count = Number.parseInt(result.stdout.trim(), 10);
|
|
953
|
+
return Number.isFinite(count) ? count : 0;
|
|
954
|
+
} catch {
|
|
955
|
+
return 0;
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
async *searchGraphCore(repoPath, search, cursor, existingResults, options, cancellation) {
|
|
959
|
+
search = {
|
|
960
|
+
matchAll: false,
|
|
961
|
+
matchCase: false,
|
|
962
|
+
matchRegex: true,
|
|
963
|
+
matchWholeWord: false,
|
|
964
|
+
...search
|
|
965
|
+
};
|
|
966
|
+
const comparisonKey = getSearchQueryComparisonKey(search);
|
|
967
|
+
try {
|
|
968
|
+
const currentUser = search.query.includes("@me") ? await this.provider.config.getCurrentUser(repoPath) : void 0;
|
|
969
|
+
const { args: searchArgs, files, shas, filters } = parseSearchQueryGitCommand(search, currentUser);
|
|
970
|
+
const tipsOnly = filters.type === "tip";
|
|
971
|
+
const mergesOnly = searchArgs.includes("--merges");
|
|
972
|
+
const parser = filters.files ? getShaAndDatesWithFilesLogParser(tipsOnly) : getShaAndDatesLogParser(tipsOnly);
|
|
973
|
+
const similarityThreshold = this.context.config?.commits.similarityThreshold ?? void 0;
|
|
974
|
+
const args = [
|
|
975
|
+
"log",
|
|
976
|
+
...parser.arguments,
|
|
977
|
+
`-M${similarityThreshold == null ? "" : `${similarityThreshold}%`}`,
|
|
978
|
+
"--use-mailmap"
|
|
979
|
+
];
|
|
980
|
+
let stashes;
|
|
981
|
+
let stdin;
|
|
982
|
+
let remappedIds;
|
|
983
|
+
let resolvedShas;
|
|
984
|
+
if (shas?.size) {
|
|
985
|
+
resolvedShas = await this.provider.revision.resolveShas(repoPath, shas, cancellation);
|
|
986
|
+
if (cancellation?.aborted) return {
|
|
987
|
+
repoPath,
|
|
988
|
+
query: search,
|
|
989
|
+
queryFilters: filters,
|
|
990
|
+
comparisonKey,
|
|
991
|
+
results: existingResults ?? /* @__PURE__ */ new Map(),
|
|
992
|
+
hasMore: true
|
|
993
|
+
};
|
|
994
|
+
if (!resolvedShas.size) return {
|
|
995
|
+
repoPath,
|
|
996
|
+
query: search,
|
|
997
|
+
queryFilters: filters,
|
|
998
|
+
comparisonKey,
|
|
999
|
+
results: existingResults ?? /* @__PURE__ */ new Map(),
|
|
1000
|
+
hasMore: false
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
if (resolvedShas?.size) {
|
|
1004
|
+
stdin = join(resolvedShas, "\n");
|
|
1005
|
+
args.push("--no-walk");
|
|
1006
|
+
remappedIds = /* @__PURE__ */ new Map();
|
|
1007
|
+
} else if (!filters.refs) {
|
|
1008
|
+
const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
|
|
1009
|
+
stashes = converted.stashes;
|
|
1010
|
+
remappedIds = converted.remappedIds;
|
|
1011
|
+
stdin = mergesOnly ? void 0 : converted.stdin;
|
|
1012
|
+
} else if (mergesOnly) {
|
|
1013
|
+
const converted = convertStashesToStdin(await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation));
|
|
1014
|
+
stashes = converted.stashes;
|
|
1015
|
+
remappedIds = converted.remappedIds;
|
|
1016
|
+
} else remappedIds = /* @__PURE__ */ new Map();
|
|
1017
|
+
if (stdin) args.push("--stdin");
|
|
1018
|
+
const limit = options?.limit ?? this.context.config?.graph?.maxSearchItems ?? 0;
|
|
1019
|
+
const ordering = options?.ordering ?? this.context.config?.commits.ordering ?? void 0;
|
|
1020
|
+
if (ordering) args.push(`--${ordering}-order`);
|
|
1021
|
+
for (const arg of searchArgs) {
|
|
1022
|
+
if (shas?.has(arg) || args.includes(arg)) continue;
|
|
1023
|
+
args.push(arg);
|
|
1024
|
+
}
|
|
1025
|
+
const results = existingResults ?? /* @__PURE__ */ new Map();
|
|
1026
|
+
const cursorState = cursor?.state != null && typeof cursor.state === "object" ? cursor.state : void 0;
|
|
1027
|
+
let iterations = cursorState?.iterations ?? 0;
|
|
1028
|
+
let totalSeen = cursorState?.totalSeen ?? 0;
|
|
1029
|
+
let skipCursor = cursorState ? {
|
|
1030
|
+
sha: cursorState.sha,
|
|
1031
|
+
skip: cursorState.skip
|
|
1032
|
+
} : void 0;
|
|
1033
|
+
let count = 0;
|
|
1034
|
+
try {
|
|
1035
|
+
try {
|
|
1036
|
+
var _usingCtx3 = _usingCtx();
|
|
1037
|
+
iterations++;
|
|
1038
|
+
const aborter = new AbortController();
|
|
1039
|
+
const onAbort = () => {
|
|
1040
|
+
aborter.abort();
|
|
1041
|
+
};
|
|
1042
|
+
cancellation?.addEventListener("abort", onAbort, { once: true });
|
|
1043
|
+
if (cancellation?.aborted) onAbort();
|
|
1044
|
+
_usingCtx3.u(createDisposable(() => cancellation?.removeEventListener("abort", onAbort)));
|
|
1045
|
+
const stream = this.git.stream({
|
|
1046
|
+
cwd: repoPath,
|
|
1047
|
+
cancellation: aborter.signal,
|
|
1048
|
+
configs: [
|
|
1049
|
+
"-C",
|
|
1050
|
+
repoPath,
|
|
1051
|
+
...gitConfigsLog
|
|
1052
|
+
],
|
|
1053
|
+
stdin
|
|
1054
|
+
}, ...args, skipCursor?.skip ? `--skip=${skipCursor.skip}` : void 0, "--", ...files);
|
|
1055
|
+
_usingCtx3.u(createDisposable(() => void stream.return?.(void 0)));
|
|
1056
|
+
let hasMore = false;
|
|
1057
|
+
let sha;
|
|
1058
|
+
const stashesOnly = filters.type === "stash";
|
|
1059
|
+
const batch = [];
|
|
1060
|
+
let lastProgressTime = Date.now();
|
|
1061
|
+
for await (const r of parser.parseAsync(stream)) {
|
|
1062
|
+
if (cancellation?.aborted) {
|
|
1063
|
+
hasMore = true;
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
count++;
|
|
1067
|
+
if (limit && count > limit) {
|
|
1068
|
+
hasMore = true;
|
|
1069
|
+
aborter.abort();
|
|
1070
|
+
break;
|
|
1071
|
+
}
|
|
1072
|
+
sha = remappedIds.get(r.sha) ?? r.sha;
|
|
1073
|
+
if (results.has(sha) || stashesOnly && !stashes?.has(sha) || mergesOnly && stashes?.has(sha) || tipsOnly && !r.tips) continue;
|
|
1074
|
+
const resultData = {
|
|
1075
|
+
i: results.size,
|
|
1076
|
+
date: Number(options?.ordering === "author-date" ? r.authorDate : r.committerDate) * 1e3,
|
|
1077
|
+
files: r.files
|
|
1078
|
+
};
|
|
1079
|
+
results.set(sha, resultData);
|
|
1080
|
+
batch.push([sha, resultData]);
|
|
1081
|
+
if (Date.now() - lastProgressTime >= progressiveSearchResultsBatchTimeMs && batch.length > 0) {
|
|
1082
|
+
yield {
|
|
1083
|
+
repoPath,
|
|
1084
|
+
query: search,
|
|
1085
|
+
queryFilters: filters,
|
|
1086
|
+
comparisonKey,
|
|
1087
|
+
results: new Map(batch),
|
|
1088
|
+
runningTotal: results.size,
|
|
1089
|
+
hasMore: true
|
|
1090
|
+
};
|
|
1091
|
+
batch.length = 0;
|
|
1092
|
+
lastProgressTime = Date.now();
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
if (batch.length) yield {
|
|
1096
|
+
repoPath,
|
|
1097
|
+
query: search,
|
|
1098
|
+
queryFilters: filters,
|
|
1099
|
+
comparisonKey,
|
|
1100
|
+
results: new Map(batch),
|
|
1101
|
+
runningTotal: results.size,
|
|
1102
|
+
hasMore
|
|
1103
|
+
};
|
|
1104
|
+
totalSeen += count;
|
|
1105
|
+
const lastSha = last(results)?.[0];
|
|
1106
|
+
skipCursor = lastSha != null ? {
|
|
1107
|
+
sha: lastSha,
|
|
1108
|
+
skip: totalSeen - iterations
|
|
1109
|
+
} : void 0;
|
|
1110
|
+
return {
|
|
1111
|
+
repoPath,
|
|
1112
|
+
query: search,
|
|
1113
|
+
queryFilters: filters,
|
|
1114
|
+
comparisonKey,
|
|
1115
|
+
results,
|
|
1116
|
+
hasMore,
|
|
1117
|
+
paging: limit || hasMore ? {
|
|
1118
|
+
limit: limit || count,
|
|
1119
|
+
cursor: hasMore && skipCursor ? {
|
|
1120
|
+
search,
|
|
1121
|
+
state: {
|
|
1122
|
+
iterations,
|
|
1123
|
+
totalSeen,
|
|
1124
|
+
sha: skipCursor.sha,
|
|
1125
|
+
skip: skipCursor.skip
|
|
1126
|
+
}
|
|
1127
|
+
} : void 0
|
|
1128
|
+
} : void 0
|
|
1129
|
+
};
|
|
1130
|
+
} catch (_) {
|
|
1131
|
+
_usingCtx3.e = _;
|
|
1132
|
+
} finally {
|
|
1133
|
+
_usingCtx3.d();
|
|
1134
|
+
}
|
|
1135
|
+
} catch (ex) {
|
|
1136
|
+
if (isCancellationError(ex) || cancellation?.aborted) {
|
|
1137
|
+
totalSeen += count;
|
|
1138
|
+
const lastSha = last(results)?.[0];
|
|
1139
|
+
const skipCursor = lastSha != null ? {
|
|
1140
|
+
sha: lastSha,
|
|
1141
|
+
skip: totalSeen - iterations
|
|
1142
|
+
} : void 0;
|
|
1143
|
+
return {
|
|
1144
|
+
repoPath,
|
|
1145
|
+
query: search,
|
|
1146
|
+
queryFilters: filters,
|
|
1147
|
+
comparisonKey,
|
|
1148
|
+
results,
|
|
1149
|
+
hasMore: true,
|
|
1150
|
+
paging: limit || skipCursor ? {
|
|
1151
|
+
limit: limit || count,
|
|
1152
|
+
cursor: skipCursor ? {
|
|
1153
|
+
search,
|
|
1154
|
+
state: {
|
|
1155
|
+
iterations,
|
|
1156
|
+
totalSeen,
|
|
1157
|
+
sha: skipCursor.sha,
|
|
1158
|
+
skip: skipCursor.skip
|
|
1159
|
+
}
|
|
1160
|
+
} : void 0
|
|
1161
|
+
} : void 0
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
const classified = classifySearchError(ex);
|
|
1165
|
+
throw new GitSearchError(ex, classified?.reason, classified?.detail);
|
|
1166
|
+
}
|
|
1167
|
+
} catch (ex) {
|
|
1168
|
+
if (ex instanceof GitSearchError) throw ex;
|
|
1169
|
+
const classified = classifySearchError(ex);
|
|
1170
|
+
throw new GitSearchError(ex, classified?.reason, classified?.detail);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
__decorate([debug({ args: (repoPath, rev, options) => ({
|
|
1175
|
+
repoPath,
|
|
1176
|
+
rev,
|
|
1177
|
+
limit: options?.limit,
|
|
1178
|
+
stats: options?.include?.stats,
|
|
1179
|
+
incrementalSeed: options?.incrementalSeed && {
|
|
1180
|
+
rows: options.incrementalSeed.rows.length,
|
|
1181
|
+
tips: options.incrementalSeed.tips.size,
|
|
1182
|
+
ordering: options.incrementalSeed.ordering
|
|
1183
|
+
},
|
|
1184
|
+
reachabilitySeed: options?.reachabilitySeed != null,
|
|
1185
|
+
rowsStatsSeed: options?.rowsStatsSeed != null,
|
|
1186
|
+
rebindFrom: options?.rebindFromRepoPath
|
|
1187
|
+
}) })], GraphGitSubProvider.prototype, "getGraph", null);
|
|
1188
|
+
__decorate([debug({ args: (repoPath, s, o) => ({
|
|
1189
|
+
repoPath,
|
|
1190
|
+
search: `[${s.matchAll ? "A" : ""}${s.matchCase ? "C" : ""}${s.matchRegex ? "R" : ""}${s.matchWholeWord ? "W" : ""}]: ${s.query.length > 500 ? `${s.query.substring(0, 500)}...` : s.query}`,
|
|
1191
|
+
options: `limit=${o?.limit}, ordering=${o?.ordering}`
|
|
1192
|
+
}) })], GraphGitSubProvider.prototype, "searchGraph", null);
|
|
1193
|
+
__decorate([debug({ args: (repoPath, c, r, o) => ({
|
|
1194
|
+
repoPath,
|
|
1195
|
+
cursor: `[${c.search.matchAll ? "A" : ""}${c.search.matchCase ? "C" : ""}${c.search.matchRegex ? "R" : ""}${c.search.matchWholeWord ? "W" : ""}]: ${c.search.query.length > 500 ? `${c.search.query.substring(0, 500)}...` : c.search.query} (continue)`,
|
|
1196
|
+
existingResults: `results=${r.size}`,
|
|
1197
|
+
options: `limit=${o?.limit}`
|
|
1198
|
+
}) })], GraphGitSubProvider.prototype, "continueSearchGraph", null);
|
|
1705
1199
|
/**
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
}
|
|
1200
|
+
* CLI-backed {@link GitGraphSession}: a stateful facade over {@link GraphGitSubProvider.getGraph}. It
|
|
1201
|
+
* owns the canonical accumulated window and builds the R6b incremental seed internally (from the window,
|
|
1202
|
+
* the prior walk's tips/reachability/stats, and the walk shape), so the host no longer mirrors loaded
|
|
1203
|
+
* rows, stamps ref tips, or hand-assembles a seed. Behavior-neutral: `refresh`/`more` reproduce exactly
|
|
1204
|
+
* what the host's `getState` seed construction + `setGraph` mirror maintenance + write-once avatar merge
|
|
1205
|
+
* did.
|
|
1206
|
+
*/
|
|
1207
|
+
var GraphSession = class {
|
|
1208
|
+
provider;
|
|
1209
|
+
_repoPath;
|
|
1210
|
+
rowProcessor;
|
|
1211
|
+
getWalkShape;
|
|
1212
|
+
_current;
|
|
1213
|
+
_window = [];
|
|
1214
|
+
_buildShape;
|
|
1215
|
+
_rebindMutationStarted = false;
|
|
1216
|
+
constructor(provider, _repoPath, rowProcessor, getWalkShape) {
|
|
1217
|
+
this.provider = provider;
|
|
1218
|
+
this._repoPath = _repoPath;
|
|
1219
|
+
this.rowProcessor = rowProcessor;
|
|
1220
|
+
this.getWalkShape = getWalkShape;
|
|
1221
|
+
}
|
|
1222
|
+
/** The CURRENT bound path — the repo the session was opened for, or the worktree {@link rebind} last
|
|
1223
|
+
* moved it onto. Mutable internally ONLY through `rebind`, which re-walks the window at the new path. */
|
|
1224
|
+
get repoPath() {
|
|
1225
|
+
return this._repoPath;
|
|
1226
|
+
}
|
|
1227
|
+
get window() {
|
|
1228
|
+
return this._window;
|
|
1229
|
+
}
|
|
1230
|
+
/** See {@link GitGraphSession.tainted} — owned by the write queue, raised by `rebindCore`'s failure
|
|
1231
|
+
* path and cleared by the rebuild that repairs it. */
|
|
1232
|
+
get tainted() {
|
|
1233
|
+
return this.writes.tainted;
|
|
1234
|
+
}
|
|
1235
|
+
get current() {
|
|
1236
|
+
return this._current;
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* First walk — no seed (nothing accumulated yet), equivalent to a plain `getGraph`.
|
|
1240
|
+
*
|
|
1241
|
+
* Deliberately NOT queued through {@link writes}: `openGraphSession` awaits this before it returns the
|
|
1242
|
+
* session, so no caller can hold a reference yet and there is nothing to race with.
|
|
1243
|
+
*/
|
|
1244
|
+
async initialize(options, cancellation) {
|
|
1245
|
+
const shape = this.getWalkShape();
|
|
1246
|
+
const graph = await this.provider.getGraph(this.repoPath, options?.rev, {
|
|
1247
|
+
include: options?.include,
|
|
1248
|
+
limit: options?.limit,
|
|
1249
|
+
rowProcessor: this.rowProcessor
|
|
1250
|
+
}, cancellation);
|
|
1251
|
+
this.applyRebuild(graph, shape);
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* The shared serialization + generation machinery — see {@link GraphSessionWriteQueue}, which owns the
|
|
1255
|
+
* contract so this implementation and the GitHub one cannot drift apart on it. Every mutating op below
|
|
1256
|
+
* goes through it; `initialize` is the one exception (see there).
|
|
1257
|
+
*/
|
|
1258
|
+
writes = new GraphSessionWriteQueue();
|
|
1259
|
+
refresh(options, cancellation) {
|
|
1260
|
+
return this.writes.run(() => this.refreshCore(options, void 0, cancellation));
|
|
1261
|
+
}
|
|
1262
|
+
rebind(repoPath, cancellation) {
|
|
1263
|
+
return this.writes.run(() => this.rebindCore(repoPath, cancellation));
|
|
1264
|
+
}
|
|
1265
|
+
/** {@link rebind}'s body — inside the exclusive chain, so `_repoPath` here is the binding a queued
|
|
1266
|
+
* predecessor left behind, not the one that was live when the caller asked. */
|
|
1267
|
+
async rebindCore(repoPath, cancellation) {
|
|
1268
|
+
if (repoPath === this._repoPath) return {
|
|
1269
|
+
path: "fast",
|
|
1270
|
+
added: 0,
|
|
1271
|
+
changed: {
|
|
1272
|
+
rows: false,
|
|
1273
|
+
reachability: false,
|
|
1274
|
+
rowsStats: false,
|
|
1275
|
+
avatars: false,
|
|
1276
|
+
downstreams: false
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
const fromRepoPath = this._repoPath;
|
|
1280
|
+
this._repoPath = repoPath;
|
|
1281
|
+
this._rebindMutationStarted = false;
|
|
1282
|
+
try {
|
|
1283
|
+
return await this.refreshCore(this.computeWindowAnchor(), fromRepoPath, cancellation);
|
|
1284
|
+
} catch (ex) {
|
|
1285
|
+
this._repoPath = fromRepoPath;
|
|
1286
|
+
if (this._rebindMutationStarted) {
|
|
1287
|
+
this._buildShape = void 0;
|
|
1288
|
+
this.writes.taint();
|
|
1289
|
+
}
|
|
1290
|
+
throw ex;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
async refreshCore(options, rebindFromRepoPath, cancellation) {
|
|
1294
|
+
const shape = this.getWalkShape();
|
|
1295
|
+
const buildShape = buildShapeKey(shape);
|
|
1296
|
+
const prior = this._current;
|
|
1297
|
+
const incrementalSeed = options?.rebuild !== true && prior.refTips != null && this._buildShape === buildShape ? {
|
|
1298
|
+
rows: this._window,
|
|
1299
|
+
tips: prior.refTips,
|
|
1300
|
+
ordering: shape.ordering,
|
|
1301
|
+
reachability: prior.reachability,
|
|
1302
|
+
rowsStats: prior.rowsStats,
|
|
1303
|
+
hasMore: prior.paging?.hasMore ?? false,
|
|
1304
|
+
onlyFollowFirstParent: shape.onlyFollowFirstParent,
|
|
1305
|
+
shallowBoundary: prior.shallowBoundary,
|
|
1306
|
+
decorationFingerprint: prior.decorationFingerprint,
|
|
1307
|
+
headRefUpstreamName: find(prior.branches.values(), (b) => b.current)?.upstream?.name
|
|
1308
|
+
} : void 0;
|
|
1309
|
+
let outcome;
|
|
1310
|
+
const graph = await this.provider.getGraph(this.repoPath, options?.rev, {
|
|
1311
|
+
include: options?.include,
|
|
1312
|
+
limit: options?.limit,
|
|
1313
|
+
rowProcessor: this.rowProcessor,
|
|
1314
|
+
reachabilitySeed: prior.reachability,
|
|
1315
|
+
rowsStatsSeed: prior.rowsStats,
|
|
1316
|
+
ancestrySeed: prior,
|
|
1317
|
+
incrementalSeed,
|
|
1318
|
+
onIncrementalResult: (o) => {
|
|
1319
|
+
outcome = o;
|
|
1320
|
+
},
|
|
1321
|
+
rebindFromRepoPath,
|
|
1322
|
+
onMutationStart: () => {
|
|
1323
|
+
this._rebindMutationStarted = true;
|
|
1324
|
+
}
|
|
1325
|
+
}, cancellation);
|
|
1326
|
+
mergeAvatarsForward(prior.avatars, graph.avatars);
|
|
1327
|
+
this.applyRebuild(graph, shape);
|
|
1328
|
+
if (outcome?.path === "fast") {
|
|
1329
|
+
const changed = {
|
|
1330
|
+
rows: true,
|
|
1331
|
+
reachability: reachabilityTableChanged(prior.reachability, graph.reachability),
|
|
1332
|
+
rowsStats: graph.includes?.stats === true && (outcome.added ?? 0) > 0,
|
|
1333
|
+
avatars: graph.avatars.size !== prior.avatars.size,
|
|
1334
|
+
downstreams: downstreamsChanged(prior.downstreams, graph.downstreams)
|
|
1335
|
+
};
|
|
1336
|
+
return {
|
|
1337
|
+
path: "fast",
|
|
1338
|
+
added: outcome.added,
|
|
1339
|
+
changed
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
const changed = {
|
|
1343
|
+
rows: true,
|
|
1344
|
+
reachability: true,
|
|
1345
|
+
rowsStats: true,
|
|
1346
|
+
rowsStatsRecomputed: getAncestryChange(prior, graph) != null || outcome?.path === "fallback" && outcome.reason === "error",
|
|
1347
|
+
avatars: true,
|
|
1348
|
+
downstreams: true
|
|
1349
|
+
};
|
|
1350
|
+
if (outcome?.path === "fallback") return {
|
|
1351
|
+
path: "full",
|
|
1352
|
+
reason: outcome.reason,
|
|
1353
|
+
changed
|
|
1354
|
+
};
|
|
1355
|
+
return {
|
|
1356
|
+
path: "full",
|
|
1357
|
+
changed
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Refresh options that reproduce the CURRENT window: the oldest loaded COMMIT row as the rev anchor
|
|
1362
|
+
* (pinning the walk's bottom boundary) and the window's size as the limit. Stash rows are skipped —
|
|
1363
|
+
* their shas aren't in `git log --all`, so anchoring on one triggers the walk's defensive over-walk.
|
|
1364
|
+
*/
|
|
1365
|
+
computeWindowAnchor() {
|
|
1366
|
+
const rows = this._window;
|
|
1367
|
+
if (!rows.length) return void 0;
|
|
1368
|
+
let rev;
|
|
1369
|
+
for (let i = rows.length - 1; i >= 0 && i >= rows.length - 10; i--) {
|
|
1370
|
+
const kind = rows[i].kind;
|
|
1371
|
+
if (kind === "commit" || kind === "merge") {
|
|
1372
|
+
rev = rows[i].sha;
|
|
1373
|
+
break;
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
return {
|
|
1377
|
+
rev,
|
|
1378
|
+
limit: rows.length,
|
|
1379
|
+
include: this._current.includes
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
more(limit, targetId, cancellation) {
|
|
1383
|
+
return this.writes.runPage(() => this.moreCore(limit, targetId, cancellation));
|
|
1384
|
+
}
|
|
1385
|
+
/** {@link more}'s body — runs inside the write queue, and only when the window it was requested
|
|
1386
|
+
* against is still the current one, so nothing can rebuild underneath it. */
|
|
1387
|
+
async moreCore(limit, targetId, cancellation) {
|
|
1388
|
+
if (cancellation?.aborted === true) return "none";
|
|
1389
|
+
const prior = this._current;
|
|
1390
|
+
const updated = await prior.more?.(limit ?? 0, targetId, cancellation);
|
|
1391
|
+
if (updated == null) {
|
|
1392
|
+
debugger;
|
|
1393
|
+
return "none";
|
|
1394
|
+
}
|
|
1395
|
+
mergeAvatarsForward(prior.avatars, updated.avatars);
|
|
1396
|
+
this.applyPage(updated);
|
|
1397
|
+
return "added";
|
|
1398
|
+
}
|
|
1399
|
+
dispose() {}
|
|
1400
|
+
/** A cursor-less rebuild (full walk / fast path) IS the full window. */
|
|
1401
|
+
applyRebuild(graph, shape) {
|
|
1402
|
+
this._current = graph;
|
|
1403
|
+
this._window = graph.rows;
|
|
1404
|
+
this._buildShape = buildShapeKey(shape);
|
|
1405
|
+
this.writes.invalidate();
|
|
1406
|
+
}
|
|
1407
|
+
/** A page-append: keep the window up to the cursor and append the page (the reducer's cursor-anchored
|
|
1408
|
+
* concatenation); the walk shape is unchanged (same generation). */
|
|
1409
|
+
applyPage(page) {
|
|
1410
|
+
this._current = page;
|
|
1411
|
+
const startingCursor = page.paging?.startingCursor;
|
|
1412
|
+
this._window = startingCursor == null ? page.rows : appendRowsAtCursor(this._window, startingCursor, page.rows);
|
|
1413
|
+
}
|
|
1414
|
+
};
|
|
1415
|
+
//#endregion
|
|
1416
|
+
export { GraphGitSubProvider };
|
|
1417
|
+
|
|
1866
1418
|
//# sourceMappingURL=graph.js.map
|