@gitkraken/core-gitlens 0.2.0 → 0.3.1
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 +11 -1
- package/dist/git/cache.d.ts +38 -8
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +120 -55
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +19 -0
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.d.ts.map +1 -1
- package/dist/git/features.js +1 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/graph.d.ts +96 -0
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/graph.js +24 -1
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/reference.d.ts +31 -0
- package/dist/git/models/reference.d.ts.map +1 -1
- package/dist/git/models/remote.d.ts.map +1 -1
- package/dist/git/models/remote.js.map +1 -1
- package/dist/git/models/remoteProvider.d.ts +1 -0
- package/dist/git/models/remoteProvider.d.ts.map +1 -1
- package/dist/git/models/remoteProvider.js.map +1 -1
- package/dist/git/models/repository.d.ts +30 -13
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +89 -87
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/search.d.ts +2 -2
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/statusFile.d.ts +9 -0
- package/dist/git/models/statusFile.d.ts.map +1 -1
- package/dist/git/models/statusFile.js +11 -0
- package/dist/git/models/statusFile.js.map +1 -1
- package/dist/git/models/worktree.d.ts +4 -1
- package/dist/git/models/worktree.d.ts.map +1 -1
- package/dist/git/models/worktree.js +2 -2
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/providers/branches.d.ts +15 -4
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/commits.d.ts +4 -0
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/config.d.ts +5 -4
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/operations.d.ts +61 -12
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts +3 -1
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/refs.d.ts +23 -2
- package/dist/git/providers/refs.d.ts.map +1 -1
- package/dist/git/providers/staging.d.ts +16 -0
- package/dist/git/providers/staging.d.ts.map +1 -1
- package/dist/git/providers/status.d.ts +4 -1
- package/dist/git/providers/status.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.d.ts.map +1 -1
- package/dist/git/remotes/azure-devops.js.map +1 -1
- package/dist/git/remotes/custom.d.ts +2 -0
- package/dist/git/remotes/custom.d.ts.map +1 -1
- package/dist/git/remotes/custom.js +20 -0
- package/dist/git/remotes/custom.js.map +1 -1
- package/dist/git/{exec.types.d.ts → run.types.d.ts} +22 -3
- package/dist/git/run.types.d.ts.map +1 -0
- package/dist/git/run.types.js +2 -0
- package/dist/git/run.types.js.map +1 -0
- package/dist/git/service.d.ts.map +1 -1
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/autolink.utils.d.ts.map +1 -1
- package/dist/git/utils/autolink.utils.js.map +1 -1
- package/dist/git/utils/blame.utils.d.ts.map +1 -1
- package/dist/git/utils/blame.utils.js.map +1 -1
- package/dist/git/utils/conflictResolution.utils.d.ts +6 -0
- package/dist/git/utils/conflictResolution.utils.d.ts.map +1 -0
- package/dist/git/utils/conflictResolution.utils.js +25 -0
- package/dist/git/utils/conflictResolution.utils.js.map +1 -0
- package/dist/git/utils/contributor.utils.d.ts +3 -0
- package/dist/git/utils/contributor.utils.d.ts.map +1 -1
- package/dist/git/utils/contributor.utils.js +22 -0
- package/dist/git/utils/contributor.utils.js.map +1 -1
- package/dist/git/utils/fileStatus.utils.d.ts +2 -1
- package/dist/git/utils/fileStatus.utils.d.ts.map +1 -1
- package/dist/git/utils/fileStatus.utils.js +4 -0
- package/dist/git/utils/fileStatus.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +37 -0
- package/dist/git/utils/reachability.utils.d.ts.map +1 -0
- package/dist/git/utils/reachability.utils.js +96 -0
- package/dist/git/utils/reachability.utils.js.map +1 -0
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js +3 -0
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/utils/sorting.d.ts +8 -0
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js +15 -0
- package/dist/git/utils/sorting.js.map +1 -1
- package/dist/git/utils/status.utils.d.ts.map +1 -1
- package/dist/git/utils/status.utils.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts.map +1 -1
- package/dist/git/watching/classifyChange.js +8 -0
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/gitIgnoreFilter.js +1 -1
- package/dist/git/watching/gitIgnoreFilter.js.map +1 -1
- package/dist/git/watching/initWatcher.d.ts.map +1 -1
- package/dist/git/watching/initWatcher.js.map +1 -1
- package/dist/git/watching/watchGroup.d.ts.map +1 -1
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +4 -2
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +31 -6
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +14 -12
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js +56 -55
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git-cli/exec/exec.types.d.ts +1 -1
- package/dist/git-cli/exec/exec.types.d.ts.map +1 -1
- package/dist/git-cli/exec/git.d.ts +3 -3
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +10 -2
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +39 -12
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/parsers/blameParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/blameParser.js.map +1 -1
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/parsers/refParser.d.ts +3 -30
- package/dist/git-cli/parsers/refParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/refParser.js +30 -30
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +15 -5
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +99 -68
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +1 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +86 -30
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +19 -6
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +86 -38
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js +5 -3
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +139 -16
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +17 -14
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +135 -63
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.d.ts.map +1 -1
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +3 -1
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +7 -1
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +19 -2
- package/dist/git-cli/providers/refs.d.ts.map +1 -1
- package/dist/git-cli/providers/refs.js +286 -2
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +6 -0
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js +32 -0
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js +20 -2
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +4 -1
- package/dist/git-cli/providers/status.d.ts.map +1 -1
- package/dist/git-cli/providers/status.js +8 -4
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +10 -6
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/ipc/discovery.d.ts +49 -0
- package/dist/ipc/discovery.d.ts.map +1 -0
- package/dist/ipc/discovery.js +147 -0
- package/dist/ipc/discovery.js.map +1 -0
- package/dist/ipc/ipcServer.d.ts +20 -0
- package/dist/ipc/ipcServer.d.ts.map +1 -0
- package/dist/ipc/ipcServer.js +162 -0
- package/dist/ipc/ipcServer.js.map +1 -0
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts +167 -0
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js +1786 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +1 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +36 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.js +171 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -0
- package/dist/plus/agents/sanitizePrompt.d.ts +15 -0
- package/dist/plus/agents/sanitizePrompt.d.ts.map +1 -0
- package/dist/plus/agents/sanitizePrompt.js +103 -0
- package/dist/plus/agents/sanitizePrompt.js.map +1 -0
- package/dist/plus/agents/stateMachine.d.ts +32 -0
- package/dist/plus/agents/stateMachine.d.ts.map +1 -0
- package/dist/plus/agents/stateMachine.js +180 -0
- package/dist/plus/agents/stateMachine.js.map +1 -0
- package/dist/plus/agents/types.d.ts +254 -0
- package/dist/plus/agents/types.d.ts.map +1 -0
- package/dist/plus/agents/types.js +49 -0
- package/dist/plus/agents/types.js.map +1 -0
- package/dist/plus/ai/errors.d.ts +4 -1
- package/dist/plus/ai/errors.d.ts.map +1 -1
- package/dist/plus/ai/errors.js +38 -0
- package/dist/plus/ai/errors.js.map +1 -1
- package/dist/plus/ai/models/model.d.ts +1 -1
- package/dist/plus/ai/models/model.d.ts.map +1 -1
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +11 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/provider.d.ts +3 -0
- package/dist/plus/ai/models/provider.d.ts.map +1 -1
- package/dist/plus/ai/prompts.d.ts +1 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +48 -8
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.d.ts.map +1 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js +4 -1
- package/dist/plus/ai/providers/gitkrakenProvider.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts +4 -3
- package/dist/plus/ai/providers/openAICompatibleProviderBase.d.ts.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +9 -6
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js.map +1 -1
- package/dist/plus/ai/utils/ai.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/ai.utils.js +2 -0
- package/dist/plus/ai/utils/ai.utils.js.map +1 -1
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +12 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +245 -51
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/types.d.ts +8 -0
- package/dist/plus/git-github/api/types.d.ts.map +1 -1
- package/dist/plus/git-github/models.d.ts +1 -1
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +5 -1
- package/dist/plus/git-github/providers/github/branches.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/branches.js +47 -24
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/commits.js +144 -92
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts +1 -1
- package/dist/plus/git-github/providers/github/diff.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/diff.js +23 -9
- package/dist/plus/git-github/providers/github/diff.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts +9 -1
- package/dist/plus/git-github/providers/github/refs.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/refs.js +39 -14
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/revision.js +1 -2
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/git-github/providers/github/status.d.ts +4 -1
- package/dist/plus/git-github/providers/github/status.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/status.js +1 -1
- package/dist/plus/git-github/providers/github/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/tags.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/tags.js +35 -36
- package/dist/plus/git-github/providers/github/tags.js.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.d.ts.map +1 -1
- package/dist/plus/git-github/providers/githubGitProvider.js.map +1 -1
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js.map +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +6 -0
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/decorators/serializable.d.ts.map +1 -1
- package/dist/utils/decorators/serializable.js.map +1 -1
- package/dist/utils/dedupedAsyncCache.d.ts +37 -0
- package/dist/utils/dedupedAsyncCache.d.ts.map +1 -0
- package/dist/utils/dedupedAsyncCache.js +68 -0
- package/dist/utils/dedupedAsyncCache.js.map +1 -0
- package/dist/utils/diff.d.ts +2 -0
- package/dist/utils/diff.d.ts.map +1 -0
- package/dist/utils/diff.js +53 -0
- package/dist/utils/diff.js.map +1 -0
- package/dist/utils/disposable.d.ts.map +1 -1
- package/dist/utils/disposable.js.map +1 -1
- package/dist/utils/env/node/exec.d.ts.map +1 -1
- package/dist/utils/env/node/exec.js.map +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/iterable.d.ts +7 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- package/dist/utils/iterable.js +12 -4
- package/dist/utils/iterable.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/lruMap.d.ts +9 -0
- package/dist/utils/lruMap.d.ts.map +1 -1
- package/dist/utils/lruMap.js +26 -4
- package/dist/utils/lruMap.js.map +1 -1
- package/dist/utils/markdown.d.ts.map +1 -1
- package/dist/utils/markdown.js.map +1 -1
- package/dist/utils/mru.d.ts.map +1 -1
- package/dist/utils/mru.js.map +1 -1
- package/dist/utils/object.d.ts +22 -1
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +56 -3
- package/dist/utils/object.js.map +1 -1
- package/dist/utils/paging.js +14 -15
- package/dist/utils/paging.js.map +1 -1
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/promise.d.ts +1 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +17 -0
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +10 -0
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +34 -4
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -1
- package/dist/utils/string.js.map +1 -1
- package/dist/utils/uri.d.ts.map +1 -1
- package/dist/utils/uri.js.map +1 -1
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js.map +1 -1
- package/package.json +13 -1
- package/src/git/cache.ts +192 -90
- package/src/git/context.ts +21 -0
- package/src/git/features.ts +2 -0
- package/src/git/models/commit.ts +1 -0
- package/src/git/models/graph.ts +97 -0
- package/src/git/models/reference.ts +33 -0
- package/src/git/models/remote.ts +1 -0
- package/src/git/models/remoteProvider.ts +1 -0
- package/src/git/models/repository.ts +105 -96
- package/src/git/models/search.ts +2 -2
- package/src/git/models/statusFile.ts +12 -0
- package/src/git/models/worktree.ts +10 -2
- package/src/git/parsers/diffParser.ts +2 -0
- package/src/git/providers/branches.ts +22 -4
- package/src/git/providers/commits.ts +4 -0
- package/src/git/providers/config.ts +3 -5
- package/src/git/providers/operations.ts +65 -1
- package/src/git/providers/pausedOperations.ts +1 -0
- package/src/git/providers/refs.ts +32 -3
- package/src/git/providers/staging.ts +12 -0
- package/src/git/providers/status.ts +6 -1
- package/src/git/remotes/azure-devops.ts +2 -0
- package/src/git/remotes/custom.ts +23 -0
- package/src/git/{exec.types.ts → run.types.ts} +22 -2
- package/src/git/service.ts +1 -0
- package/src/git/utils/autolink.utils.ts +1 -0
- package/src/git/utils/blame.utils.ts +2 -0
- package/src/git/utils/conflictResolution.utils.ts +31 -0
- package/src/git/utils/contributor.utils.ts +24 -0
- package/src/git/utils/fileStatus.utils.ts +7 -1
- package/src/git/utils/reachability.utils.ts +109 -0
- package/src/git/utils/search.utils.ts +2 -0
- package/src/git/utils/sorting.ts +17 -0
- package/src/git/utils/status.utils.ts +1 -0
- package/src/git/watching/classifyChange.ts +9 -0
- package/src/git/watching/gitIgnoreFilter.ts +2 -2
- package/src/git/watching/initWatcher.ts +2 -0
- package/src/git/watching/watchGroup.ts +3 -0
- package/src/git/watching/watchService.ts +45 -7
- package/src/git/watching/watchSession.ts +71 -55
- package/src/git-cli/exec/exec.types.ts +2 -2
- package/src/git-cli/exec/git.ts +6 -5
- package/src/git-cli/exec/gitQueue.ts +41 -12
- package/src/git-cli/parsers/blameParser.ts +1 -0
- package/src/git-cli/parsers/logParser.ts +1 -0
- package/src/git-cli/parsers/refParser.ts +33 -34
- package/src/git-cli/providers/blame.ts +1 -0
- package/src/git-cli/providers/branches.ts +165 -93
- package/src/git-cli/providers/commits.ts +107 -37
- package/src/git-cli/providers/config.ts +101 -48
- package/src/git-cli/providers/diff.ts +10 -3
- package/src/git-cli/providers/graph.ts +156 -16
- package/src/git-cli/providers/operations.ts +208 -83
- package/src/git-cli/providers/patch.ts +1 -0
- package/src/git-cli/providers/pausedOperations.ts +8 -0
- package/src/git-cli/providers/refs.ts +247 -3
- package/src/git-cli/providers/revision.ts +2 -2
- package/src/git-cli/providers/staging.ts +33 -0
- package/src/git-cli/providers/stash.ts +20 -2
- package/src/git-cli/providers/status.ts +24 -5
- package/src/git-cli/providers/tags.ts +15 -16
- package/src/ipc/discovery.ts +186 -0
- package/src/ipc/ipcServer.ts +171 -0
- package/src/plus/agents/providers/claudeCodeProvider.ts +2122 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +214 -0
- package/src/plus/agents/sanitizePrompt.ts +109 -0
- package/src/plus/agents/stateMachine.ts +197 -0
- package/src/plus/agents/types.ts +325 -0
- package/src/plus/ai/errors.ts +40 -0
- package/src/plus/ai/models/model.ts +1 -0
- package/src/plus/ai/models/promptTemplates.ts +13 -0
- package/src/plus/ai/models/provider.ts +7 -1
- package/src/plus/ai/prompts.ts +49 -8
- package/src/plus/ai/providers/gitkrakenProvider.ts +4 -0
- package/src/plus/ai/providers/openAICompatibleProviderBase.ts +21 -4
- package/src/plus/ai/utils/ai.utils.ts +2 -0
- package/src/plus/ai/utils/results.utils.ts +2 -0
- package/src/plus/git-github/api/github.ts +315 -57
- package/src/plus/git-github/api/types.ts +15 -0
- package/src/plus/git-github/models.ts +1 -1
- package/src/plus/git-github/providers/github/blame.ts +2 -0
- package/src/plus/git-github/providers/github/branches.ts +61 -31
- package/src/plus/git-github/providers/github/commits.ts +231 -160
- package/src/plus/git-github/providers/github/diff.ts +27 -19
- package/src/plus/git-github/providers/github/refs.ts +58 -23
- package/src/plus/git-github/providers/github/revision.ts +1 -2
- package/src/plus/git-github/providers/github/status.ts +6 -1
- package/src/plus/git-github/providers/github/tags.ts +61 -62
- package/src/plus/git-github/providers/githubGitProvider.ts +1 -0
- package/src/utils/color.ts +2 -0
- package/src/utils/date.ts +5 -0
- package/src/utils/debounce.ts +1 -1
- package/src/utils/decorators/serializable.ts +1 -0
- package/src/utils/dedupedAsyncCache.ts +74 -0
- package/src/utils/diff.ts +61 -0
- package/src/utils/disposable.ts +2 -0
- package/src/utils/env/node/exec.ts +2 -0
- package/src/utils/error.ts +1 -0
- package/src/utils/iterable.ts +17 -3
- package/src/utils/logger.ts +1 -0
- package/src/utils/lruMap.ts +29 -4
- package/src/utils/markdown.ts +1 -0
- package/src/utils/mru.ts +2 -0
- package/src/utils/object.ts +55 -4
- package/src/utils/paging.ts +14 -14
- package/src/utils/path.ts +1 -0
- package/src/utils/promise.ts +22 -0
- package/src/utils/promiseCache.ts +48 -16
- package/src/utils/string.ts +3 -1
- package/src/utils/uri.ts +1 -0
- package/src/utils/version.ts +1 -0
- package/dist/git/exec.types.d.ts.map +0 -1
- package/dist/git/exec.types.js +0 -2
- package/dist/git/exec.types.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { Cache } from '../../git/cache.js';
|
|
1
|
+
import type { Cache, GkConfigInvalidationTarget } from '../../git/cache.js';
|
|
2
2
|
import type { GitServiceContext } from '../../git/context.js';
|
|
3
3
|
import type { BranchDisposition } from '../../git/models/branch.js';
|
|
4
4
|
import { GitBranch } from '../../git/models/branch.js';
|
|
5
5
|
import type { ConflictDetectionResult } from '../../git/models/mergeConflicts.js';
|
|
6
6
|
import type { GitBranchReference } from '../../git/models/reference.js';
|
|
7
7
|
import type { BranchContributionsOverview, GitBranchesSubProvider, GitBranchMergedStatus } from '../../git/providers/branches.js';
|
|
8
|
+
import type { GitCommandPriority } from '../../git/run.types.js';
|
|
8
9
|
import type { BranchSortOptions } from '../../git/utils/sorting.js';
|
|
9
10
|
import type { PagedResult, PagingOptions } from '../../utils/paging.js';
|
|
10
11
|
import type { CliGitProviderInternal } from '../cliGitProvider.js';
|
|
@@ -31,6 +32,7 @@ export declare class BranchesGitSubProvider implements GitBranchesSubProvider {
|
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
34
|
} | undefined>;
|
|
35
|
+
priority?: GitCommandPriority;
|
|
34
36
|
}, cancellation?: AbortSignal): Promise<BranchContributionsOverview | undefined>;
|
|
35
37
|
getBranchesWithCommits(repoPath: string, commits: string[], branch?: string, options?: {
|
|
36
38
|
all?: boolean;
|
|
@@ -44,7 +46,9 @@ export declare class BranchesGitSubProvider implements GitBranchesSubProvider {
|
|
|
44
46
|
private branchesContainingCore;
|
|
45
47
|
getCurrentBranchReference(repoPath: string, cancellation?: AbortSignal): Promise<GitBranchReference | undefined>;
|
|
46
48
|
private getCurrentBranchReferenceCore;
|
|
47
|
-
getDefaultBranchName(repoPath: string | undefined, remote?: string,
|
|
49
|
+
getDefaultBranchName(repoPath: string | undefined, remote?: string, options?: {
|
|
50
|
+
priority?: GitCommandPriority;
|
|
51
|
+
}, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
48
52
|
createBranch(repoPath: string, name: string, ref: string, options?: {
|
|
49
53
|
noTracking?: boolean;
|
|
50
54
|
}): Promise<void>;
|
|
@@ -62,7 +66,9 @@ export declare class BranchesGitSubProvider implements GitBranchesSubProvider {
|
|
|
62
66
|
/** Detects potential conflict when merge a branch into a target branch (git merge) */
|
|
63
67
|
getPotentialMergeConflicts(repoPath: string, branch: string, targetBranch: string, cancellation?: AbortSignal): Promise<ConflictDetectionResult>;
|
|
64
68
|
private checkForPotentialConflicts;
|
|
65
|
-
getBaseBranchName(repoPath: string, ref: string,
|
|
69
|
+
getBaseBranchName(repoPath: string, ref: string, options?: {
|
|
70
|
+
priority?: GitCommandPriority;
|
|
71
|
+
}, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
66
72
|
private getBaseBranchFromReflog;
|
|
67
73
|
getStoredMergeTargetBranchName(repoPath: string, ref: string): Promise<string | undefined>;
|
|
68
74
|
getStoredDetectedMergeTargetBranchName(repoPath: string, ref: string): Promise<string | undefined>;
|
|
@@ -75,8 +81,12 @@ export declare class BranchesGitSubProvider implements GitBranchesSubProvider {
|
|
|
75
81
|
onCurrentBranchAgentActivity(repoPath: string): Promise<void>;
|
|
76
82
|
renameBranch(repoPath: string, oldName: string, newName: string): Promise<void>;
|
|
77
83
|
setUpstreamBranch(repoPath: string, name: string, upstream: string | undefined): Promise<void>;
|
|
78
|
-
storeBaseBranchName(repoPath: string, ref: string, base: string
|
|
79
|
-
|
|
84
|
+
storeBaseBranchName(repoPath: string, ref: string, base: string, options?: {
|
|
85
|
+
skipInvalidation?: readonly GkConfigInvalidationTarget[];
|
|
86
|
+
}): Promise<void>;
|
|
87
|
+
storeMergeTargetBranchName(repoPath: string, ref: string, target: string, options?: {
|
|
88
|
+
skipInvalidation?: readonly GkConfigInvalidationTarget[];
|
|
89
|
+
}): Promise<void>;
|
|
80
90
|
storeUserMergeTargetBranchName(repoPath: string, ref: string, target: string | undefined): Promise<void>;
|
|
81
91
|
/**
|
|
82
92
|
* Gets all branch metadata (dates and disposition) from git config in a single batch operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branches.d.ts","sourceRoot":"","sources":["../../src/providers/branches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAA6B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"branches.d.ts","sourceRoot":"","sources":["../../src/providers/branches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAA6B,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EACX,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAapE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAQvE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AA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MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9G;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAmDd,mBAAmB;IAe3B,oBAAoB,CACzB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,iBAAiB,GAAG,SAAS,GACxC,OAAO,CAAC,IAAI,CAAC;CAKhB"}
|
|
@@ -75,7 +75,6 @@ import { getSettledValue } from '../../utils/promise.js';
|
|
|
75
75
|
import { maybeStopWatch } from '../../utils/stopwatch.js';
|
|
76
76
|
import { getGitCommandError, gitConfigsBranch, gitConfigsLog, GitError, GitErrors, GitWarnings } from '../exec/git.js';
|
|
77
77
|
import { parseMergeTreeConflict } from '../parsers/mergeTreeParser.js';
|
|
78
|
-
import { getBranchParser } from '../parsers/refParser.js';
|
|
79
78
|
/** Minimum time between writes to the config for last accessed/modified dates */
|
|
80
79
|
const dateMetadataStaleThresholdMs = 5 * 60 * 1000; // 5 minutes
|
|
81
80
|
export class BranchesGitSubProvider {
|
|
@@ -110,7 +109,7 @@ export class BranchesGitSubProvider {
|
|
|
110
109
|
return undefined;
|
|
111
110
|
const [pausedOpStatusResult, committerDateResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
|
|
112
111
|
isDetachedHead(ref.name)
|
|
113
|
-
? this.provider.pausedOps?.getPausedOperationStatus(repoPath, cancellation)
|
|
112
|
+
? this.provider.pausedOps?.getPausedOperationStatus(repoPath, undefined, cancellation)
|
|
114
113
|
: undefined,
|
|
115
114
|
this.git
|
|
116
115
|
.run({
|
|
@@ -147,32 +146,37 @@ export class BranchesGitSubProvider {
|
|
|
147
146
|
try {
|
|
148
147
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
149
148
|
try {
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.git.run({ cwd: commonPath, cancellation: signal }, 'for-each-ref', ...parser.arguments, 'refs/heads/', 'refs/remotes/'),
|
|
149
|
+
const [recordsResult, supportedResult, defaultWorktreePathResult, metadataMapResult] = await Promise.allSettled([
|
|
150
|
+
this.provider.refs.getRefs(commonPath, signal),
|
|
151
|
+
this.git.supported('git:for-each-ref'),
|
|
154
152
|
this.provider.config.getDefaultWorktreePath?.(commonPath),
|
|
155
153
|
this.getBranchMetadataMap(commonPath),
|
|
156
154
|
]);
|
|
157
|
-
const
|
|
155
|
+
const records = getSettledValue(recordsResult) ?? [];
|
|
156
|
+
const supported = getSettledValue(supportedResult) ?? [];
|
|
158
157
|
const metadataMap = getSettledValue(metadataMapResult) ?? new Map();
|
|
159
158
|
const defaultWorktreePath = getSettledValue(defaultWorktreePathResult);
|
|
159
|
+
const worktreePathSupported = supported.includes('git:for-each-ref:worktreePath');
|
|
160
160
|
// If we don't get any data, assume the repo doesn't have any commits yet so check if we have a current branch
|
|
161
|
-
if (!
|
|
161
|
+
if (!records.length) {
|
|
162
162
|
const current = await this.getCurrentBranch(commonPath, metadataMap, options?.ordering ?? this.context.config?.commits.ordering ?? undefined, signal);
|
|
163
163
|
return current != null ? { values: [current] } : emptyPagedResult;
|
|
164
164
|
}
|
|
165
165
|
const sw = __addDisposableResource(env_1, maybeStopWatch(scope, { log: { onlyExit: true, level: 'debug' } }), false);
|
|
166
166
|
const branches = [];
|
|
167
|
-
for (const
|
|
167
|
+
for (const record of records) {
|
|
168
|
+
const fullName = record.name;
|
|
169
|
+
// Filter to branches and remote-tracking branches; skip tags from the unified records.
|
|
170
|
+
if (!fullName.startsWith('refs/heads/') && !fullName.startsWith('refs/remotes/'))
|
|
171
|
+
continue;
|
|
168
172
|
// Skip HEAD refs in remote branches
|
|
169
|
-
if (isRemoteHEAD(
|
|
173
|
+
if (isRemoteHEAD(fullName))
|
|
170
174
|
continue;
|
|
171
|
-
const upstream = parseUpstream(
|
|
172
|
-
const metadata = metadataMap.get(parseRefName(
|
|
173
|
-
const worktreePath =
|
|
174
|
-
branches.push(new GitBranch(commonPath,
|
|
175
|
-
|
|
175
|
+
const upstream = parseUpstream(record.upstream, record.upstreamTracking);
|
|
176
|
+
const metadata = metadataMap.get(parseRefName(fullName).name);
|
|
177
|
+
const worktreePath = record.worktreePath ? normalizePath(record.worktreePath) : undefined;
|
|
178
|
+
branches.push(new GitBranch(commonPath, fullName, false, // Don't trust %(HEAD) for current as it's per-worktree -- we will set it later
|
|
179
|
+
record.committerDate ? new Date(record.committerDate) : undefined, metadata, record.objectname, upstream, worktreePathSupported
|
|
176
180
|
? worktreePath
|
|
177
181
|
? { path: worktreePath, isDefault: worktreePath === defaultWorktreePath }
|
|
178
182
|
: false
|
|
@@ -182,6 +186,7 @@ export class BranchesGitSubProvider {
|
|
|
182
186
|
// Pre-populate current branch cache for worktrees based on worktreePath info
|
|
183
187
|
// This eliminates the need for rev-parse calls during branch reconstruction
|
|
184
188
|
for (const branch of branches) {
|
|
189
|
+
// oxlint-disable-next-line typescript/prefer-optional-chain
|
|
185
190
|
if (branch.worktree && branch.worktree.path) {
|
|
186
191
|
const { name } = parseRefName(branch.refName);
|
|
187
192
|
const reference = createReference(name, branch.worktree.path, {
|
|
@@ -286,33 +291,12 @@ export class BranchesGitSubProvider {
|
|
|
286
291
|
}
|
|
287
292
|
async getBranchContributionsOverview(repoPath, ref, options, cancellation) {
|
|
288
293
|
const scope = getScopedLogger();
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
mergeTarget = validated || storedTarget;
|
|
296
|
-
}
|
|
297
|
-
// Tier 2: PR-based lookup. The branch object is only needed here (for `remoteName`),
|
|
298
|
-
// so lazy-load it on the cold path instead of paying for it on every call.
|
|
299
|
-
if (mergeTarget == null && options?.associatedPullRequest != null) {
|
|
300
|
-
const pr = await options.associatedPullRequest;
|
|
301
|
-
if (pr?.refs?.base != null) {
|
|
302
|
-
const branch = await this.getBranch(repoPath, ref, signal);
|
|
303
|
-
if (branch == null)
|
|
304
|
-
return undefined;
|
|
305
|
-
mergeTarget = `${branch.remoteName}/${pr.refs.base.branch}`;
|
|
306
|
-
// Store for future reuse — turns the next call into a Tier 1 cache-eligible path.
|
|
307
|
-
void this.storeMergeTargetBranchName(repoPath, ref, mergeTarget);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
// Tier 3: Base branch, then default branch
|
|
311
|
-
mergeTarget ??= await this.getBaseBranchName(repoPath, ref, signal);
|
|
312
|
-
mergeTarget ??= await this.getDefaultBranchName(repoPath, undefined, signal);
|
|
313
|
-
if (mergeTarget == null)
|
|
314
|
-
return undefined;
|
|
315
|
-
const mergeBase = await this.provider.refs.getMergeBase(repoPath, ref, mergeTarget, undefined, signal);
|
|
294
|
+
const priority = options?.priority;
|
|
295
|
+
const priorityOpts = priority != null ? { priority: priority } : undefined;
|
|
296
|
+
// Expensive body — runs only on cache miss. Closes over `mergeTarget` so the cache key
|
|
297
|
+
// (`${ref}|${mergeTarget}`) fully captures every input that affects the result.
|
|
298
|
+
const fetchBody = async (mergeTarget, signal) => {
|
|
299
|
+
const mergeBase = await this.provider.refs.getMergeBase(repoPath, ref, mergeTarget, priorityOpts, signal);
|
|
316
300
|
if (mergeBase == null)
|
|
317
301
|
return undefined;
|
|
318
302
|
// Fetch the merge-base commit's dates in parallel with contributors so consumers
|
|
@@ -367,14 +351,47 @@ export class BranchesGitSubProvider {
|
|
|
367
351
|
};
|
|
368
352
|
};
|
|
369
353
|
try {
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
//
|
|
354
|
+
// Resolve `mergeTarget` through Tier 1 → Tier 2 → Tier 3. The pieces of each tier are
|
|
355
|
+
// already individually cached (`getStoredMergeTargetBranchName`, `getBaseBranchName`,
|
|
356
|
+
// `getDefaultBranchName`), so this resolution path is cheap on warm caches. Only the
|
|
357
|
+
// expensive body below (`getMergeBase` + `getContributors` w/ stats + `getCommitDates`)
|
|
358
|
+
// is wrapped by `cache.getBranchOverview`, keyed on the resolved `mergeTarget` so any
|
|
359
|
+
// caller that resolves to the same target shares; differing targets get independent
|
|
360
|
+
// slots, which is the correctness constraint that previously forced the Tier 2/3 paths
|
|
361
|
+
// to bypass the cache entirely.
|
|
362
|
+
let mergeTarget;
|
|
363
|
+
// Tier 1: Stored merge target (user-set or previously detected from PR).
|
|
373
364
|
const storedTarget = await this.getStoredMergeTargetBranchName(repoPath, ref);
|
|
374
|
-
if (storedTarget
|
|
375
|
-
|
|
365
|
+
if (storedTarget) {
|
|
366
|
+
const validated = await this.provider.refs.getSymbolicReferenceName(repoPath, storedTarget, priorityOpts, cancellation);
|
|
367
|
+
mergeTarget = validated || storedTarget;
|
|
376
368
|
}
|
|
377
|
-
|
|
369
|
+
// Tier 2: PR-based lookup. The branch object is only needed here (for `remoteName`),
|
|
370
|
+
// so lazy-load it on the cold path instead of paying for it on every call.
|
|
371
|
+
if (mergeTarget == null && options?.associatedPullRequest != null) {
|
|
372
|
+
const pr = await options.associatedPullRequest;
|
|
373
|
+
if (pr?.refs?.base != null) {
|
|
374
|
+
const branch = await this.getBranch(repoPath, ref, cancellation);
|
|
375
|
+
if (branch == null)
|
|
376
|
+
return undefined;
|
|
377
|
+
mergeTarget = `${branch.remoteName}/${pr.refs.base.branch}`;
|
|
378
|
+
// Store for future reuse — turns the next call into a Tier 1 path. Skip the
|
|
379
|
+
// `branchOverviews` invalidation that the write would otherwise trigger: we're
|
|
380
|
+
// about to populate `${ref}|${mergeTarget}` with this exact target, so evicting
|
|
381
|
+
// it would just force the next caller to redo the body. (gk-merge-target writes
|
|
382
|
+
// do not affect `baseBranchName`, so no need to skip that target.)
|
|
383
|
+
void this.storeMergeTargetBranchName(repoPath, ref, mergeTarget, {
|
|
384
|
+
skipInvalidation: ['branchOverviews'],
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
// Tier 3: Base branch, then default branch.
|
|
389
|
+
mergeTarget ??= await this.getBaseBranchName(repoPath, ref, priorityOpts, cancellation);
|
|
390
|
+
mergeTarget ??= await this.getDefaultBranchName(repoPath, undefined, priorityOpts, cancellation);
|
|
391
|
+
if (mergeTarget == null)
|
|
392
|
+
return undefined;
|
|
393
|
+
const resolvedTarget = mergeTarget;
|
|
394
|
+
return await this.cache.getBranchOverview(repoPath, `${ref}|${resolvedTarget}`, (_commonPath, _cacheable, signal) => fetchBody(resolvedTarget, signal ?? cancellation), { cancellation: cancellation });
|
|
378
395
|
}
|
|
379
396
|
catch (ex) {
|
|
380
397
|
scope?.error(ex);
|
|
@@ -459,7 +476,7 @@ export class BranchesGitSubProvider {
|
|
|
459
476
|
throw ex;
|
|
460
477
|
}
|
|
461
478
|
if (data == null) {
|
|
462
|
-
const symbolicRef = await this.getDefaultBranchName(repoPath, 'origin', signal);
|
|
479
|
+
const symbolicRef = await this.getDefaultBranchName(repoPath, 'origin', undefined, signal);
|
|
463
480
|
if (symbolicRef != null) {
|
|
464
481
|
data = [
|
|
465
482
|
symbolicRef.startsWith('origin/')
|
|
@@ -516,15 +533,17 @@ export class BranchesGitSubProvider {
|
|
|
516
533
|
});
|
|
517
534
|
}, { cancellation: cancellation });
|
|
518
535
|
}
|
|
519
|
-
async getDefaultBranchName(repoPath, remote, cancellation) {
|
|
536
|
+
async getDefaultBranchName(repoPath, remote, options, cancellation) {
|
|
520
537
|
if (repoPath == null)
|
|
521
538
|
return undefined;
|
|
522
539
|
remote ??= 'origin';
|
|
540
|
+
const priority = options?.priority;
|
|
541
|
+
const priorityOpts = priority != null ? { priority: priority } : undefined;
|
|
523
542
|
return this.cache.getDefaultBranchName(repoPath, remote, async (commonPath) => {
|
|
524
543
|
let retried = false;
|
|
525
544
|
while (true) {
|
|
526
545
|
try {
|
|
527
|
-
const result = await this.git.run({ cwd: commonPath, cancellation: cancellation }, 'symbolic-ref', '--short', `refs/remotes/${remote}/HEAD`);
|
|
546
|
+
const result = await this.git.run({ cwd: commonPath, cancellation: cancellation, ...priorityOpts }, 'symbolic-ref', '--short', `refs/remotes/${remote}/HEAD`);
|
|
528
547
|
return result.stdout.trim() || undefined;
|
|
529
548
|
}
|
|
530
549
|
catch (ex) {
|
|
@@ -532,10 +551,10 @@ export class BranchesGitSubProvider {
|
|
|
532
551
|
try {
|
|
533
552
|
if (!retried) {
|
|
534
553
|
retried = true;
|
|
535
|
-
await this.git.run({ cwd: commonPath, cancellation: cancellation }, 'remote', 'set-head', '-a', remote);
|
|
554
|
+
await this.git.run({ cwd: commonPath, cancellation: cancellation, ...priorityOpts }, 'remote', 'set-head', '-a', remote);
|
|
536
555
|
continue;
|
|
537
556
|
}
|
|
538
|
-
const result = await this.git.run({ cwd: commonPath, cancellation: cancellation }, 'ls-remote', '--symref', remote, 'HEAD');
|
|
557
|
+
const result = await this.git.run({ cwd: commonPath, cancellation: cancellation, ...priorityOpts }, 'ls-remote', '--symref', remote, 'HEAD');
|
|
539
558
|
if (result.stdout) {
|
|
540
559
|
const match = /ref:\s(\S+)\s+HEAD/m.exec(result.stdout);
|
|
541
560
|
if (match != null) {
|
|
@@ -907,7 +926,9 @@ export class BranchesGitSubProvider {
|
|
|
907
926
|
}
|
|
908
927
|
return { status: 'clean' };
|
|
909
928
|
}
|
|
910
|
-
getBaseBranchName(repoPath, ref, cancellation) {
|
|
929
|
+
getBaseBranchName(repoPath, ref, options, cancellation) {
|
|
930
|
+
const priority = options?.priority;
|
|
931
|
+
const priorityOpts = priority != null ? { priority: priority } : undefined;
|
|
911
932
|
return this.cache.getBaseBranchName(repoPath, ref, async (commonPath, signal) => {
|
|
912
933
|
try {
|
|
913
934
|
// getGkConfig has built-in fallback to regular config for backward compatibility
|
|
@@ -919,27 +940,37 @@ export class BranchesGitSubProvider {
|
|
|
919
940
|
update = mergeBase != null;
|
|
920
941
|
}
|
|
921
942
|
if (mergeBase != null) {
|
|
922
|
-
const branch = await this.provider.refs.getSymbolicReferenceName(commonPath, mergeBase);
|
|
943
|
+
const branch = await this.provider.refs.getSymbolicReferenceName(commonPath, mergeBase, priorityOpts);
|
|
923
944
|
if (branch != null) {
|
|
924
945
|
if (update) {
|
|
925
|
-
|
|
946
|
+
// Self-write: the value we're storing is exactly what this factory is
|
|
947
|
+
// returning, so any in-flight `branchOverviews` or `baseBranchName` entry
|
|
948
|
+
// being populated against this resolution should NOT be evicted.
|
|
949
|
+
void this.storeBaseBranchName(commonPath, ref, branch, {
|
|
950
|
+
skipInvalidation: ['branchOverviews', 'baseBranchName'],
|
|
951
|
+
});
|
|
926
952
|
}
|
|
927
953
|
return branch;
|
|
928
954
|
}
|
|
929
955
|
}
|
|
930
956
|
}
|
|
931
957
|
catch { }
|
|
932
|
-
const branch = await this.getBaseBranchFromReflog(commonPath, ref, { upstream: true }, signal);
|
|
958
|
+
const branch = await this.getBaseBranchFromReflog(commonPath, ref, { upstream: true, priority: priority }, signal);
|
|
933
959
|
if (branch != null) {
|
|
934
|
-
|
|
960
|
+
// Self-write: see comment on the migration path above.
|
|
961
|
+
void this.storeBaseBranchName(commonPath, ref, branch, {
|
|
962
|
+
skipInvalidation: ['branchOverviews', 'baseBranchName'],
|
|
963
|
+
});
|
|
935
964
|
return branch;
|
|
936
965
|
}
|
|
937
966
|
return undefined;
|
|
938
967
|
}, cancellation);
|
|
939
968
|
}
|
|
940
969
|
async getBaseBranchFromReflog(repoPath, ref, options, cancellation) {
|
|
970
|
+
const priority = options?.priority;
|
|
971
|
+
const priorityOpts = priority != null ? { priority: priority } : undefined;
|
|
941
972
|
try {
|
|
942
|
-
let result = await this.git.run({ cwd: repoPath, cancellation: cancellation }, 'reflog', ref, '--grep-reflog=branch: Created from *.');
|
|
973
|
+
let result = await this.git.run({ cwd: repoPath, cancellation: cancellation, ...priorityOpts }, 'reflog', ref, '--grep-reflog=branch: Created from *.');
|
|
943
974
|
let entries = result.stdout.split('\n').filter(entry => Boolean(entry));
|
|
944
975
|
if (entries.length !== 1)
|
|
945
976
|
return undefined;
|
|
@@ -949,17 +980,17 @@ export class BranchesGitSubProvider {
|
|
|
949
980
|
let name = match[1];
|
|
950
981
|
if (name !== 'HEAD') {
|
|
951
982
|
if (options?.upstream) {
|
|
952
|
-
const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}
|
|
983
|
+
const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`, priorityOpts);
|
|
953
984
|
if (upstream)
|
|
954
985
|
return upstream;
|
|
955
986
|
}
|
|
956
|
-
name = await this.provider.refs.getSymbolicReferenceName(repoPath, name);
|
|
987
|
+
name = await this.provider.refs.getSymbolicReferenceName(repoPath, name, priorityOpts);
|
|
957
988
|
if (name)
|
|
958
989
|
return name;
|
|
959
990
|
}
|
|
960
991
|
}
|
|
961
992
|
// Check if branch was created from HEAD
|
|
962
|
-
result = await this.git.run({ cwd: repoPath, cancellation: cancellation }, 'reflog', 'HEAD', `--grep-reflog=checkout: moving from .* to ${ref.replace('refs/heads/', '')}`);
|
|
993
|
+
result = await this.git.run({ cwd: repoPath, cancellation: cancellation, ...priorityOpts }, 'reflog', 'HEAD', `--grep-reflog=checkout: moving from .* to ${ref.replace('refs/heads/', '')}`);
|
|
963
994
|
entries = result.stdout.split('\n').filter(entry => Boolean(entry));
|
|
964
995
|
if (!entries.length)
|
|
965
996
|
return undefined;
|
|
@@ -967,11 +998,11 @@ export class BranchesGitSubProvider {
|
|
|
967
998
|
if (match?.length === 2) {
|
|
968
999
|
let name = match[1];
|
|
969
1000
|
if (options?.upstream) {
|
|
970
|
-
const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}
|
|
1001
|
+
const upstream = await this.provider.refs.getSymbolicReferenceName(repoPath, `${name}@{u}`, priorityOpts);
|
|
971
1002
|
if (upstream)
|
|
972
1003
|
return upstream;
|
|
973
1004
|
}
|
|
974
|
-
name = await this.provider.refs.getSymbolicReferenceName(repoPath, name);
|
|
1005
|
+
name = await this.provider.refs.getSymbolicReferenceName(repoPath, name, priorityOpts);
|
|
975
1006
|
if (name)
|
|
976
1007
|
return name;
|
|
977
1008
|
}
|
|
@@ -1051,11 +1082,11 @@ export class BranchesGitSubProvider {
|
|
|
1051
1082
|
}, ex));
|
|
1052
1083
|
}
|
|
1053
1084
|
}
|
|
1054
|
-
async storeBaseBranchName(repoPath, ref, base) {
|
|
1055
|
-
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-base`, base);
|
|
1085
|
+
async storeBaseBranchName(repoPath, ref, base, options) {
|
|
1086
|
+
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-base`, base, options);
|
|
1056
1087
|
}
|
|
1057
|
-
async storeMergeTargetBranchName(repoPath, ref, target) {
|
|
1058
|
-
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target`, target);
|
|
1088
|
+
async storeMergeTargetBranchName(repoPath, ref, target, options) {
|
|
1089
|
+
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target`, target, options);
|
|
1059
1090
|
}
|
|
1060
1091
|
async storeUserMergeTargetBranchName(repoPath, ref, target) {
|
|
1061
1092
|
await this.provider.config.setGkConfig(repoPath, `branch.${ref}.gk-merge-target-user`, target);
|