@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,7 +1,7 @@
|
|
|
1
1
|
import type { Cache } from '../../git/cache.js';
|
|
2
2
|
import type { GitServiceContext } from '../../git/context.js';
|
|
3
3
|
import type { GitBranchReference, GitReference } from '../../git/models/reference.js';
|
|
4
|
-
import type { GitOperationResult, GitOperationsSubProvider } from '../../git/providers/operations.js';
|
|
4
|
+
import type { GitOperationResult, GitOperationRunOptions, GitOperationsSubProvider } from '../../git/providers/operations.js';
|
|
5
5
|
import type { CliGitProviderInternal } from '../cliGitProvider.js';
|
|
6
6
|
import type { Git } from '../exec/git.js';
|
|
7
7
|
export declare class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
@@ -12,15 +12,12 @@ export declare class OperationsGitSubProvider implements GitOperationsSubProvide
|
|
|
12
12
|
constructor(context: GitServiceContext, git: Git, cache: Cache, provider: CliGitProviderInternal);
|
|
13
13
|
checkout(repoPath: string, ref: string, options?: {
|
|
14
14
|
createBranch?: string;
|
|
15
|
-
}
|
|
16
|
-
path?: string;
|
|
17
|
-
}): Promise<void>;
|
|
18
|
-
private checkoutCore;
|
|
15
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
19
16
|
cherryPick(repoPath: string, revs: string[], options?: {
|
|
20
17
|
edit?: boolean;
|
|
21
18
|
noCommit?: boolean;
|
|
22
19
|
source?: unknown;
|
|
23
|
-
}): Promise<GitOperationResult>;
|
|
20
|
+
}, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
|
|
24
21
|
commit(repoPath: string, message: string, options?: {
|
|
25
22
|
all?: boolean;
|
|
26
23
|
allowEmpty?: boolean;
|
|
@@ -29,27 +26,27 @@ export declare class OperationsGitSubProvider implements GitOperationsSubProvide
|
|
|
29
26
|
date?: string;
|
|
30
27
|
signoff?: boolean;
|
|
31
28
|
source?: unknown;
|
|
32
|
-
}): Promise<void>;
|
|
29
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
33
30
|
fetch(repoPath: string, options?: {
|
|
34
31
|
all?: boolean;
|
|
35
32
|
branch?: GitBranchReference;
|
|
36
33
|
prune?: boolean;
|
|
37
34
|
pull?: boolean;
|
|
38
35
|
remote?: string;
|
|
39
|
-
}): Promise<void>;
|
|
36
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
40
37
|
private fetchCore;
|
|
41
38
|
merge(repoPath: string, ref: string, options?: {
|
|
42
39
|
fastForward?: boolean | 'only';
|
|
43
40
|
noCommit?: boolean;
|
|
44
41
|
squash?: boolean;
|
|
45
42
|
source?: unknown;
|
|
46
|
-
}): Promise<GitOperationResult>;
|
|
43
|
+
}, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
|
|
47
44
|
pull(repoPath: string, options?: {
|
|
48
45
|
branch?: GitBranchReference;
|
|
49
46
|
rebase?: boolean;
|
|
50
47
|
tags?: boolean;
|
|
51
48
|
source?: unknown;
|
|
52
|
-
}): Promise<void>;
|
|
49
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
53
50
|
private pullCore;
|
|
54
51
|
push(repoPath: string, options?: {
|
|
55
52
|
reference?: GitReference;
|
|
@@ -57,25 +54,31 @@ export declare class OperationsGitSubProvider implements GitOperationsSubProvide
|
|
|
57
54
|
publish?: {
|
|
58
55
|
remote: string;
|
|
59
56
|
};
|
|
60
|
-
}): Promise<void>;
|
|
57
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
61
58
|
private pushCore;
|
|
62
59
|
rebase(repoPath: string, upstream: string, options?: {
|
|
63
60
|
autoStash?: boolean;
|
|
64
61
|
branch?: string;
|
|
65
62
|
editor?: string;
|
|
66
63
|
interactive?: boolean;
|
|
64
|
+
programmaticEditor?: boolean;
|
|
65
|
+
messageEditor?: string;
|
|
67
66
|
onto?: string;
|
|
68
67
|
updateRefs?: boolean;
|
|
69
68
|
source?: unknown;
|
|
70
|
-
}): Promise<GitOperationResult>;
|
|
69
|
+
}, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
|
|
71
70
|
reset(repoPath: string, rev: string, options?: {
|
|
72
71
|
mode?: 'hard' | 'keep' | 'merge' | 'mixed' | 'soft';
|
|
73
|
-
}): Promise<void>;
|
|
72
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
74
73
|
private resetCore;
|
|
74
|
+
restore(repoPath: string, path: string | string[], options?: {
|
|
75
|
+
ref?: string;
|
|
76
|
+
side?: 'ours' | 'theirs';
|
|
77
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
75
78
|
revert(repoPath: string, refs: string[], options?: {
|
|
76
79
|
editMessage?: boolean;
|
|
77
80
|
source?: unknown;
|
|
78
|
-
}): Promise<GitOperationResult>;
|
|
81
|
+
}, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
|
|
79
82
|
/**
|
|
80
83
|
* Classifies `ex` as a signing failure; if so, fires the `commits.onSigningFailed`
|
|
81
84
|
* hook and throws a typed {@link SigningError}. Callers should invoke this first
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/providers/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAcrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGzF,OAAO,KAAK,
|
|
1
|
+
{"version":3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AM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,EACpD,UAAU,CAAC,EAAE,sBAAsB,GACjC,OAAO,CAAC,IAAI,CAAC;IA+DV,MAAM,CACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EACrD,UAAU,CAAC,EAAE,sBAAsB,GACjC,OAAO,CAAC,kBAAkB,CAAC;IA2C9B;;;;;;;;;OASG;YACW,mBAAmB;YAwBnB,oBAAoB;CAelC"}
|
|
@@ -9,10 +9,11 @@ import { getBranchNameAndRemote, getBranchTrackingWithoutRemote } from '../../gi
|
|
|
9
9
|
import { isBranchReference } from '../../git/utils/reference.utils.js';
|
|
10
10
|
import { debug } from '../../utils/decorators/log.js';
|
|
11
11
|
import { sequentialize } from '../../utils/decorators/sequentialize.js';
|
|
12
|
+
import { chunkByStringLength } from '../../utils/iterable.js';
|
|
12
13
|
import { Logger } from '../../utils/logger.js';
|
|
13
14
|
import { getScopedLogger } from '../../utils/logger.scoped.js';
|
|
14
15
|
import { normalizePath, splitPath } from '../../utils/path.js';
|
|
15
|
-
import { classifySigningError, getGitCommandError, gitConfigsPull, GitErrors, inferSigningFormatFromError, } from '../exec/git.js';
|
|
16
|
+
import { classifySigningError, getGitCommandError, gitConfigsPull, GitErrors, inferSigningFormatFromError, maxGitCliLength, } from '../exec/git.js';
|
|
16
17
|
export class OperationsGitSubProvider {
|
|
17
18
|
context;
|
|
18
19
|
git;
|
|
@@ -24,38 +25,26 @@ export class OperationsGitSubProvider {
|
|
|
24
25
|
this.cache = cache;
|
|
25
26
|
this.provider = provider;
|
|
26
27
|
}
|
|
27
|
-
async checkout(repoPath, ref, options) {
|
|
28
|
+
async checkout(repoPath, ref, options, runOptions) {
|
|
28
29
|
const scope = getScopedLogger();
|
|
29
|
-
try {
|
|
30
|
-
await this.checkoutCore(repoPath, ref, options);
|
|
31
|
-
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
32
|
-
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
33
|
-
}
|
|
34
|
-
catch (ex) {
|
|
35
|
-
scope?.error(ex);
|
|
36
|
-
throw ex;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async checkoutCore(repoPath, ref, { createBranch, path } = {}) {
|
|
40
30
|
const params = ['checkout'];
|
|
41
|
-
if (createBranch) {
|
|
42
|
-
params.push('-b', createBranch, ref, '--');
|
|
31
|
+
if (options?.createBranch) {
|
|
32
|
+
params.push('-b', options.createBranch, ref, '--');
|
|
43
33
|
}
|
|
44
34
|
else {
|
|
45
35
|
params.push(ref, '--');
|
|
46
|
-
if (path) {
|
|
47
|
-
[path, repoPath] = splitPath(path, repoPath, true);
|
|
48
|
-
params.push(path);
|
|
49
|
-
}
|
|
50
36
|
}
|
|
51
37
|
try {
|
|
52
|
-
await this.git.run({ cwd: repoPath }, ...params);
|
|
38
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
|
|
39
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
40
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
53
41
|
}
|
|
54
42
|
catch (ex) {
|
|
43
|
+
scope?.error(ex);
|
|
55
44
|
throw getGitCommandError('checkout', ex, reason => new CheckoutError({ reason: reason ?? 'other', ref: ref, gitCommand: { repoPath: repoPath, args: params } }, ex));
|
|
56
45
|
}
|
|
57
46
|
}
|
|
58
|
-
async cherryPick(repoPath, revs, options) {
|
|
47
|
+
async cherryPick(repoPath, revs, options, runOptions) {
|
|
59
48
|
const scope = getScopedLogger();
|
|
60
49
|
const args = ['cherry-pick'];
|
|
61
50
|
if (options?.edit) {
|
|
@@ -65,7 +54,8 @@ export class OperationsGitSubProvider {
|
|
|
65
54
|
args.push('-n');
|
|
66
55
|
}
|
|
67
56
|
if (revs.length > 1) {
|
|
68
|
-
// Sort commits in topological order (oldest ancestor first) so cherry-pick applies them correctly
|
|
57
|
+
// Sort commits in topological order (oldest ancestor first) so cherry-pick applies them correctly.
|
|
58
|
+
// This is a local read-only pre-flight, not the user-initiated op — don't subject it to caller env/timeout.
|
|
69
59
|
const revsSet = new Set(revs);
|
|
70
60
|
const result = await this.git.run({ cwd: repoPath }, 'rev-list', '--topo-order', '--reverse', ...revs);
|
|
71
61
|
const ordered = [];
|
|
@@ -83,7 +73,7 @@ export class OperationsGitSubProvider {
|
|
|
83
73
|
}
|
|
84
74
|
args.push(...revs);
|
|
85
75
|
try {
|
|
86
|
-
await this.git.run({ cwd: repoPath, errors: 'throw' }, ...args);
|
|
76
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...args);
|
|
87
77
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
88
78
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
89
79
|
return { conflicted: false };
|
|
@@ -98,7 +88,7 @@ export class OperationsGitSubProvider {
|
|
|
98
88
|
throw mapped;
|
|
99
89
|
}
|
|
100
90
|
}
|
|
101
|
-
async commit(repoPath, message, options) {
|
|
91
|
+
async commit(repoPath, message, options, runOptions) {
|
|
102
92
|
const scope = getScopedLogger();
|
|
103
93
|
const params = ['commit'];
|
|
104
94
|
if (options?.all) {
|
|
@@ -122,7 +112,7 @@ export class OperationsGitSubProvider {
|
|
|
122
112
|
// Read commit message from stdin via -F - to avoid shell escaping issues
|
|
123
113
|
params.push('-F', '-');
|
|
124
114
|
try {
|
|
125
|
-
await this.git.run({ cwd: repoPath, stdin: message, stdinEncoding: 'utf8', errors: 'throw' }, ...params);
|
|
115
|
+
await this.git.run({ cwd: repoPath, stdin: message, stdinEncoding: 'utf8', errors: 'throw', ...runOptions }, ...params);
|
|
126
116
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
127
117
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
128
118
|
}
|
|
@@ -132,7 +122,7 @@ export class OperationsGitSubProvider {
|
|
|
132
122
|
throw getGitCommandError('commit', ex, reason => new CommitError({ reason: reason ?? 'other', gitCommand: { repoPath: repoPath, args: params } }, ex));
|
|
133
123
|
}
|
|
134
124
|
}
|
|
135
|
-
async fetch(repoPath, options) {
|
|
125
|
+
async fetch(repoPath, options, runOptions) {
|
|
136
126
|
const scope = getScopedLogger();
|
|
137
127
|
const { branch, ...opts } = options ?? {};
|
|
138
128
|
try {
|
|
@@ -145,10 +135,10 @@ export class OperationsGitSubProvider {
|
|
|
145
135
|
remote: remoteName,
|
|
146
136
|
upstream: getBranchTrackingWithoutRemote(branch),
|
|
147
137
|
pull: options?.pull,
|
|
148
|
-
});
|
|
138
|
+
}, runOptions);
|
|
149
139
|
}
|
|
150
140
|
else {
|
|
151
|
-
await this.fetchCore(repoPath, opts);
|
|
141
|
+
await this.fetchCore(repoPath, opts, runOptions);
|
|
152
142
|
}
|
|
153
143
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'tags');
|
|
154
144
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['remotes']);
|
|
@@ -158,7 +148,7 @@ export class OperationsGitSubProvider {
|
|
|
158
148
|
throw ex;
|
|
159
149
|
}
|
|
160
150
|
}
|
|
161
|
-
async fetchCore(repoPath, options) {
|
|
151
|
+
async fetchCore(repoPath, options, runOptions) {
|
|
162
152
|
const params = ['fetch'];
|
|
163
153
|
if (options.prune) {
|
|
164
154
|
params.push('--prune');
|
|
@@ -178,7 +168,7 @@ export class OperationsGitSubProvider {
|
|
|
178
168
|
params.push('--all');
|
|
179
169
|
}
|
|
180
170
|
try {
|
|
181
|
-
await this.git.run({ cwd: repoPath }, ...params);
|
|
171
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
|
|
182
172
|
}
|
|
183
173
|
catch (ex) {
|
|
184
174
|
throw getGitCommandError('fetch', ex, reason => new FetchError({
|
|
@@ -189,7 +179,7 @@ export class OperationsGitSubProvider {
|
|
|
189
179
|
}, ex));
|
|
190
180
|
}
|
|
191
181
|
}
|
|
192
|
-
async merge(repoPath, ref, options) {
|
|
182
|
+
async merge(repoPath, ref, options, runOptions) {
|
|
193
183
|
const scope = getScopedLogger();
|
|
194
184
|
const args = ['merge'];
|
|
195
185
|
if (options?.fastForward === 'only') {
|
|
@@ -211,7 +201,7 @@ export class OperationsGitSubProvider {
|
|
|
211
201
|
try {
|
|
212
202
|
await this.git.run(
|
|
213
203
|
// Avoid a timeout since merges can take a long time (set to 0 to disable)
|
|
214
|
-
{ cwd: repoPath, errors: 'throw', timeout: 0 }, ...args);
|
|
204
|
+
{ cwd: repoPath, errors: 'throw', timeout: 0, ...runOptions }, ...args);
|
|
215
205
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
216
206
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
217
207
|
return { conflicted: false };
|
|
@@ -226,7 +216,7 @@ export class OperationsGitSubProvider {
|
|
|
226
216
|
throw mapped;
|
|
227
217
|
}
|
|
228
218
|
}
|
|
229
|
-
async pull(repoPath, options) {
|
|
219
|
+
async pull(repoPath, options, runOptions) {
|
|
230
220
|
const scope = getScopedLogger();
|
|
231
221
|
try {
|
|
232
222
|
if (isBranchReference(options?.branch)) {
|
|
@@ -239,13 +229,13 @@ export class OperationsGitSubProvider {
|
|
|
239
229
|
rebase: options?.rebase,
|
|
240
230
|
tags: options?.tags,
|
|
241
231
|
source: options?.source,
|
|
242
|
-
});
|
|
232
|
+
}, runOptions);
|
|
243
233
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status', 'tags');
|
|
244
234
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'remotes', 'index']);
|
|
245
235
|
}
|
|
246
236
|
else {
|
|
247
237
|
// Branch is not checked out anywhere — can only fetch (no working tree to merge into)
|
|
248
|
-
await this.fetch(repoPath, { branch: branch });
|
|
238
|
+
await this.fetch(repoPath, { branch: branch }, runOptions);
|
|
249
239
|
}
|
|
250
240
|
return;
|
|
251
241
|
}
|
|
@@ -253,7 +243,7 @@ export class OperationsGitSubProvider {
|
|
|
253
243
|
rebase: options?.rebase,
|
|
254
244
|
tags: options?.tags,
|
|
255
245
|
source: options?.source,
|
|
256
|
-
});
|
|
246
|
+
}, runOptions);
|
|
257
247
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status', 'tags');
|
|
258
248
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'remotes', 'index']);
|
|
259
249
|
}
|
|
@@ -262,7 +252,7 @@ export class OperationsGitSubProvider {
|
|
|
262
252
|
throw ex;
|
|
263
253
|
}
|
|
264
254
|
}
|
|
265
|
-
async pullCore(repoPath, options) {
|
|
255
|
+
async pullCore(repoPath, options, runOptions) {
|
|
266
256
|
const params = ['pull'];
|
|
267
257
|
if (options.tags) {
|
|
268
258
|
params.push('--tags');
|
|
@@ -271,14 +261,14 @@ export class OperationsGitSubProvider {
|
|
|
271
261
|
params.push('-r');
|
|
272
262
|
}
|
|
273
263
|
try {
|
|
274
|
-
await this.git.run({ cwd: repoPath, configs: gitConfigsPull }, ...params);
|
|
264
|
+
await this.git.run({ cwd: repoPath, configs: gitConfigsPull, errors: 'throw', ...runOptions }, ...params);
|
|
275
265
|
}
|
|
276
266
|
catch (ex) {
|
|
277
267
|
await this.throwIfSigningError(repoPath, params, ex, options.source);
|
|
278
268
|
throw getGitCommandError('pull', ex, reason => new PullError({ reason: reason ?? 'other', gitCommand: { repoPath: repoPath, args: params } }, ex));
|
|
279
269
|
}
|
|
280
270
|
}
|
|
281
|
-
async push(repoPath, options) {
|
|
271
|
+
async push(repoPath, options, runOptions) {
|
|
282
272
|
const scope = getScopedLogger();
|
|
283
273
|
let branchName;
|
|
284
274
|
let remoteName;
|
|
@@ -298,10 +288,16 @@ export class OperationsGitSubProvider {
|
|
|
298
288
|
const branch = await this.provider.branches.getBranch(repoPath);
|
|
299
289
|
if (branch == null)
|
|
300
290
|
return;
|
|
301
|
-
|
|
302
|
-
options?.
|
|
303
|
-
|
|
304
|
-
|
|
291
|
+
if (options?.reference != null) {
|
|
292
|
+
branchName = `${options.reference.ref}:${options?.publish != null ? 'refs/heads/' : ''}${branch.nameWithoutRemote}`;
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
const tracking = options?.publish == null ? branch.trackingWithoutRemote : undefined;
|
|
296
|
+
branchName =
|
|
297
|
+
tracking != null && tracking !== branch.nameWithoutRemote
|
|
298
|
+
? `${branch.name}:${tracking}`
|
|
299
|
+
: branch.name;
|
|
300
|
+
}
|
|
305
301
|
remoteName = branch.remoteName ?? options?.publish?.remote;
|
|
306
302
|
upstreamName = options?.reference == null && options?.publish != null ? branch.name : undefined;
|
|
307
303
|
// Git can't setup upstream tracking when publishing a new branch to a specific commit, so we'll need to do it after the push
|
|
@@ -318,10 +314,12 @@ export class OperationsGitSubProvider {
|
|
|
318
314
|
}
|
|
319
315
|
let forceOpts;
|
|
320
316
|
if (options?.force) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
317
|
+
// Honor the host's force-push preferences (e.g. VS Code's `git.useForcePushWithLease` /
|
|
318
|
+
// `git.useForcePushIfIncludes`); fall back to the safer `--force-with-lease` behavior.
|
|
319
|
+
const useForceWithLease = this.context.config?.push?.useForceWithLease ?? true;
|
|
320
|
+
forceOpts = useForceWithLease
|
|
321
|
+
? { withLease: true, ifIncludes: this.context.config?.push?.useForceIfIncludes ?? true }
|
|
322
|
+
: { withLease: false };
|
|
325
323
|
}
|
|
326
324
|
try {
|
|
327
325
|
await this.pushCore(repoPath, {
|
|
@@ -330,20 +328,27 @@ export class OperationsGitSubProvider {
|
|
|
330
328
|
upstream: upstreamName,
|
|
331
329
|
force: forceOpts,
|
|
332
330
|
publish: options?.publish != null,
|
|
333
|
-
});
|
|
334
|
-
// Since Git can't setup upstream tracking when publishing a new branch to a specific commit, do it now
|
|
331
|
+
}, runOptions);
|
|
332
|
+
// Since Git can't setup upstream tracking when publishing a new branch to a specific commit, do it now.
|
|
333
|
+
// Soft-fail: the push already succeeded, so don't let a local upstream-tracking failure (cancellation
|
|
334
|
+
// arriving mid-spawn, transient git error) suppress the post-push hook fan-out below.
|
|
335
335
|
if (setUpstream != null) {
|
|
336
|
-
|
|
336
|
+
try {
|
|
337
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, 'branch', '--set-upstream-to', `${setUpstream.remote}/${setUpstream.remoteBranch}`, setUpstream.branch);
|
|
338
|
+
}
|
|
339
|
+
catch (ex) {
|
|
340
|
+
scope?.error(ex, 'Unable to set upstream tracking after publish');
|
|
341
|
+
}
|
|
337
342
|
}
|
|
338
343
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
339
|
-
this.context.hooks?.repository?.onChanged?.(repoPath, ['remotes']);
|
|
344
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, options?.publish != null ? ['config', 'heads', 'remotes'] : ['remotes']);
|
|
340
345
|
}
|
|
341
346
|
catch (ex) {
|
|
342
347
|
scope?.error(ex);
|
|
343
348
|
throw ex;
|
|
344
349
|
}
|
|
345
350
|
}
|
|
346
|
-
async pushCore(repoPath, options) {
|
|
351
|
+
async pushCore(repoPath, options, runOptions) {
|
|
347
352
|
const params = ['push'];
|
|
348
353
|
if (options.force != null) {
|
|
349
354
|
if (options.force.withLease) {
|
|
@@ -376,7 +381,7 @@ export class OperationsGitSubProvider {
|
|
|
376
381
|
params.push(options.delete.remote, `:${options.delete.branch}`);
|
|
377
382
|
}
|
|
378
383
|
try {
|
|
379
|
-
await this.git.run({ cwd: repoPath }, ...params);
|
|
384
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
|
|
380
385
|
}
|
|
381
386
|
catch (ex) {
|
|
382
387
|
const error = getGitCommandError('push', ex, reason => new PushError({
|
|
@@ -416,19 +421,33 @@ export class OperationsGitSubProvider {
|
|
|
416
421
|
throw error;
|
|
417
422
|
}
|
|
418
423
|
}
|
|
419
|
-
async rebase(repoPath, upstream, options) {
|
|
424
|
+
async rebase(repoPath, upstream, options, runOptions) {
|
|
420
425
|
const scope = getScopedLogger();
|
|
421
426
|
const args = ['rebase'];
|
|
422
|
-
|
|
427
|
+
const configs = [];
|
|
423
428
|
if (options?.autoStash !== false) {
|
|
424
429
|
args.push('--autostash');
|
|
425
430
|
}
|
|
426
431
|
if (options?.interactive) {
|
|
427
432
|
args.push('--interactive');
|
|
428
433
|
if (options.editor) {
|
|
429
|
-
configs
|
|
434
|
+
configs.push('-c', `sequence.editor=${options.editor}`);
|
|
435
|
+
}
|
|
436
|
+
// A script-based sequence editor rewrites the todo by command word + SHA, so git must emit a
|
|
437
|
+
// plain, natural-order todo regardless of the user's rebase config: `rebase.autosquash` would
|
|
438
|
+
// reorder commits and rewrite `pick`→`fixup`, and `rebase.abbreviateCommands` would emit `p`.
|
|
439
|
+
if (options.programmaticEditor) {
|
|
440
|
+
configs.push('-c', 'rebase.autosquash=false', '-c', 'rebase.abbreviateCommands=false');
|
|
430
441
|
}
|
|
431
442
|
}
|
|
443
|
+
// Drive per-commit message editing (the combined message a `squash` produces, or a `reword`).
|
|
444
|
+
// `GIT_EDITOR` (not `core.editor`) is what git's interactive-rebase backend honors for the `reword`
|
|
445
|
+
// amend step, so set it on the environment; also set `core.editor` config as a fallback.
|
|
446
|
+
let env = runOptions?.env;
|
|
447
|
+
if (options?.messageEditor) {
|
|
448
|
+
configs.push('-c', `core.editor=${options.messageEditor}`);
|
|
449
|
+
env = { ...env, GIT_EDITOR: options.messageEditor };
|
|
450
|
+
}
|
|
432
451
|
if (options?.updateRefs) {
|
|
433
452
|
args.push('--update-refs');
|
|
434
453
|
}
|
|
@@ -442,7 +461,7 @@ export class OperationsGitSubProvider {
|
|
|
442
461
|
try {
|
|
443
462
|
await this.git.run(
|
|
444
463
|
// Avoid a timeout since rebases can take a long time (set to 0 to disable)
|
|
445
|
-
{ cwd: repoPath, errors: 'throw', configs: configs, timeout: 0 }, ...args);
|
|
464
|
+
{ cwd: repoPath, errors: 'throw', configs: configs, timeout: 0, ...runOptions, env: env }, ...args);
|
|
446
465
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
447
466
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
448
467
|
return { conflicted: false };
|
|
@@ -461,10 +480,10 @@ export class OperationsGitSubProvider {
|
|
|
461
480
|
throw mapped;
|
|
462
481
|
}
|
|
463
482
|
}
|
|
464
|
-
async reset(repoPath, rev, options) {
|
|
483
|
+
async reset(repoPath, rev, options, runOptions) {
|
|
465
484
|
const scope = getScopedLogger();
|
|
466
485
|
try {
|
|
467
|
-
await this.resetCore(repoPath, rev, options?.mode);
|
|
486
|
+
await this.resetCore(repoPath, rev, options?.mode, runOptions);
|
|
468
487
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
469
488
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
470
489
|
}
|
|
@@ -473,20 +492,69 @@ export class OperationsGitSubProvider {
|
|
|
473
492
|
throw ex;
|
|
474
493
|
}
|
|
475
494
|
}
|
|
476
|
-
async resetCore(repoPath, rev, mode) {
|
|
495
|
+
async resetCore(repoPath, rev, mode, runOptions) {
|
|
477
496
|
const params = ['reset', '-q'];
|
|
478
497
|
if (mode) {
|
|
479
498
|
params.push(`--${mode}`);
|
|
480
499
|
}
|
|
481
500
|
params.push(rev, '--');
|
|
482
501
|
try {
|
|
483
|
-
await this.git.run({ cwd: repoPath }, ...params);
|
|
502
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...params);
|
|
484
503
|
}
|
|
485
504
|
catch (ex) {
|
|
486
505
|
throw getGitCommandError('reset', ex, reason => new ResetError({ reason: reason ?? 'other', gitCommand: { repoPath: repoPath, args: params } }, ex));
|
|
487
506
|
}
|
|
488
507
|
}
|
|
489
|
-
async
|
|
508
|
+
async restore(repoPath, path, options, runOptions) {
|
|
509
|
+
const paths = Array.isArray(path) ? path : [path];
|
|
510
|
+
if (!paths.length)
|
|
511
|
+
return;
|
|
512
|
+
const scope = getScopedLogger();
|
|
513
|
+
const normalized = paths.map(p => splitPath(p, repoPath, true)[0]);
|
|
514
|
+
// `side` and `ref` are mutually exclusive in git (--ours/--theirs apply during conflict
|
|
515
|
+
// resolution and take no source ref); side takes precedence if both are somehow supplied.
|
|
516
|
+
// Use a truthy check on `ref` so an empty string falls through to index-restore rather than
|
|
517
|
+
// producing a malformed `git checkout '' -- …`. Implemented via `checkout` rather than
|
|
518
|
+
// `git restore` for compatibility with the minimum supported git (2.7.2); `git restore`
|
|
519
|
+
// only landed in 2.23.
|
|
520
|
+
const selector = options?.side != null ? `--${options.side}` : options?.ref || undefined;
|
|
521
|
+
const prefix = selector != null ? ['checkout', selector, '--'] : ['checkout', '--'];
|
|
522
|
+
try {
|
|
523
|
+
if (await this.git.supports('git:checkout:pathspec-from-file')) {
|
|
524
|
+
// Git ≥ 2.26: stream all pathspecs via stdin (NUL-separated) in a single invocation —
|
|
525
|
+
// no CLI-length limit (so no batching), and robust for paths with spaces/newlines.
|
|
526
|
+
// Pathspecs come from the file rather than argv, so `--` isn't used.
|
|
527
|
+
const args = ['checkout'];
|
|
528
|
+
if (selector != null) {
|
|
529
|
+
args.push(selector);
|
|
530
|
+
}
|
|
531
|
+
args.push('--pathspec-from-file=-', '--pathspec-file-nul');
|
|
532
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions, stdin: normalized.join('\0') }, ...args);
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
// Older git: pass pathspecs as args, one git invocation per chunk (collapsing N
|
|
536
|
+
// path-mode checkouts into ⌈N / chunk⌉ spawns). Reserve the command prefix length and
|
|
537
|
+
// a per-arg overhead (separator + possible quoting) so the assembled command line
|
|
538
|
+
// can't exceed the OS limit even with many short paths.
|
|
539
|
+
const perArgOverhead = 3;
|
|
540
|
+
const prefixLength = prefix.reduce((sum, arg) => sum + arg.length + perArgOverhead, 0);
|
|
541
|
+
for (const batch of chunkByStringLength(normalized, maxGitCliLength - prefixLength, perArgOverhead)) {
|
|
542
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...prefix, ...batch);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'status');
|
|
546
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['index']);
|
|
547
|
+
}
|
|
548
|
+
catch (ex) {
|
|
549
|
+
scope?.error(ex);
|
|
550
|
+
throw getGitCommandError('checkout', ex, reason => new CheckoutError({
|
|
551
|
+
reason: reason ?? 'other',
|
|
552
|
+
ref: options?.side ?? options?.ref,
|
|
553
|
+
gitCommand: { repoPath: repoPath, args: [...prefix, ...normalized] },
|
|
554
|
+
}, ex));
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
async revert(repoPath, refs, options, runOptions) {
|
|
490
558
|
const scope = getScopedLogger();
|
|
491
559
|
const args = ['revert'];
|
|
492
560
|
if (options?.editMessage === true) {
|
|
@@ -499,7 +567,7 @@ export class OperationsGitSubProvider {
|
|
|
499
567
|
try {
|
|
500
568
|
await this.git.run(
|
|
501
569
|
// Avoid a timeout since reverts can take a long time (set to 0 to disable)
|
|
502
|
-
{ cwd: repoPath, errors: 'throw', timeout: 0 }, ...args);
|
|
570
|
+
{ cwd: repoPath, errors: 'throw', timeout: 0, ...runOptions }, ...args);
|
|
503
571
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
504
572
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
505
573
|
return { conflicted: false };
|
|
@@ -590,6 +658,10 @@ __decorate([
|
|
|
590
658
|
__decorate([
|
|
591
659
|
debug()
|
|
592
660
|
], OperationsGitSubProvider.prototype, "reset", null);
|
|
661
|
+
__decorate([
|
|
662
|
+
sequentialize({ getQueueKey: rp => rp }),
|
|
663
|
+
debug()
|
|
664
|
+
], OperationsGitSubProvider.prototype, "restore", null);
|
|
593
665
|
__decorate([
|
|
594
666
|
sequentialize({ getQueueKey: rp => rp }),
|
|
595
667
|
debug()
|