@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
package/src/git/cache.ts
CHANGED
|
@@ -8,19 +8,15 @@ import type { PromiseOrValue } from '../utils/promise.js';
|
|
|
8
8
|
import type { CacheController } from '../utils/promiseCache.js';
|
|
9
9
|
import { PromiseCache, PromiseMap, RepoPromiseCacheMap } from '../utils/promiseCache.js';
|
|
10
10
|
import type { Uri } from '../utils/uri.js';
|
|
11
|
-
import { getBranchId } from './utils/branch.utils.js';
|
|
12
|
-
import { createReference } from './utils/reference.utils.js';
|
|
13
|
-
import { getCommonRepositoryPath, getRepositoryOrWorktreePath } from './utils/repository.utils.js';
|
|
14
|
-
import type { GitResult } from './exec.types.js';
|
|
15
11
|
import type { ProgressiveGitBlame } from './models/blame.js';
|
|
16
12
|
import type { BranchMetadata, GitBranch } from './models/branch.js';
|
|
17
|
-
import type { GitStashCommit } from './models/commit.js';
|
|
13
|
+
import type { GitCommit, GitStashCommit } from './models/commit.js';
|
|
18
14
|
import type { GitContributor, GitContributorsStats } from './models/contributor.js';
|
|
19
15
|
import type { ParsedGitDiffHunks } from './models/diff.js';
|
|
20
16
|
import type { GitLog } from './models/log.js';
|
|
21
17
|
import type { ConflictDetectionResult } from './models/mergeConflicts.js';
|
|
22
18
|
import type { GitPausedOperationStatus } from './models/pausedOperationStatus.js';
|
|
23
|
-
import type { GitBranchReference } from './models/reference.js';
|
|
19
|
+
import type { GitBranchReference, GitRefTip, RefRecord } from './models/reference.js';
|
|
24
20
|
import type { GitRemote } from './models/remote.js';
|
|
25
21
|
import type { RemoteProvider } from './models/remoteProvider.js';
|
|
26
22
|
import type { GitDir, RepositoryChange } from './models/repository.js';
|
|
@@ -32,6 +28,10 @@ import type { BranchContributionsOverview, GitBranchMergedStatus } from './provi
|
|
|
32
28
|
import type { GitCommitReachability, LeftRightCommitCountResult } from './providers/commits.js';
|
|
33
29
|
import type { GitContributorsResult } from './providers/contributors.js';
|
|
34
30
|
import type { ResolvedRevision } from './providers/revision.js';
|
|
31
|
+
import type { GitResult } from './run.types.js';
|
|
32
|
+
import { getBranchId } from './utils/branch.utils.js';
|
|
33
|
+
import { createReference } from './utils/reference.utils.js';
|
|
34
|
+
import { getCommonRepositoryPath, getRepositoryOrWorktreePath } from './utils/repository.utils.js';
|
|
35
35
|
import type { GitIgnoreFilter } from './watching/gitIgnoreFilter.js';
|
|
36
36
|
|
|
37
37
|
type RepoPath = string;
|
|
@@ -67,13 +67,23 @@ export type ConflictDetectionCacheKey = `apply:${string}:${string}:${string}` |
|
|
|
67
67
|
* gkConfig keys that participate in the `branchOverviews` cache's mergeTarget/mergeBase lineage.
|
|
68
68
|
* Capture group 1 is the ref name (which may itself contain `.`/`/`).
|
|
69
69
|
*/
|
|
70
|
-
const
|
|
70
|
+
const branchOverviewGkConfigKeysRegex = /^branch\.(.+)\.(?:gk-merge-(?:base|target(?:-user)?)|gk-target-base)$/;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Downstream caches that `deleteGkConfig` may invalidate when a `branch.<ref>.gk-...` key changes.
|
|
74
|
+
* Callers performing a "self-write" (where the value being written matches what they just resolved,
|
|
75
|
+
* so the about-to-be-evicted entry is exactly the entry they want to preserve) can opt out by
|
|
76
|
+
* naming the targets to skip via `skipInvalidation`.
|
|
77
|
+
*/
|
|
78
|
+
export type GkConfigInvalidationTarget = 'branchOverviews' | 'baseBranchName';
|
|
71
79
|
|
|
72
80
|
/** Per-worktree caches — cleared by repoPath directly */
|
|
73
81
|
interface Caches {
|
|
74
82
|
bestRemotes: PromiseMap<RepoPath, GitRemote<RemoteProvider>[]> | undefined;
|
|
75
83
|
blame: RepoPromiseCacheMap<string, ProgressiveGitBlame | undefined> | undefined;
|
|
76
84
|
branch: PromiseMap<RepoPath, GitBranch | undefined> | undefined;
|
|
85
|
+
commit: RepoPromiseCacheMap<string, GitCommit | undefined> | undefined;
|
|
86
|
+
commitCount: RepoPromiseCacheMap<string, number | undefined> | undefined;
|
|
77
87
|
conflictDetection: RepoPromiseCacheMap<ConflictDetectionCacheKey, ConflictDetectionResult> | undefined;
|
|
78
88
|
currentBranchReference: PromiseCache<RepoPath, GitBranchReference | undefined> | undefined;
|
|
79
89
|
currentUser: Map<RepoPath, GitUser | null> | undefined;
|
|
@@ -83,8 +93,8 @@ interface Caches {
|
|
|
83
93
|
gitDir: Map<RepoPath, GitDir> | undefined;
|
|
84
94
|
gitIgnore: Map<RepoPath, GitIgnoreFilter> | undefined;
|
|
85
95
|
ignoreRevsFile: PromiseCache<string, boolean> | undefined;
|
|
86
|
-
lastFetched: PromiseCache<RepoPath, number | undefined> | undefined;
|
|
87
96
|
leftRightCommitCount: RepoPromiseCacheMap<string, LeftRightCommitCountResult | undefined> | undefined;
|
|
97
|
+
mergeBase: RepoPromiseCacheMap<string, string | undefined> | undefined;
|
|
88
98
|
pausedOperationStatus: PromiseMap<RepoPath, GitPausedOperationStatus | undefined> | undefined;
|
|
89
99
|
reachability: RepoPromiseCacheMap<string, GitCommitReachability | undefined> | undefined;
|
|
90
100
|
resolvedRevisions: RepoPromiseCacheMap<string, ResolvedRevision> | undefined;
|
|
@@ -105,10 +115,13 @@ interface SharedCaches {
|
|
|
105
115
|
contributorsStats: RepoPromiseCacheMap<string, GitContributorsStats | undefined> | undefined;
|
|
106
116
|
defaultBranchName: RepoPromiseCacheMap<string, string | undefined> | undefined;
|
|
107
117
|
gitResults: RepoPromiseCacheMap<string, GitResult> | undefined;
|
|
108
|
-
|
|
109
|
-
gkConfigPatterns: RepoPromiseCacheMap<string, Map<string, string>> | undefined;
|
|
118
|
+
gkConfigMap: PromiseMap<RepoPath, Map<string, string>> | undefined;
|
|
110
119
|
initialCommitSha: PromiseMap<RepoPath, string | undefined> | undefined;
|
|
120
|
+
/** Keyed by commonPath — `FETCH_HEAD` lives in the common git dir, shared across worktrees. */
|
|
121
|
+
lastFetched: PromiseCache<RepoPath, number | undefined> | undefined;
|
|
111
122
|
logShas: RepoPromiseCacheMap<string, string[]> | undefined;
|
|
123
|
+
refs: PromiseMap<RepoPath, RefRecord[]> | undefined;
|
|
124
|
+
refTips: PromiseMap<RepoPath, GitRefTip[]> | undefined;
|
|
112
125
|
remotes: PromiseMap<RepoPath, GitRemote[]> | undefined;
|
|
113
126
|
sharedBranches: PromiseMap<RepoPath, PagedResult<GitBranch>> | undefined;
|
|
114
127
|
stashes: RepoPromiseCacheMap<string, GitStash> | undefined;
|
|
@@ -133,10 +146,12 @@ const sharedCacheKeys: ReadonlySet<keyof AllCaches> = new Set(
|
|
|
133
146
|
'contributorsStats',
|
|
134
147
|
'defaultBranchName',
|
|
135
148
|
'gitResults',
|
|
136
|
-
'
|
|
137
|
-
'gkConfigPatterns',
|
|
149
|
+
'gkConfigMap',
|
|
138
150
|
'initialCommitSha',
|
|
151
|
+
'lastFetched',
|
|
139
152
|
'logShas',
|
|
153
|
+
'refs',
|
|
154
|
+
'refTips',
|
|
140
155
|
'remotes',
|
|
141
156
|
'sharedBranches',
|
|
142
157
|
'stashes',
|
|
@@ -155,9 +170,12 @@ function createEmptyCaches(): AllCaches {
|
|
|
155
170
|
branchMetadataMap: undefined,
|
|
156
171
|
branchOverviews: undefined,
|
|
157
172
|
branches: undefined,
|
|
173
|
+
commit: undefined,
|
|
174
|
+
commitCount: undefined,
|
|
158
175
|
fileExistence: undefined,
|
|
159
176
|
ignoreRevsFile: undefined,
|
|
160
177
|
leftRightCommitCount: undefined,
|
|
178
|
+
mergeBase: undefined,
|
|
161
179
|
configKeys: undefined,
|
|
162
180
|
configPatterns: undefined,
|
|
163
181
|
conflictDetection: undefined,
|
|
@@ -172,14 +190,15 @@ function createEmptyCaches(): AllCaches {
|
|
|
172
190
|
gitDir: undefined,
|
|
173
191
|
gitIgnore: undefined,
|
|
174
192
|
gitResults: undefined,
|
|
175
|
-
|
|
176
|
-
gkConfigPatterns: undefined,
|
|
193
|
+
gkConfigMap: undefined,
|
|
177
194
|
initialCommitSha: undefined,
|
|
178
195
|
lastFetched: undefined,
|
|
179
196
|
logShas: undefined,
|
|
180
197
|
pausedOperationStatus: undefined,
|
|
181
198
|
resolvedRevisions: undefined,
|
|
182
199
|
reachability: undefined,
|
|
200
|
+
refs: undefined,
|
|
201
|
+
refTips: undefined,
|
|
183
202
|
remotes: undefined,
|
|
184
203
|
sharedBranches: undefined,
|
|
185
204
|
stashes: undefined,
|
|
@@ -279,12 +298,8 @@ export class Cache implements Disposable {
|
|
|
279
298
|
}));
|
|
280
299
|
}
|
|
281
300
|
|
|
282
|
-
private get
|
|
283
|
-
return (this._caches.
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
private get gkConfigPatterns(): RepoPromiseCacheMap<string, Map<string, string>> {
|
|
287
|
-
return (this._caches.gkConfigPatterns ??= new RepoPromiseCacheMap<string, Map<string, string>>());
|
|
301
|
+
private get gkConfigMap(): PromiseMap<RepoPath, Map<string, string>> {
|
|
302
|
+
return (this._caches.gkConfigMap ??= new PromiseMap<RepoPath, Map<string, string>>());
|
|
288
303
|
}
|
|
289
304
|
|
|
290
305
|
get currentBranchReference(): PromiseCache<RepoPath, GitBranchReference | undefined> {
|
|
@@ -364,17 +379,25 @@ export class Cache implements Disposable {
|
|
|
364
379
|
}));
|
|
365
380
|
}
|
|
366
381
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
if (cached != null) return cached;
|
|
382
|
+
get commit(): RepoPromiseCacheMap<string, GitCommit | undefined> {
|
|
383
|
+
return (this._caches.commit ??= new RepoPromiseCacheMap<string, GitCommit | undefined>({
|
|
384
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
385
|
+
capacity: 100, // Limit to 100 commits per repo
|
|
386
|
+
}));
|
|
387
|
+
}
|
|
374
388
|
|
|
375
|
-
|
|
376
|
-
this.
|
|
377
|
-
|
|
389
|
+
get commitCount(): RepoPromiseCacheMap<string, number | undefined> {
|
|
390
|
+
return (this._caches.commitCount ??= new RepoPromiseCacheMap<string, number | undefined>({
|
|
391
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
392
|
+
capacity: 50,
|
|
393
|
+
}));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
get mergeBase(): RepoPromiseCacheMap<string, string | undefined> {
|
|
397
|
+
return (this._caches.mergeBase ??= new RepoPromiseCacheMap<string, string | undefined>({
|
|
398
|
+
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
399
|
+
capacity: 50,
|
|
400
|
+
}));
|
|
378
401
|
}
|
|
379
402
|
|
|
380
403
|
get logShas(): RepoPromiseCacheMap<string, string[]> {
|
|
@@ -398,6 +421,14 @@ export class Cache implements Disposable {
|
|
|
398
421
|
}));
|
|
399
422
|
}
|
|
400
423
|
|
|
424
|
+
get refs(): PromiseMap<RepoPath, RefRecord[]> {
|
|
425
|
+
return (this._caches.refs ??= new PromiseMap<RepoPath, RefRecord[]>());
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
get refTips(): PromiseMap<RepoPath, GitRefTip[]> {
|
|
429
|
+
return (this._caches.refTips ??= new PromiseMap<RepoPath, GitRefTip[]>());
|
|
430
|
+
}
|
|
431
|
+
|
|
401
432
|
get reachability(): RepoPromiseCacheMap<string, GitCommitReachability | undefined> {
|
|
402
433
|
return (this._caches.reachability ??= new RepoPromiseCacheMap<string, GitCommitReachability | undefined>({
|
|
403
434
|
accessTTL: 1000 * 60 * 60, // 60 minutes
|
|
@@ -479,9 +510,15 @@ export class Cache implements Disposable {
|
|
|
479
510
|
keysToClear.add('branch');
|
|
480
511
|
keysToClear.add('branchMergedStatus');
|
|
481
512
|
keysToClear.add('branchOverviews');
|
|
513
|
+
// `commit`/`commitCount` are keyed by symbolic ref or SHA — symbolic-ref entries
|
|
514
|
+
// can drift when branches move; cascade-clear conservatively.
|
|
515
|
+
keysToClear.add('commit');
|
|
516
|
+
keysToClear.add('commitCount');
|
|
482
517
|
keysToClear.add('conflictDetection');
|
|
483
518
|
keysToClear.add('currentBranchReference');
|
|
484
519
|
keysToClear.add('leftRightCommitCount');
|
|
520
|
+
// `mergeBase` keyed by ref-pairs — symbolic refs can move; cascade-clear.
|
|
521
|
+
keysToClear.add('mergeBase');
|
|
485
522
|
keysToClear.add('reachability');
|
|
486
523
|
keysToClear.add('resolvedRevisions');
|
|
487
524
|
}
|
|
@@ -495,6 +532,8 @@ export class Cache implements Disposable {
|
|
|
495
532
|
keysToClear.add('defaultBranchName');
|
|
496
533
|
keysToClear.add('initialCommitSha');
|
|
497
534
|
keysToClear.add('logShas');
|
|
535
|
+
keysToClear.add('refs');
|
|
536
|
+
keysToClear.add('refTips');
|
|
498
537
|
}
|
|
499
538
|
|
|
500
539
|
if (types.includes('config')) {
|
|
@@ -502,7 +541,10 @@ export class Cache implements Disposable {
|
|
|
502
541
|
keysToClear.add('configPatterns');
|
|
503
542
|
keysToClear.add('currentBranchReference');
|
|
504
543
|
keysToClear.add('currentUser');
|
|
505
|
-
|
|
544
|
+
// `gitDir` is immutable repo topology (toplevel/git-dir/common-dir/superproject) — a
|
|
545
|
+
// `.git/config` content change never relocates it, and it's owned by the repo lifecycle
|
|
546
|
+
// (registerRepoPath/unregisterRepoPath). Clearing it here forced a redundant `git rev-parse`
|
|
547
|
+
// re-spawn (gitDir is read by getGkConfigPath→getGitDir on every gk op), so leave it warm.
|
|
506
548
|
}
|
|
507
549
|
|
|
508
550
|
if (types.includes('contributors')) {
|
|
@@ -517,13 +559,12 @@ export class Cache implements Disposable {
|
|
|
517
559
|
}
|
|
518
560
|
|
|
519
561
|
if (types.includes('gkConfig')) {
|
|
520
|
-
keysToClear.add('
|
|
521
|
-
keysToClear.add('gkConfigPatterns');
|
|
562
|
+
keysToClear.add('gkConfigMap');
|
|
522
563
|
// Derived from `branch.<ref>.gk-merge-base`/`vscode-merge-base`; clear so external
|
|
523
564
|
// gkConfig mutations don't leave stale base-branch resolutions cached.
|
|
524
565
|
keysToClear.add('baseBranchName');
|
|
525
|
-
// Cached overviews
|
|
526
|
-
//
|
|
566
|
+
// Cached overviews are keyed by `${ref}|${mergeTarget}`; bulk gkConfig changes can
|
|
567
|
+
// affect any of the merge-target sources (stored, base, default), so clear all.
|
|
527
568
|
keysToClear.add('branchOverviews');
|
|
528
569
|
}
|
|
529
570
|
|
|
@@ -551,6 +592,8 @@ export class Cache implements Disposable {
|
|
|
551
592
|
}
|
|
552
593
|
if (types.includes('tags')) {
|
|
553
594
|
keysToClear.add('tags');
|
|
595
|
+
keysToClear.add('refs');
|
|
596
|
+
keysToClear.add('refTips');
|
|
554
597
|
}
|
|
555
598
|
|
|
556
599
|
if (types.includes('tracking')) {
|
|
@@ -587,12 +630,14 @@ export class Cache implements Disposable {
|
|
|
587
630
|
invalidate.call(cache, commonPath);
|
|
588
631
|
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
589
632
|
if (worktreePath === commonPath) continue;
|
|
633
|
+
|
|
590
634
|
invalidate.call(cache, worktreePath);
|
|
591
635
|
}
|
|
592
636
|
} else {
|
|
593
637
|
cache.delete(commonPath);
|
|
594
638
|
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
595
639
|
if (worktreePath === commonPath) continue;
|
|
640
|
+
|
|
596
641
|
cache.delete(worktreePath);
|
|
597
642
|
}
|
|
598
643
|
}
|
|
@@ -825,14 +870,18 @@ export class Cache implements Disposable {
|
|
|
825
870
|
// On factory invalidation, propagate to the derived per-worktree mapper entries
|
|
826
871
|
// via soft-invalidate — existing waiters on the mapper complete, and the entry
|
|
827
872
|
// self-evicts on mapper settle so the next callers build fresh derived entries.
|
|
828
|
-
void p
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
this.
|
|
873
|
+
void p
|
|
874
|
+
.finally(() => {
|
|
875
|
+
if (cacheable.invalidated) {
|
|
876
|
+
this.branches.invalidate(commonPath);
|
|
877
|
+
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
878
|
+
this.branches.invalidate(worktreePath);
|
|
879
|
+
}
|
|
833
880
|
}
|
|
834
|
-
}
|
|
835
|
-
|
|
881
|
+
})
|
|
882
|
+
// Swallow the cleanup chain's rejection so a rejected factory (e.g. cancellation)
|
|
883
|
+
// doesn't surface as an unhandled rejection; the caller-facing promise handles it.
|
|
884
|
+
.catch(() => {});
|
|
836
885
|
return p;
|
|
837
886
|
},
|
|
838
887
|
cancellation,
|
|
@@ -894,49 +943,56 @@ export class Cache implements Disposable {
|
|
|
894
943
|
this._caches.configPatterns?.delete(cacheKey);
|
|
895
944
|
}
|
|
896
945
|
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
const result = this.gkConfigKeys.get(cacheKey, key);
|
|
905
|
-
if (result != null) return result;
|
|
906
|
-
|
|
907
|
-
const factoryPromise = Promise.resolve(factory());
|
|
908
|
-
this.gkConfigKeys.set(cacheKey, key, factoryPromise);
|
|
909
|
-
return factoryPromise;
|
|
946
|
+
/**
|
|
947
|
+
* The whole `.git/gk/config` is read once and cached as a single map per commonPath; per-key and
|
|
948
|
+
* per-namespace gk lookups are served from it in-memory (see `getGkConfigMap` in the CLI config
|
|
949
|
+
* sub-provider). Invalidated by `deleteGkConfig` (write) and the coarse `'gkConfig'` clear (watcher).
|
|
950
|
+
*/
|
|
951
|
+
getGkConfigMap(repoPath: string, factory: () => PromiseOrValue<Map<string, string>>): Promise<Map<string, string>> {
|
|
952
|
+
return this.getSharedSimple(this.gkConfigMap, repoPath, factory);
|
|
910
953
|
}
|
|
911
954
|
|
|
912
|
-
|
|
955
|
+
/**
|
|
956
|
+
* Clears the cached `.git/gk/config` map and invalidates the derived caches
|
|
957
|
+
* (`baseBranchName`/`branchOverviews`) for the written key's ref.
|
|
958
|
+
*
|
|
959
|
+
* @param options.skipInvalidation Downstream caches the caller wants preserved despite this
|
|
960
|
+
* write. Use when the value being written is exactly what was just resolved — e.g. the Tier 2
|
|
961
|
+
* `storeMergeTargetBranchName` self-write inside `getBranchContributionsOverview` (skip
|
|
962
|
+
* `'branchOverviews'`) or the Tier 3 `storeBaseBranchName` self-write inside `getBaseBranchName`
|
|
963
|
+
* (skip both `'baseBranchName'` and `'branchOverviews'`). The bulk `gkConfigMap` map always
|
|
964
|
+
* invalidates so subsequent reads see the new value.
|
|
965
|
+
*/
|
|
966
|
+
deleteGkConfig(
|
|
913
967
|
repoPath: string,
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
):
|
|
968
|
+
key: string,
|
|
969
|
+
options?: { skipInvalidation?: readonly GkConfigInvalidationTarget[] },
|
|
970
|
+
): void {
|
|
917
971
|
const cacheKey = this.getCommonPath(repoPath);
|
|
972
|
+
this._caches.gkConfigMap?.delete(cacheKey);
|
|
918
973
|
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
974
|
+
const refMatch = key.match(branchOverviewGkConfigKeysRegex);
|
|
975
|
+
if (refMatch == null) return;
|
|
921
976
|
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
return factoryPromise;
|
|
925
|
-
}
|
|
977
|
+
const ref = refMatch[1];
|
|
978
|
+
const skip = options?.skipInvalidation;
|
|
926
979
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
980
|
+
// `getBaseBranchName` reads `branch.<ref>.gk-merge-base` and caches the resolved value
|
|
981
|
+
// per-ref. A write to that key must invalidate the cached base or Tier 3 of
|
|
982
|
+
// `getBranchContributionsOverview` will resolve `mergeTarget` against the pre-write value.
|
|
983
|
+
if (key.endsWith('.gk-merge-base') && !skip?.includes('baseBranchName')) {
|
|
984
|
+
this._caches.baseBranchName?.delete(cacheKey, ref);
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
if (skip?.includes('branchOverviews')) return;
|
|
931
988
|
|
|
932
989
|
// When the change affects a branch's merge-target/base lineage, invalidate that branch's
|
|
933
|
-
// cached
|
|
934
|
-
// `getBranchContributionsOverview` keys `branchOverviews` by ref
|
|
935
|
-
//
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
}
|
|
990
|
+
// cached overviews so subsequent reads pick up the new stored value rather than stale data.
|
|
991
|
+
// `getBranchContributionsOverview` keys `branchOverviews` by `${ref}|${mergeTarget}`, so
|
|
992
|
+
// invalidate every entry for the affected ref regardless of which target it resolved to.
|
|
993
|
+
// Uses `invalidateByKeyPrefix` (not `deleteByKeyPrefix`) so an in-flight factory is still
|
|
994
|
+
// shared with new callers instead of triggering a duplicate fetch.
|
|
995
|
+
this._caches.branchOverviews?.invalidateByKeyPrefix(cacheKey, `${ref}|`);
|
|
940
996
|
}
|
|
941
997
|
|
|
942
998
|
async getBranchOverview(
|
|
@@ -1094,6 +1150,42 @@ export class Cache implements Disposable {
|
|
|
1094
1150
|
return this.getSharedSimple(this.lastFetched, repoPath, factory);
|
|
1095
1151
|
}
|
|
1096
1152
|
|
|
1153
|
+
getRefs(
|
|
1154
|
+
repoPath: string,
|
|
1155
|
+
factory: (
|
|
1156
|
+
commonPath: string,
|
|
1157
|
+
cacheable: CacheController,
|
|
1158
|
+
cancellation?: AbortSignal,
|
|
1159
|
+
) => PromiseOrValue<RefRecord[]>,
|
|
1160
|
+
cancellation?: AbortSignal,
|
|
1161
|
+
): Promise<RefRecord[]> {
|
|
1162
|
+
// Raw ref records are repoPath-agnostic (no per-worktree binding to remap), so we key only
|
|
1163
|
+
// by commonPath and skip the per-worktree mapper that `getBranches`/`getTags` need.
|
|
1164
|
+
const commonPath = this.getCommonPath(repoPath);
|
|
1165
|
+
return this.refs.getOrCreate(
|
|
1166
|
+
commonPath,
|
|
1167
|
+
(cacheable, signal) => Promise.resolve(factory(commonPath, cacheable, signal)),
|
|
1168
|
+
cancellation,
|
|
1169
|
+
);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
getRefTips(
|
|
1173
|
+
repoPath: string,
|
|
1174
|
+
factory: (
|
|
1175
|
+
commonPath: string,
|
|
1176
|
+
cacheable: CacheController,
|
|
1177
|
+
cancellation?: AbortSignal,
|
|
1178
|
+
) => PromiseOrValue<GitRefTip[]>,
|
|
1179
|
+
cancellation?: AbortSignal,
|
|
1180
|
+
): Promise<GitRefTip[]> {
|
|
1181
|
+
const commonPath = this.getCommonPath(repoPath);
|
|
1182
|
+
return this.refTips.getOrCreate(
|
|
1183
|
+
commonPath,
|
|
1184
|
+
(cacheable, signal) => Promise.resolve(factory(commonPath, cacheable, signal)),
|
|
1185
|
+
cancellation,
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1097
1189
|
async getRemotes(
|
|
1098
1190
|
repoPath: string,
|
|
1099
1191
|
factory: (
|
|
@@ -1196,14 +1288,19 @@ export class Cache implements Disposable {
|
|
|
1196
1288
|
// On factory invalidation (without rejection), propagate to the derived per-worktree
|
|
1197
1289
|
// mapper entries so they don't persist past the shared factory's settle. Mapper
|
|
1198
1290
|
// entries cached via `cache.set()` have no controller, so `invalidate` hard-deletes.
|
|
1199
|
-
void p
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1291
|
+
void p
|
|
1292
|
+
.finally(() => {
|
|
1293
|
+
if (cacheable.invalidated) {
|
|
1294
|
+
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
1295
|
+
if (worktreePath === commonPath) continue;
|
|
1296
|
+
|
|
1297
|
+
cache.invalidate(worktreePath);
|
|
1298
|
+
}
|
|
1204
1299
|
}
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1300
|
+
})
|
|
1301
|
+
// Swallow the cleanup chain's rejection so a rejected factory (e.g. cancellation)
|
|
1302
|
+
// doesn't surface as an unhandled rejection; the caller-facing promise handles it.
|
|
1303
|
+
.catch(() => {});
|
|
1207
1304
|
return p;
|
|
1208
1305
|
},
|
|
1209
1306
|
cancellation,
|
|
@@ -1252,14 +1349,19 @@ export class Cache implements Disposable {
|
|
|
1252
1349
|
// mapper entries for this `cacheKey` so they don't persist past the shared factory's
|
|
1253
1350
|
// settle. Mapper entries cached via `cache.set()` have no controller, so `invalidate`
|
|
1254
1351
|
// hard-deletes.
|
|
1255
|
-
void p
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1352
|
+
void p
|
|
1353
|
+
.finally(() => {
|
|
1354
|
+
if (cacheable.invalidated) {
|
|
1355
|
+
for (const worktreePath of this.getWorktreePaths(commonPath)) {
|
|
1356
|
+
if (worktreePath === commonPath) continue;
|
|
1357
|
+
|
|
1358
|
+
cache.invalidate(worktreePath, cacheKey);
|
|
1359
|
+
}
|
|
1260
1360
|
}
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1361
|
+
})
|
|
1362
|
+
// Swallow the cleanup chain's rejection so a rejected factory (e.g. cancellation)
|
|
1363
|
+
// doesn't surface as an unhandled rejection; the caller-facing promise handles it.
|
|
1364
|
+
.catch(() => {});
|
|
1263
1365
|
return p;
|
|
1264
1366
|
},
|
|
1265
1367
|
options,
|
package/src/git/context.ts
CHANGED
|
@@ -85,6 +85,27 @@ export interface GitServiceConfig {
|
|
|
85
85
|
/** Maximum search items (0 = unlimited). */
|
|
86
86
|
readonly maxSearchItems?: number;
|
|
87
87
|
};
|
|
88
|
+
|
|
89
|
+
/** Force-push preferences. */
|
|
90
|
+
readonly push?: {
|
|
91
|
+
/** Whether to use `--force-with-lease` instead of a plain `--force` when force-pushing. Defaults to `true`. */
|
|
92
|
+
readonly useForceWithLease?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Whether to add `--force-if-includes` when force-pushing. Only applies when `useForceWithLease` is `true`
|
|
95
|
+
* and the installed Git supports it. Defaults to `true`.
|
|
96
|
+
*/
|
|
97
|
+
readonly useForceIfIncludes?: boolean;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** Commit-signing preferences. */
|
|
101
|
+
readonly signing?: {
|
|
102
|
+
/**
|
|
103
|
+
* Host-level override for whether commit signing is enabled (e.g. VS Code's `git.enableCommitSigning`).
|
|
104
|
+
* When `true`, signing is treated as enabled even if the repo's `commit.gpgsign` is unset/false. It never
|
|
105
|
+
* forces signing off.
|
|
106
|
+
*/
|
|
107
|
+
readonly enabled?: boolean;
|
|
108
|
+
};
|
|
88
109
|
}
|
|
89
110
|
|
|
90
111
|
/** Git command types that can produce conflicts. */
|
package/src/git/features.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// GitFeature's must start with `git:` to be recognized in all usages
|
|
2
2
|
export type GitFeatures =
|
|
3
|
+
| 'git:checkout:pathspec-from-file'
|
|
3
4
|
| 'git:for-each-ref:worktreePath'
|
|
4
5
|
| 'git:ignoreRevsFile'
|
|
5
6
|
| 'git:merge-tree'
|
|
@@ -28,6 +29,7 @@ export type FilteredGitFeatures<T extends GitFeatureOrPrefix> = T extends GitFea
|
|
|
28
29
|
|
|
29
30
|
export const gitMinimumVersion = '2.7.2';
|
|
30
31
|
export const gitFeaturesByVersion = new Map<GitFeatures, string>([
|
|
32
|
+
['git:checkout:pathspec-from-file', '2.26'],
|
|
31
33
|
['git:for-each-ref:worktreePath', '2.23'],
|
|
32
34
|
['git:ignoreRevsFile', '2.23'],
|
|
33
35
|
['git:merge-tree', '2.33'],
|
package/src/git/models/commit.ts
CHANGED
|
@@ -521,6 +521,7 @@ export class GitCommit implements GitRevisionReference {
|
|
|
521
521
|
|
|
522
522
|
protected computeFileStats(): void {
|
|
523
523
|
if (!this._recomputeStats || this._fileset == null) return;
|
|
524
|
+
|
|
524
525
|
this._recomputeStats = false;
|
|
525
526
|
|
|
526
527
|
const changedFiles = { added: 0, deleted: 0, changed: 0 };
|