@gitkraken/core-gitlens 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -1
- package/dist/git/cache.d.ts +49 -9
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +174 -14
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +11 -2
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/models/branch.d.ts +1 -0
- package/dist/git/models/branch.d.ts.map +1 -1
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/models/commit.d.ts +1 -9
- package/dist/git/models/commit.d.ts.map +1 -1
- package/dist/git/models/commit.js +4 -9
- package/dist/git/models/commit.js.map +1 -1
- package/dist/git/models/graph.d.ts +2 -4
- package/dist/git/models/graph.d.ts.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/repository.d.ts +20 -3
- package/dist/git/models/repository.d.ts.map +1 -1
- package/dist/git/models/repository.js +42 -5
- 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/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 +0 -1
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +22 -61
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/providers/branches.d.ts +18 -4
- package/dist/git/providers/branches.d.ts.map +1 -1
- package/dist/git/providers/commits.d.ts +6 -0
- package/dist/git/providers/commits.d.ts.map +1 -1
- package/dist/git/providers/config.d.ts +6 -1
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/diff.d.ts +2 -0
- package/dist/git/providers/diff.d.ts.map +1 -1
- package/dist/git/providers/operations.d.ts +39 -10
- 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/revision.d.ts +1 -1
- package/dist/git/providers/revision.d.ts.map +1 -1
- package/dist/git/providers/staging.d.ts +18 -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/{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/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/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 +14 -0
- package/dist/git/utils/sorting.d.ts.map +1 -1
- package/dist/git/utils/sorting.js +34 -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.map +1 -1
- package/dist/git/watching/watchService.js +24 -4
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts.map +1 -1
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git-cli/cliGitProvider.js +1 -1
- package/dist/git-cli/cliGitProvider.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 +31 -6
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +70 -9
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +22 -6
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +88 -24
- 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.d.ts +1 -0
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +4 -0
- 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 +1 -1
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +17 -5
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +245 -162
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +4 -0
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +120 -35
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +11 -2
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +36 -11
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/contributors.d.ts.map +1 -1
- package/dist/git-cli/providers/contributors.js +7 -4
- package/dist/git-cli/providers/contributors.js.map +1 -1
- package/dist/git-cli/providers/diff.d.ts +2 -0
- package/dist/git-cli/providers/diff.d.ts.map +1 -1
- package/dist/git-cli/providers/diff.js +92 -20
- 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 +49 -28
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +30 -11
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +146 -43
- 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 +15 -30
- 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 +13 -7
- 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 +312 -9
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.js +4 -4
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +1 -1
- package/dist/git-cli/providers/revision.d.ts.map +1 -1
- package/dist/git-cli/providers/revision.js +15 -11
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +8 -0
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js +52 -8
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +0 -8
- package/dist/git-cli/providers/stash.d.ts.map +1 -1
- package/dist/git-cli/providers/stash.js +63 -119
- 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 +10 -9
- 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 +13 -9
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/git-cli/providers/worktrees.js +3 -3
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/ipc/discovery.d.ts +27 -0
- package/dist/ipc/discovery.d.ts.map +1 -0
- package/dist/ipc/discovery.js +38 -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 +114 -0
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +1 -0
- package/dist/plus/agents/providers/claudeCodeProvider.js +1480 -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 +203 -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/constants.d.ts +2 -1
- package/dist/plus/ai/constants.d.ts.map +1 -1
- package/dist/plus/ai/constants.js +7 -0
- package/dist/plus/ai/constants.js.map +1 -1
- 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 +28 -2
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/models/results.d.ts +28 -0
- package/dist/plus/ai/models/results.d.ts.map +1 -1
- package/dist/plus/ai/prompts.d.ts +4 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +167 -1
- package/dist/plus/ai/prompts.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 +3 -0
- package/dist/plus/ai/utils/results.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/results.utils.js +75 -0
- package/dist/plus/ai/utils/results.utils.js.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts +1 -1
- package/dist/plus/ai/utils/truncation.utils.d.ts.map +1 -1
- package/dist/plus/ai/utils/truncation.utils.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +10 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +156 -49
- 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 +60 -22
- 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 +3 -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 +38 -13
- 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/decorators/log.js +1 -1
- package/dist/utils/decorators/log.js.map +1 -1
- package/dist/utils/decorators/sequentialize.d.ts.map +1 -1
- package/dist/utils/decorators/sequentialize.js +4 -2
- package/dist/utils/decorators/sequentialize.js.map +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/base64.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/formatter.d.ts.map +1 -1
- package/dist/utils/formatter.js +4 -10
- package/dist/utils/formatter.js.map +1 -1
- package/dist/utils/iterable.d.ts.map +1 -1
- 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 +49 -0
- package/dist/utils/lruMap.d.ts.map +1 -0
- package/dist/utils/lruMap.js +103 -0
- package/dist/utils/lruMap.js.map +1 -0
- 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/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 +22 -0
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/string.d.ts.map +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 +14 -0
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +48 -0
- package/dist/utils/version.js.map +1 -1
- package/package.json +13 -1
- package/src/git/cache.ts +309 -29
- package/src/git/context.ts +11 -2
- package/src/git/models/branch.ts +1 -0
- package/src/git/models/commit.ts +2 -17
- package/src/git/models/graph.ts +2 -4
- package/src/git/models/reference.ts +33 -0
- package/src/git/models/remote.ts +1 -0
- package/src/git/models/repository.ts +44 -6
- package/src/git/models/search.ts +2 -2
- package/src/git/models/worktree.ts +10 -2
- package/src/git/parsers/diffParser.ts +9 -44
- package/src/git/providers/branches.ts +25 -4
- package/src/git/providers/commits.ts +7 -0
- package/src/git/providers/config.ts +4 -0
- package/src/git/providers/diff.ts +8 -2
- package/src/git/providers/operations.ts +54 -3
- package/src/git/providers/pausedOperations.ts +1 -0
- package/src/git/providers/refs.ts +32 -3
- package/src/git/providers/revision.ts +5 -1
- package/src/git/providers/staging.ts +14 -0
- package/src/git/providers/status.ts +6 -1
- package/src/git/remotes/azure-devops.ts +2 -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/fileStatus.utils.ts +7 -1
- package/src/git/utils/search.utils.ts +2 -0
- package/src/git/utils/sorting.ts +38 -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 +38 -5
- package/src/git/watching/watchSession.ts +10 -0
- package/src/git-cli/cliGitProvider.ts +1 -1
- package/src/git-cli/exec/exec.types.ts +2 -2
- package/src/git-cli/exec/git.ts +76 -23
- package/src/git-cli/exec/gitQueue.ts +98 -25
- package/src/git-cli/parsers/blameParser.ts +1 -0
- package/src/git-cli/parsers/logParser.ts +6 -1
- package/src/git-cli/parsers/refParser.ts +33 -34
- package/src/git-cli/providers/blame.ts +2 -1
- package/src/git-cli/providers/branches.ts +341 -196
- package/src/git-cli/providers/commits.ts +145 -46
- package/src/git-cli/providers/config.ts +50 -16
- package/src/git-cli/providers/contributors.ts +7 -12
- package/src/git-cli/providers/diff.ts +107 -20
- package/src/git-cli/providers/graph.ts +58 -29
- package/src/git-cli/providers/operations.ts +253 -57
- package/src/git-cli/providers/patch.ts +16 -37
- package/src/git-cli/providers/pausedOperations.ts +14 -6
- package/src/git-cli/providers/refs.ts +274 -11
- package/src/git-cli/providers/remotes.ts +4 -4
- package/src/git-cli/providers/revision.ts +22 -15
- package/src/git-cli/providers/staging.ts +51 -8
- package/src/git-cli/providers/stash.ts +67 -134
- package/src/git-cli/providers/status.ts +21 -10
- package/src/git-cli/providers/tags.ts +18 -19
- package/src/git-cli/providers/worktrees.ts +3 -3
- package/src/ipc/discovery.ts +56 -0
- package/src/ipc/ipcServer.ts +171 -0
- package/src/plus/agents/providers/claudeCodeProvider.ts +1782 -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 +277 -0
- package/src/plus/ai/constants.ts +8 -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 +42 -0
- package/src/plus/ai/models/results.ts +30 -0
- package/src/plus/ai/prompts.ts +171 -1
- package/src/plus/ai/utils/ai.utils.ts +2 -0
- package/src/plus/ai/utils/results.utils.ts +101 -0
- package/src/plus/ai/utils/truncation.utils.ts +3 -1
- package/src/plus/git-github/api/github.ts +199 -53
- 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 +75 -33
- package/src/plus/git-github/providers/github/commits.ts +231 -160
- package/src/plus/git-github/providers/github/diff.ts +35 -21
- package/src/plus/git-github/providers/github/refs.ts +57 -22
- 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/decorators/log.ts +1 -1
- package/src/utils/decorators/sequentialize.ts +8 -6
- 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/base64.ts +1 -1
- package/src/utils/env/node/exec.ts +4 -2
- package/src/utils/error.ts +1 -0
- package/src/utils/formatter.ts +4 -11
- package/src/utils/iterable.ts +4 -1
- package/src/utils/logger.ts +1 -0
- package/src/utils/lruMap.ts +112 -0
- package/src/utils/markdown.ts +1 -0
- package/src/utils/mru.ts +2 -0
- package/src/utils/path.ts +1 -0
- package/src/utils/promise.ts +22 -0
- package/src/utils/promiseCache.ts +24 -0
- package/src/utils/string.ts +2 -0
- package/src/utils/uri.ts +1 -0
- package/src/utils/version.ts +49 -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
|
@@ -11,10 +11,16 @@ import {
|
|
|
11
11
|
RebaseError,
|
|
12
12
|
ResetError,
|
|
13
13
|
RevertError,
|
|
14
|
+
SigningError,
|
|
14
15
|
} from '../../git/errors.js';
|
|
15
16
|
import type { GitBranchReference, GitReference } from '../../git/models/reference.js';
|
|
17
|
+
import type { SigningFormat } from '../../git/models/signature.js';
|
|
16
18
|
import type { GitConflictFile } from '../../git/models/staging.js';
|
|
17
|
-
import type {
|
|
19
|
+
import type {
|
|
20
|
+
GitOperationResult,
|
|
21
|
+
GitOperationRunOptions,
|
|
22
|
+
GitOperationsSubProvider,
|
|
23
|
+
} from '../../git/providers/operations.js';
|
|
18
24
|
import { getBranchNameAndRemote, getBranchTrackingWithoutRemote } from '../../git/utils/branch.utils.js';
|
|
19
25
|
import { isBranchReference } from '../../git/utils/reference.utils.js';
|
|
20
26
|
import { debug } from '../../utils/decorators/log.js';
|
|
@@ -24,7 +30,14 @@ import { getScopedLogger } from '../../utils/logger.scoped.js';
|
|
|
24
30
|
import { normalizePath, splitPath } from '../../utils/path.js';
|
|
25
31
|
import type { CliGitProviderInternal } from '../cliGitProvider.js';
|
|
26
32
|
import type { Git, PushForceOptions } from '../exec/git.js';
|
|
27
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
classifySigningError,
|
|
35
|
+
getGitCommandError,
|
|
36
|
+
gitConfigsPull,
|
|
37
|
+
GitErrors,
|
|
38
|
+
inferSigningFormatFromError,
|
|
39
|
+
maxGitCliLength,
|
|
40
|
+
} from '../exec/git.js';
|
|
28
41
|
|
|
29
42
|
export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
30
43
|
constructor(
|
|
@@ -39,11 +52,12 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
39
52
|
repoPath: string,
|
|
40
53
|
ref: string,
|
|
41
54
|
options?: { createBranch?: string } | { path?: string },
|
|
55
|
+
runOptions?: GitOperationRunOptions,
|
|
42
56
|
): Promise<void> {
|
|
43
57
|
const scope = getScopedLogger();
|
|
44
58
|
|
|
45
59
|
try {
|
|
46
|
-
await this.checkoutCore(repoPath, ref, options);
|
|
60
|
+
await this.checkoutCore(repoPath, ref, options, runOptions);
|
|
47
61
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
48
62
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
49
63
|
} catch (ex) {
|
|
@@ -56,6 +70,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
56
70
|
repoPath: string,
|
|
57
71
|
ref: string,
|
|
58
72
|
{ createBranch, path }: { createBranch?: string; path?: string } = {},
|
|
73
|
+
runOptions?: GitOperationRunOptions,
|
|
59
74
|
): Promise<void> {
|
|
60
75
|
const params = ['checkout'];
|
|
61
76
|
if (createBranch) {
|
|
@@ -70,7 +85,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
70
85
|
}
|
|
71
86
|
|
|
72
87
|
try {
|
|
73
|
-
await this.git.
|
|
88
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, ...params);
|
|
74
89
|
} catch (ex) {
|
|
75
90
|
throw getGitCommandError(
|
|
76
91
|
'checkout',
|
|
@@ -84,12 +99,101 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
84
99
|
}
|
|
85
100
|
}
|
|
86
101
|
|
|
102
|
+
@debug()
|
|
103
|
+
async checkoutConflictedPath(
|
|
104
|
+
repoPath: string,
|
|
105
|
+
path: string,
|
|
106
|
+
side: 'ours' | 'theirs',
|
|
107
|
+
runOptions?: GitOperationRunOptions,
|
|
108
|
+
): Promise<void> {
|
|
109
|
+
const scope = getScopedLogger();
|
|
110
|
+
|
|
111
|
+
[path, repoPath] = splitPath(path, repoPath, true);
|
|
112
|
+
const params = ['checkout', `--${side}`, '--', path];
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, ...params);
|
|
116
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'status');
|
|
117
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['index']);
|
|
118
|
+
} catch (ex) {
|
|
119
|
+
scope?.error(ex);
|
|
120
|
+
throw getGitCommandError(
|
|
121
|
+
'checkout',
|
|
122
|
+
ex,
|
|
123
|
+
reason =>
|
|
124
|
+
new CheckoutError(
|
|
125
|
+
{ reason: reason ?? 'other', ref: side, gitCommand: { repoPath: repoPath, args: params } },
|
|
126
|
+
ex,
|
|
127
|
+
),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@debug()
|
|
133
|
+
async checkoutConflictedPaths(
|
|
134
|
+
repoPath: string,
|
|
135
|
+
paths: string[],
|
|
136
|
+
side: 'ours' | 'theirs',
|
|
137
|
+
runOptions?: GitOperationRunOptions,
|
|
138
|
+
): Promise<void> {
|
|
139
|
+
if (!paths.length) return;
|
|
140
|
+
|
|
141
|
+
const scope = getScopedLogger();
|
|
142
|
+
const normalized = paths.map(p => splitPath(p, repoPath, true)[0]);
|
|
143
|
+
|
|
144
|
+
// Build batches by accumulating the length of each path + a small per-arg overhead (separator +
|
|
145
|
+
// possible quoting), so a single long path — or just the overhead itself — can't push a batch
|
|
146
|
+
// past the CLI length limit. Always keep at least one path per batch, even if a lone path is
|
|
147
|
+
// longer than the limit (the OS may still accept it on some platforms).
|
|
148
|
+
const perArgOverhead = 3;
|
|
149
|
+
const batches: string[][] = [];
|
|
150
|
+
let current: string[] = [];
|
|
151
|
+
let currentLen = 0;
|
|
152
|
+
for (const p of normalized) {
|
|
153
|
+
const cost = p.length + perArgOverhead;
|
|
154
|
+
if (current.length > 0 && currentLen + cost > maxGitCliLength) {
|
|
155
|
+
batches.push(current);
|
|
156
|
+
current = [];
|
|
157
|
+
currentLen = 0;
|
|
158
|
+
}
|
|
159
|
+
current.push(p);
|
|
160
|
+
currentLen += cost;
|
|
161
|
+
}
|
|
162
|
+
if (current.length) {
|
|
163
|
+
batches.push(current);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
try {
|
|
167
|
+
for (const batch of batches) {
|
|
168
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, 'checkout', `--${side}`, '--', ...batch);
|
|
169
|
+
}
|
|
170
|
+
this.context.hooks?.cache?.onReset?.(repoPath, 'status');
|
|
171
|
+
this.context.hooks?.repository?.onChanged?.(repoPath, ['index']);
|
|
172
|
+
} catch (ex) {
|
|
173
|
+
scope?.error(ex);
|
|
174
|
+
throw getGitCommandError(
|
|
175
|
+
'checkout',
|
|
176
|
+
ex,
|
|
177
|
+
reason =>
|
|
178
|
+
new CheckoutError(
|
|
179
|
+
{
|
|
180
|
+
reason: reason ?? 'other',
|
|
181
|
+
ref: side,
|
|
182
|
+
gitCommand: { repoPath: repoPath, args: ['checkout', `--${side}`, '--', ...normalized] },
|
|
183
|
+
},
|
|
184
|
+
ex,
|
|
185
|
+
),
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
87
190
|
@sequentialize({ getQueueKey: rp => rp })
|
|
88
191
|
@debug()
|
|
89
192
|
async cherryPick(
|
|
90
193
|
repoPath: string,
|
|
91
194
|
revs: string[],
|
|
92
|
-
options?: { edit?: boolean; noCommit?: boolean },
|
|
195
|
+
options?: { edit?: boolean; noCommit?: boolean; source?: unknown },
|
|
196
|
+
runOptions?: GitOperationRunOptions,
|
|
93
197
|
): Promise<GitOperationResult> {
|
|
94
198
|
const scope = getScopedLogger();
|
|
95
199
|
|
|
@@ -102,9 +206,10 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
102
206
|
}
|
|
103
207
|
|
|
104
208
|
if (revs.length > 1) {
|
|
105
|
-
// Sort commits in topological order (oldest ancestor first) so cherry-pick applies them correctly
|
|
209
|
+
// Sort commits in topological order (oldest ancestor first) so cherry-pick applies them correctly.
|
|
210
|
+
// This is a local read-only pre-flight, not the user-initiated op — don't subject it to caller env/timeout.
|
|
106
211
|
const revsSet = new Set(revs);
|
|
107
|
-
const result = await this.git.
|
|
212
|
+
const result = await this.git.run({ cwd: repoPath }, 'rev-list', '--topo-order', '--reverse', ...revs);
|
|
108
213
|
|
|
109
214
|
const ordered: string[] = [];
|
|
110
215
|
for (const sha of result.stdout.trim().split('\n')) {
|
|
@@ -123,12 +228,13 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
123
228
|
args.push(...revs);
|
|
124
229
|
|
|
125
230
|
try {
|
|
126
|
-
await this.git.
|
|
231
|
+
await this.git.run({ cwd: repoPath, errors: 'throw', ...runOptions }, ...args);
|
|
127
232
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
128
233
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
129
234
|
return { conflicted: false };
|
|
130
235
|
} catch (ex) {
|
|
131
236
|
scope?.error(ex);
|
|
237
|
+
await this.throwIfSigningError(repoPath, args, ex, options?.source);
|
|
132
238
|
const mapped = getGitCommandError(
|
|
133
239
|
'cherry-pick',
|
|
134
240
|
ex,
|
|
@@ -157,7 +263,9 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
157
263
|
author?: string;
|
|
158
264
|
date?: string;
|
|
159
265
|
signoff?: boolean;
|
|
266
|
+
source?: unknown;
|
|
160
267
|
},
|
|
268
|
+
runOptions?: GitOperationRunOptions,
|
|
161
269
|
): Promise<void> {
|
|
162
270
|
const scope = getScopedLogger();
|
|
163
271
|
|
|
@@ -184,11 +292,15 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
184
292
|
params.push('-F', '-');
|
|
185
293
|
|
|
186
294
|
try {
|
|
187
|
-
await this.git.
|
|
295
|
+
await this.git.run(
|
|
296
|
+
{ cwd: repoPath, stdin: message, stdinEncoding: 'utf8', errors: 'throw', ...runOptions },
|
|
297
|
+
...params,
|
|
298
|
+
);
|
|
188
299
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
189
300
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
190
301
|
} catch (ex) {
|
|
191
302
|
scope?.error(ex);
|
|
303
|
+
await this.throwIfSigningError(repoPath, params, ex, options?.source);
|
|
192
304
|
throw getGitCommandError(
|
|
193
305
|
'commit',
|
|
194
306
|
ex,
|
|
@@ -206,6 +318,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
206
318
|
async fetch(
|
|
207
319
|
repoPath: string,
|
|
208
320
|
options?: { all?: boolean; branch?: GitBranchReference; prune?: boolean; pull?: boolean; remote?: string },
|
|
321
|
+
runOptions?: GitOperationRunOptions,
|
|
209
322
|
): Promise<void> {
|
|
210
323
|
const scope = getScopedLogger();
|
|
211
324
|
|
|
@@ -215,14 +328,18 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
215
328
|
const [branchName, remoteName] = getBranchNameAndRemote(branch);
|
|
216
329
|
if (remoteName == null) return;
|
|
217
330
|
|
|
218
|
-
await this.fetchCore(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
331
|
+
await this.fetchCore(
|
|
332
|
+
repoPath,
|
|
333
|
+
{
|
|
334
|
+
branch: branchName,
|
|
335
|
+
remote: remoteName,
|
|
336
|
+
upstream: getBranchTrackingWithoutRemote(branch)!,
|
|
337
|
+
pull: options?.pull,
|
|
338
|
+
},
|
|
339
|
+
runOptions,
|
|
340
|
+
);
|
|
224
341
|
} else {
|
|
225
|
-
await this.fetchCore(repoPath, opts);
|
|
342
|
+
await this.fetchCore(repoPath, opts, runOptions);
|
|
226
343
|
}
|
|
227
344
|
|
|
228
345
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'tags');
|
|
@@ -245,6 +362,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
245
362
|
remote: string;
|
|
246
363
|
upstream: string;
|
|
247
364
|
},
|
|
365
|
+
runOptions?: GitOperationRunOptions,
|
|
248
366
|
): Promise<void> {
|
|
249
367
|
const params = ['fetch'];
|
|
250
368
|
|
|
@@ -265,7 +383,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
265
383
|
}
|
|
266
384
|
|
|
267
385
|
try {
|
|
268
|
-
await this.git.
|
|
386
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, ...params);
|
|
269
387
|
} catch (ex) {
|
|
270
388
|
throw getGitCommandError(
|
|
271
389
|
'fetch',
|
|
@@ -289,7 +407,8 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
289
407
|
async merge(
|
|
290
408
|
repoPath: string,
|
|
291
409
|
ref: string,
|
|
292
|
-
options?: { fastForward?: boolean | 'only'; noCommit?: boolean; squash?: boolean },
|
|
410
|
+
options?: { fastForward?: boolean | 'only'; noCommit?: boolean; squash?: boolean; source?: unknown },
|
|
411
|
+
runOptions?: GitOperationRunOptions,
|
|
293
412
|
): Promise<GitOperationResult> {
|
|
294
413
|
const scope = getScopedLogger();
|
|
295
414
|
|
|
@@ -312,9 +431,9 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
312
431
|
args.push(ref);
|
|
313
432
|
|
|
314
433
|
try {
|
|
315
|
-
await this.git.
|
|
434
|
+
await this.git.run(
|
|
316
435
|
// Avoid a timeout since merges can take a long time (set to 0 to disable)
|
|
317
|
-
{ cwd: repoPath, errors: 'throw', timeout: 0 },
|
|
436
|
+
{ cwd: repoPath, errors: 'throw', timeout: 0, ...runOptions },
|
|
318
437
|
...args,
|
|
319
438
|
);
|
|
320
439
|
|
|
@@ -323,6 +442,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
323
442
|
return { conflicted: false };
|
|
324
443
|
} catch (ex) {
|
|
325
444
|
scope?.error(ex);
|
|
445
|
+
await this.throwIfSigningError(repoPath, args, ex, options?.source);
|
|
326
446
|
const mapped = getGitCommandError(
|
|
327
447
|
'merge',
|
|
328
448
|
ex,
|
|
@@ -343,7 +463,8 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
343
463
|
@debug()
|
|
344
464
|
async pull(
|
|
345
465
|
repoPath: string,
|
|
346
|
-
options?: { branch?: GitBranchReference; rebase?: boolean; tags?: boolean },
|
|
466
|
+
options?: { branch?: GitBranchReference; rebase?: boolean; tags?: boolean; source?: unknown },
|
|
467
|
+
runOptions?: GitOperationRunOptions,
|
|
347
468
|
): Promise<void> {
|
|
348
469
|
const scope = getScopedLogger();
|
|
349
470
|
|
|
@@ -357,23 +478,33 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
357
478
|
);
|
|
358
479
|
if (worktree != null) {
|
|
359
480
|
// Branch is checked out in a worktree — run git pull in that worktree's directory
|
|
360
|
-
await this.pullCore(
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
481
|
+
await this.pullCore(
|
|
482
|
+
normalizePath(worktree.uri.fsPath),
|
|
483
|
+
{
|
|
484
|
+
rebase: options?.rebase,
|
|
485
|
+
tags: options?.tags,
|
|
486
|
+
source: options?.source,
|
|
487
|
+
},
|
|
488
|
+
runOptions,
|
|
489
|
+
);
|
|
364
490
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status', 'tags');
|
|
365
491
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'remotes', 'index']);
|
|
366
492
|
} else {
|
|
367
493
|
// Branch is not checked out anywhere — can only fetch (no working tree to merge into)
|
|
368
|
-
await this.fetch(repoPath, { branch: branch });
|
|
494
|
+
await this.fetch(repoPath, { branch: branch }, runOptions);
|
|
369
495
|
}
|
|
370
496
|
return;
|
|
371
497
|
}
|
|
372
498
|
|
|
373
|
-
await this.pullCore(
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
499
|
+
await this.pullCore(
|
|
500
|
+
repoPath,
|
|
501
|
+
{
|
|
502
|
+
rebase: options?.rebase,
|
|
503
|
+
tags: options?.tags,
|
|
504
|
+
source: options?.source,
|
|
505
|
+
},
|
|
506
|
+
runOptions,
|
|
507
|
+
);
|
|
377
508
|
|
|
378
509
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status', 'tags');
|
|
379
510
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'remotes', 'index']);
|
|
@@ -383,7 +514,11 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
383
514
|
}
|
|
384
515
|
}
|
|
385
516
|
|
|
386
|
-
private async pullCore(
|
|
517
|
+
private async pullCore(
|
|
518
|
+
repoPath: string,
|
|
519
|
+
options: { rebase?: boolean; tags?: boolean; source?: unknown },
|
|
520
|
+
runOptions?: GitOperationRunOptions,
|
|
521
|
+
): Promise<void> {
|
|
387
522
|
const params = ['pull'];
|
|
388
523
|
|
|
389
524
|
if (options.tags) {
|
|
@@ -395,8 +530,9 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
395
530
|
}
|
|
396
531
|
|
|
397
532
|
try {
|
|
398
|
-
await this.git.
|
|
533
|
+
await this.git.run({ cwd: repoPath, configs: gitConfigsPull, ...runOptions }, ...params);
|
|
399
534
|
} catch (ex) {
|
|
535
|
+
await this.throwIfSigningError(repoPath, params, ex, options.source);
|
|
400
536
|
throw getGitCommandError(
|
|
401
537
|
'pull',
|
|
402
538
|
ex,
|
|
@@ -411,6 +547,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
411
547
|
async push(
|
|
412
548
|
repoPath: string,
|
|
413
549
|
options?: { reference?: GitReference; force?: boolean; publish?: { remote: string } },
|
|
550
|
+
runOptions?: GitOperationRunOptions,
|
|
414
551
|
): Promise<void> {
|
|
415
552
|
const scope = getScopedLogger();
|
|
416
553
|
|
|
@@ -469,27 +606,40 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
469
606
|
}
|
|
470
607
|
|
|
471
608
|
try {
|
|
472
|
-
await this.pushCore(
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
609
|
+
await this.pushCore(
|
|
610
|
+
repoPath,
|
|
611
|
+
{
|
|
612
|
+
branch: branchName,
|
|
613
|
+
remote: remoteName,
|
|
614
|
+
upstream: upstreamName,
|
|
615
|
+
force: forceOpts,
|
|
616
|
+
publish: options?.publish != null,
|
|
617
|
+
},
|
|
618
|
+
runOptions,
|
|
619
|
+
);
|
|
620
|
+
|
|
621
|
+
// Since Git can't setup upstream tracking when publishing a new branch to a specific commit, do it now.
|
|
622
|
+
// Soft-fail: the push already succeeded, so don't let a local upstream-tracking failure (cancellation
|
|
623
|
+
// arriving mid-spawn, transient git error) suppress the post-push hook fan-out below.
|
|
481
624
|
if (setUpstream != null) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
625
|
+
try {
|
|
626
|
+
await this.git.run(
|
|
627
|
+
{ cwd: repoPath, ...runOptions },
|
|
628
|
+
'branch',
|
|
629
|
+
'--set-upstream-to',
|
|
630
|
+
`${setUpstream.remote}/${setUpstream.remoteBranch}`,
|
|
631
|
+
setUpstream.branch,
|
|
632
|
+
);
|
|
633
|
+
} catch (ex) {
|
|
634
|
+
scope?.error(ex, 'Unable to set upstream tracking after publish');
|
|
635
|
+
}
|
|
489
636
|
}
|
|
490
637
|
|
|
491
638
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches');
|
|
492
|
-
this.context.hooks?.repository?.onChanged?.(
|
|
639
|
+
this.context.hooks?.repository?.onChanged?.(
|
|
640
|
+
repoPath,
|
|
641
|
+
options?.publish != null ? ['config', 'heads', 'remotes'] : ['remotes'],
|
|
642
|
+
);
|
|
493
643
|
} catch (ex) {
|
|
494
644
|
scope?.error(ex);
|
|
495
645
|
throw ex;
|
|
@@ -506,6 +656,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
506
656
|
upstream?: string;
|
|
507
657
|
delete?: { remote: string; branch: string };
|
|
508
658
|
},
|
|
659
|
+
runOptions?: GitOperationRunOptions,
|
|
509
660
|
): Promise<void> {
|
|
510
661
|
const params = ['push'];
|
|
511
662
|
|
|
@@ -537,7 +688,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
537
688
|
}
|
|
538
689
|
|
|
539
690
|
try {
|
|
540
|
-
await this.git.
|
|
691
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, ...params);
|
|
541
692
|
} catch (ex) {
|
|
542
693
|
const error = getGitCommandError(
|
|
543
694
|
'push',
|
|
@@ -609,7 +760,9 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
609
760
|
interactive?: boolean;
|
|
610
761
|
onto?: string;
|
|
611
762
|
updateRefs?: boolean;
|
|
763
|
+
source?: unknown;
|
|
612
764
|
},
|
|
765
|
+
runOptions?: GitOperationRunOptions,
|
|
613
766
|
): Promise<GitOperationResult> {
|
|
614
767
|
const scope = getScopedLogger();
|
|
615
768
|
|
|
@@ -643,9 +796,9 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
643
796
|
}
|
|
644
797
|
|
|
645
798
|
try {
|
|
646
|
-
await this.git.
|
|
799
|
+
await this.git.run(
|
|
647
800
|
// Avoid a timeout since rebases can take a long time (set to 0 to disable)
|
|
648
|
-
{ cwd: repoPath, errors: 'throw', configs: configs, timeout: 0 },
|
|
801
|
+
{ cwd: repoPath, errors: 'throw', configs: configs, timeout: 0, ...runOptions },
|
|
649
802
|
...args,
|
|
650
803
|
);
|
|
651
804
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
@@ -653,6 +806,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
653
806
|
return { conflicted: false };
|
|
654
807
|
} catch (ex) {
|
|
655
808
|
scope?.error(ex);
|
|
809
|
+
await this.throwIfSigningError(repoPath, args, ex, options?.source);
|
|
656
810
|
const mapped = getGitCommandError(
|
|
657
811
|
'rebase',
|
|
658
812
|
ex,
|
|
@@ -678,11 +832,12 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
678
832
|
repoPath: string,
|
|
679
833
|
rev: string,
|
|
680
834
|
options?: { mode?: 'hard' | 'keep' | 'merge' | 'mixed' | 'soft' },
|
|
835
|
+
runOptions?: GitOperationRunOptions,
|
|
681
836
|
): Promise<void> {
|
|
682
837
|
const scope = getScopedLogger();
|
|
683
838
|
|
|
684
839
|
try {
|
|
685
|
-
await this.resetCore(repoPath, rev, options?.mode);
|
|
840
|
+
await this.resetCore(repoPath, rev, options?.mode, runOptions);
|
|
686
841
|
this.context.hooks?.cache?.onReset?.(repoPath, 'branches', 'status');
|
|
687
842
|
this.context.hooks?.repository?.onChanged?.(repoPath, ['head', 'heads', 'index']);
|
|
688
843
|
} catch (ex) {
|
|
@@ -695,6 +850,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
695
850
|
repoPath: string,
|
|
696
851
|
rev: string,
|
|
697
852
|
mode?: 'hard' | 'keep' | 'merge' | 'mixed' | 'soft',
|
|
853
|
+
runOptions?: GitOperationRunOptions,
|
|
698
854
|
): Promise<void> {
|
|
699
855
|
const params = ['reset', '-q'];
|
|
700
856
|
if (mode) {
|
|
@@ -703,7 +859,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
703
859
|
params.push(rev, '--');
|
|
704
860
|
|
|
705
861
|
try {
|
|
706
|
-
await this.git.
|
|
862
|
+
await this.git.run({ cwd: repoPath, ...runOptions }, ...params);
|
|
707
863
|
} catch (ex) {
|
|
708
864
|
throw getGitCommandError(
|
|
709
865
|
'reset',
|
|
@@ -716,7 +872,12 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
716
872
|
|
|
717
873
|
@sequentialize({ getQueueKey: rp => rp })
|
|
718
874
|
@debug()
|
|
719
|
-
async revert(
|
|
875
|
+
async revert(
|
|
876
|
+
repoPath: string,
|
|
877
|
+
refs: string[],
|
|
878
|
+
options?: { editMessage?: boolean; source?: unknown },
|
|
879
|
+
runOptions?: GitOperationRunOptions,
|
|
880
|
+
): Promise<GitOperationResult> {
|
|
720
881
|
const scope = getScopedLogger();
|
|
721
882
|
|
|
722
883
|
const args = ['revert'];
|
|
@@ -730,9 +891,9 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
730
891
|
args.push(...refs);
|
|
731
892
|
|
|
732
893
|
try {
|
|
733
|
-
await this.git.
|
|
894
|
+
await this.git.run(
|
|
734
895
|
// Avoid a timeout since reverts can take a long time (set to 0 to disable)
|
|
735
|
-
{ cwd: repoPath, errors: 'throw', timeout: 0 },
|
|
896
|
+
{ cwd: repoPath, errors: 'throw', timeout: 0, ...runOptions },
|
|
736
897
|
...args,
|
|
737
898
|
);
|
|
738
899
|
|
|
@@ -741,6 +902,7 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
741
902
|
return { conflicted: false };
|
|
742
903
|
} catch (ex) {
|
|
743
904
|
scope?.error(ex);
|
|
905
|
+
await this.throwIfSigningError(repoPath, args, ex, options?.source);
|
|
744
906
|
|
|
745
907
|
const mapped = getGitCommandError(
|
|
746
908
|
'revert',
|
|
@@ -758,6 +920,40 @@ export class OperationsGitSubProvider implements GitOperationsSubProvider {
|
|
|
758
920
|
}
|
|
759
921
|
}
|
|
760
922
|
|
|
923
|
+
/**
|
|
924
|
+
* Classifies `ex` as a signing failure; if so, fires the `commits.onSigningFailed`
|
|
925
|
+
* hook and throws a typed {@link SigningError}. Callers should invoke this first
|
|
926
|
+
* in their catch blocks, before falling through to command-specific error mapping
|
|
927
|
+
* via {@link getGitCommandError}.
|
|
928
|
+
*
|
|
929
|
+
* `SigningFormat` is read opportunistically from `config.getSigningConfig`, with
|
|
930
|
+
* {@link inferSigningFormatFromError} as a stderr-based fallback and `'gpg'` as
|
|
931
|
+
* the final default.
|
|
932
|
+
*/
|
|
933
|
+
private async throwIfSigningError(
|
|
934
|
+
repoPath: string,
|
|
935
|
+
args: readonly (string | undefined)[],
|
|
936
|
+
ex: unknown,
|
|
937
|
+
source?: unknown,
|
|
938
|
+
): Promise<void> {
|
|
939
|
+
const reason = classifySigningError(ex);
|
|
940
|
+
if (reason == null) return;
|
|
941
|
+
|
|
942
|
+
let format: SigningFormat | undefined;
|
|
943
|
+
try {
|
|
944
|
+
format = (await this.provider.config.getSigningConfig?.(repoPath))?.format;
|
|
945
|
+
} catch {
|
|
946
|
+
// Fall through — config read failed; use stderr-inferred format or gpg default
|
|
947
|
+
}
|
|
948
|
+
format ??= inferSigningFormatFromError(ex) ?? 'gpg';
|
|
949
|
+
|
|
950
|
+
this.context.hooks?.commits?.onSigningFailed?.(reason, format, source);
|
|
951
|
+
throw new SigningError(
|
|
952
|
+
{ reason: reason, gitCommand: { repoPath: repoPath, args: args } },
|
|
953
|
+
ex instanceof Error ? ex : undefined,
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
761
957
|
private async createConflictResult(repoPath: string, command: GitConflictCommand): Promise<GitOperationResult> {
|
|
762
958
|
let conflicts: GitConflictFile[] | undefined;
|
|
763
959
|
try {
|