@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
|
@@ -60,7 +60,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
60
60
|
repoPath: string,
|
|
61
61
|
to?: string,
|
|
62
62
|
from?: string,
|
|
63
|
-
options?: { uris?: (string | Uri)[] },
|
|
63
|
+
options?: { uris?: (string | Uri)[]; includeUntracked?: boolean },
|
|
64
64
|
_cancellation?: AbortSignal,
|
|
65
65
|
): Promise<GitDiffShortStat | undefined> {
|
|
66
66
|
const scope = getScopedLogger();
|
|
@@ -76,7 +76,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
try {
|
|
79
|
-
const result = await this.git.
|
|
79
|
+
const result = await this.git.run(
|
|
80
80
|
{ cwd: repoPath, configs: gitConfigsDiff },
|
|
81
81
|
'diff',
|
|
82
82
|
'--shortstat',
|
|
@@ -85,12 +85,27 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
85
85
|
'--',
|
|
86
86
|
...(options?.uris?.map(p => this.provider.getRelativePath(p, repoPath)) ?? []),
|
|
87
87
|
);
|
|
88
|
-
if (!result.stdout) return undefined;
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
const stat = result.stdout ? parseGitDiffShortStat(result.stdout) : undefined;
|
|
90
|
+
|
|
91
|
+
// Merge in untracked files when the comparison involves the working tree.
|
|
92
|
+
// Skip when a pathspec filter is active — mixing a path-filtered diff count with an
|
|
93
|
+
// unfiltered untracked count would silently produce wrong totals.
|
|
94
|
+
if (options?.includeUntracked && !options.uris?.length && isWorkingTreeComparison(to, from)) {
|
|
95
|
+
const untracked = (await this.provider.status?.getUntrackedFiles?.(repoPath)) ?? [];
|
|
96
|
+
if (untracked.length) {
|
|
97
|
+
return {
|
|
98
|
+
files: (stat?.files ?? 0) + untracked.length,
|
|
99
|
+
additions: stat?.additions ?? 0,
|
|
100
|
+
deletions: stat?.deletions ?? 0,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return stat;
|
|
91
106
|
} catch (ex) {
|
|
92
107
|
const msg: string = ex?.toString() ?? '';
|
|
93
|
-
if (GitErrors.noMergeBase.test(msg)) {
|
|
108
|
+
if (GitErrors.noMergeBase.test(msg) || GitErrors.badRevision.test(msg)) {
|
|
94
109
|
return undefined;
|
|
95
110
|
}
|
|
96
111
|
|
|
@@ -134,7 +149,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
134
149
|
|
|
135
150
|
let result;
|
|
136
151
|
try {
|
|
137
|
-
result = await this.git.
|
|
152
|
+
result = await this.git.run(
|
|
138
153
|
{ cwd: repoPath, configs: gitConfigsDiff, errors: 'throw', env: options?.index?.env },
|
|
139
154
|
'diff',
|
|
140
155
|
...args,
|
|
@@ -173,7 +188,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
173
188
|
contents: string,
|
|
174
189
|
_cancellation?: AbortSignal,
|
|
175
190
|
): Promise<GitDiffFiles | undefined> {
|
|
176
|
-
const result = await this.git.
|
|
191
|
+
const result = await this.git.run(
|
|
177
192
|
{ cwd: repoPath, configs: gitConfigsLog, stdin: contents },
|
|
178
193
|
'apply',
|
|
179
194
|
'--numstat',
|
|
@@ -194,7 +209,13 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
194
209
|
repoPath: string,
|
|
195
210
|
ref1OrRange: string | GitRevisionRange,
|
|
196
211
|
ref2?: string,
|
|
197
|
-
options?: {
|
|
212
|
+
options?: {
|
|
213
|
+
filters?: GitDiffFilter[];
|
|
214
|
+
includeUntracked?: boolean;
|
|
215
|
+
path?: string;
|
|
216
|
+
renameLimit?: number;
|
|
217
|
+
similarityThreshold?: number;
|
|
218
|
+
},
|
|
198
219
|
): Promise<GitFile[] | undefined> {
|
|
199
220
|
try {
|
|
200
221
|
const similarityThreshold = options?.similarityThreshold;
|
|
@@ -202,7 +223,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
202
223
|
options?.renameLimit != null
|
|
203
224
|
? [...gitConfigsDiff, '-c', `diff.renameLimit=${options.renameLimit}`]
|
|
204
225
|
: gitConfigsDiff;
|
|
205
|
-
const result = await this.git.
|
|
226
|
+
const result = await this.git.run(
|
|
206
227
|
{ cwd: repoPath, configs: configs },
|
|
207
228
|
'diff',
|
|
208
229
|
'--numstat',
|
|
@@ -216,9 +237,34 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
216
237
|
'--',
|
|
217
238
|
options?.path ? options.path : undefined,
|
|
218
239
|
);
|
|
219
|
-
if (!result.stdout) return undefined;
|
|
220
240
|
|
|
221
|
-
|
|
241
|
+
const files = result.stdout ? (parseGitDiffNumStatFiles(result.stdout, repoPath) ?? []) : [];
|
|
242
|
+
|
|
243
|
+
// Merge in untracked files when the comparison involves the working tree.
|
|
244
|
+
// Skip when `filters` excludes additions (untracked entries are semantically 'A'/added),
|
|
245
|
+
// or when `path` is a non-exact pathspec we can't reliably match against the untracked list.
|
|
246
|
+
if (
|
|
247
|
+
options?.includeUntracked &&
|
|
248
|
+
ref2 == null &&
|
|
249
|
+
typeof ref1OrRange === 'string' &&
|
|
250
|
+
!isRevisionRange(ref1OrRange) &&
|
|
251
|
+
!isUncommittedStaged(ref1OrRange) &&
|
|
252
|
+
filtersAllowUntracked(options.filters) &&
|
|
253
|
+
!isNonExactPathspec(options.path)
|
|
254
|
+
) {
|
|
255
|
+
const untracked = (await this.provider.status?.getUntrackedFiles?.(repoPath)) ?? [];
|
|
256
|
+
if (untracked.length) {
|
|
257
|
+
const seen = new Set(files.map(f => f.path));
|
|
258
|
+
for (const file of untracked) {
|
|
259
|
+
if (seen.has(file.path)) continue;
|
|
260
|
+
if (options.path && options.path !== file.path) continue;
|
|
261
|
+
|
|
262
|
+
files.push(file);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return files.length ? files : undefined;
|
|
222
268
|
} catch (_ex) {
|
|
223
269
|
return undefined;
|
|
224
270
|
}
|
|
@@ -283,7 +329,12 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
283
329
|
// Follow file history and specify the file path
|
|
284
330
|
args.push('--follow', '--', relativePath);
|
|
285
331
|
|
|
286
|
-
|
|
332
|
+
// Unbounded --follow walk over file history can be slow on long histories — queue as background
|
|
333
|
+
// so it doesn't compete with interactive work.
|
|
334
|
+
const result = await this.git.run(
|
|
335
|
+
{ cwd: repoPath, configs: gitConfigsLog, priority: 'background' },
|
|
336
|
+
...args,
|
|
337
|
+
);
|
|
287
338
|
|
|
288
339
|
let currentSha;
|
|
289
340
|
let currentPath;
|
|
@@ -511,7 +562,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
511
562
|
|
|
512
563
|
args.push('--follow', rev!, '--', relativePath);
|
|
513
564
|
|
|
514
|
-
const result = await this.git.
|
|
565
|
+
const result = await this.git.run(
|
|
515
566
|
{
|
|
516
567
|
cwd: repoPath,
|
|
517
568
|
configs: gitConfigsLog,
|
|
@@ -636,7 +687,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
636
687
|
|
|
637
688
|
let result: GitResult;
|
|
638
689
|
try {
|
|
639
|
-
result = await this.git.
|
|
690
|
+
result = await this.git.run({ cwd: repoPath, configs: gitConfigsLog }, ...args);
|
|
640
691
|
} catch (ex) {
|
|
641
692
|
if (rev && !isUncommittedStaged(rev)) throw ex;
|
|
642
693
|
|
|
@@ -659,7 +710,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
659
710
|
};
|
|
660
711
|
|
|
661
712
|
args.splice(index, 1, `-L${range.startLine},${range.endLine}:${relativePath}`);
|
|
662
|
-
result = await this.git.
|
|
713
|
+
result = await this.git.run({ cwd: repoPath, configs: gitConfigsLog }, ...args);
|
|
663
714
|
}
|
|
664
715
|
|
|
665
716
|
let currentRange;
|
|
@@ -761,7 +812,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
761
812
|
}
|
|
762
813
|
|
|
763
814
|
try {
|
|
764
|
-
return await this.git.
|
|
815
|
+
return await this.git.run(
|
|
765
816
|
{ cwd: repoPath, configs: gitConfigsDiff, encoding: options?.encoding },
|
|
766
817
|
...params,
|
|
767
818
|
'--',
|
|
@@ -805,7 +856,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
805
856
|
params.push('--no-index');
|
|
806
857
|
|
|
807
858
|
try {
|
|
808
|
-
const result = await this.git.
|
|
859
|
+
const result = await this.git.run(
|
|
809
860
|
{
|
|
810
861
|
cwd: repoPath,
|
|
811
862
|
configs: gitConfigsDiff,
|
|
@@ -939,7 +990,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
939
990
|
scope?.debug(`Using tool=${tool}`);
|
|
940
991
|
}
|
|
941
992
|
|
|
942
|
-
await this.git.
|
|
993
|
+
await this.git.run(
|
|
943
994
|
{ cwd: root },
|
|
944
995
|
'difftool',
|
|
945
996
|
'--no-prompt',
|
|
@@ -978,7 +1029,7 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
978
1029
|
scope?.debug(`Using tool=${tool}`);
|
|
979
1030
|
}
|
|
980
1031
|
|
|
981
|
-
await this.git.
|
|
1032
|
+
await this.git.run({ cwd: repoPath }, 'difftool', '--dir-diff', `--tool=${tool}`, ref1, ref2);
|
|
982
1033
|
} catch (ex) {
|
|
983
1034
|
const msg: string = ex?.toString() ?? '';
|
|
984
1035
|
if (msg === 'No diff tool found' || /Unknown .+? tool/.test(msg)) {
|
|
@@ -993,6 +1044,42 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
|
|
|
993
1044
|
}
|
|
994
1045
|
}
|
|
995
1046
|
}
|
|
1047
|
+
// Returns true when no --diff-filter is active or when it includes additions ('A' or '*').
|
|
1048
|
+
// Untracked files are semantically "added" — if a caller restricts filters to e.g. ['M'],
|
|
1049
|
+
// honor that and omit untracked.
|
|
1050
|
+
function filtersAllowUntracked(filters: GitDiffFilter[] | undefined): boolean {
|
|
1051
|
+
if (!filters?.length) return true;
|
|
1052
|
+
return filters.includes('A') || filters.includes('*');
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// Returns true when the path is a git pathspec we can't match with simple equality
|
|
1056
|
+
// (directory prefix, glob, or magic pathspec). In that case, skip the untracked merge
|
|
1057
|
+
// rather than risk excluding legitimate matches or including wrong ones.
|
|
1058
|
+
function isNonExactPathspec(path: string | undefined): boolean {
|
|
1059
|
+
if (!path) return false;
|
|
1060
|
+
return path.endsWith('/') || /[*?[\]]|^:/.test(path);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// Returns true when the `git diff` invocation shape includes the working tree
|
|
1064
|
+
// (i.e. `git diff`, `git diff HEAD`, or `git diff <ref>` with no `from`), and
|
|
1065
|
+
// therefore untracked files are a meaningful addition to the result.
|
|
1066
|
+
function isWorkingTreeComparison(to: string | undefined, from: string | undefined): boolean {
|
|
1067
|
+
if (to == null) return true;
|
|
1068
|
+
if (isRevisionRange(to) || isUncommittedStaged(to)) return false;
|
|
1069
|
+
|
|
1070
|
+
// `to === uncommitted` always targets the working tree (`prepareToFromDiffArgs` sets
|
|
1071
|
+
// `from = 'HEAD'` when omitted, or diffs against the caller-supplied `from`).
|
|
1072
|
+
if (isUncommitted(to)) return true;
|
|
1073
|
+
|
|
1074
|
+
// `git diff <from>` — `to === ''` means the caller explicitly asked for working tree vs `from`
|
|
1075
|
+
if (to === '') return from == null || !isUncommittedStaged(from);
|
|
1076
|
+
|
|
1077
|
+
// `getChangedFilesCount` uses `prepareToFromDiffArgs`, which translates `to` (with no `from`)
|
|
1078
|
+
// to `${to}^ ${to}` UNLESS `to` is HEAD or empty.
|
|
1079
|
+
if (to.toUpperCase() === 'HEAD' && from == null) return true;
|
|
1080
|
+
return false;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
996
1083
|
function prepareToFromDiffArgs(
|
|
997
1084
|
to: string,
|
|
998
1085
|
from: string | undefined,
|
|
@@ -1063,7 +1150,7 @@ export async function findPathStatusChanged(
|
|
|
1063
1150
|
|
|
1064
1151
|
const ordering = options?.ordering;
|
|
1065
1152
|
|
|
1066
|
-
const result = await git.
|
|
1153
|
+
const result = await git.run(
|
|
1067
1154
|
{ cwd: repoPath, configs: gitConfigsLog },
|
|
1068
1155
|
'log',
|
|
1069
1156
|
...parser.arguments,
|
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
import type { GitRemote } from '../../git/models/remote.js';
|
|
25
25
|
import type { SearchQuery } from '../../git/models/search.js';
|
|
26
26
|
import type { GitWorktree } from '../../git/models/worktree.js';
|
|
27
|
+
import type { GitCommitReachability } from '../../git/providers/commits.js';
|
|
27
28
|
import type { GitGraphSubProvider } from '../../git/providers/graph.js';
|
|
28
29
|
import {
|
|
29
30
|
getBranchId,
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
import { getChangedFilesCount } from '../../git/utils/commit.utils.js';
|
|
34
35
|
import { isUncommitted } from '../../git/utils/revision.utils.js';
|
|
35
36
|
import { getSearchQueryComparisonKey, parseSearchQueryGitCommand } from '../../git/utils/search.utils.js';
|
|
37
|
+
import { compareReachableRefs } from '../../git/utils/sorting.js';
|
|
36
38
|
import { getTagId } from '../../git/utils/tag.utils.js';
|
|
37
39
|
import { isUserMatch } from '../../git/utils/user.utils.js';
|
|
38
40
|
import { getWorktreeId, groupWorktreesByBranch } from '../../git/utils/worktree.utils.js';
|
|
@@ -56,6 +58,8 @@ import { convertStashesToStdin } from './stash.js';
|
|
|
56
58
|
|
|
57
59
|
const progressiveSearchResultsBatchTimeMs = 500; // Send updates every 500ms (2 updates/second)
|
|
58
60
|
|
|
61
|
+
type ReachableRef = GitCommitReachability['refs'][number];
|
|
62
|
+
|
|
59
63
|
export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
60
64
|
constructor(
|
|
61
65
|
private readonly context: GitServiceContext,
|
|
@@ -87,7 +91,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
87
91
|
const [shaResult, stashResult, branchesResult, remotesResult, currentUserResult, worktreesResult] =
|
|
88
92
|
await Promise.allSettled([
|
|
89
93
|
!isUncommitted(rev, true)
|
|
90
|
-
? this.git.
|
|
94
|
+
? this.git.run(
|
|
91
95
|
{ cwd: repoPath, configs: gitConfigsLog },
|
|
92
96
|
'log',
|
|
93
97
|
...shaParser.arguments,
|
|
@@ -96,7 +100,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
96
100
|
'--',
|
|
97
101
|
)
|
|
98
102
|
: undefined,
|
|
99
|
-
this.provider.stash?.getStash(repoPath,
|
|
103
|
+
this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation),
|
|
100
104
|
this.provider.branches.getBranches(repoPath, undefined, cancellation),
|
|
101
105
|
this.provider.remotes.getRemotes(repoPath, undefined, cancellation),
|
|
102
106
|
this.provider.config.getCurrentUser(repoPath),
|
|
@@ -138,7 +142,9 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
138
142
|
const avatars = new Map<string, string>();
|
|
139
143
|
const ids = new Set<string>();
|
|
140
144
|
const reachableFromHEAD = new Set<string>();
|
|
141
|
-
|
|
145
|
+
|
|
146
|
+
// Map<sha, Map<refKey, ref>> — inner map deduplicates refs during propagation
|
|
147
|
+
const reachableRefs = new Map<string, Map<string, ReachableRef>>();
|
|
142
148
|
const rowStats: GitGraphRowsStats = new Map<string, GitGraphRowStats>();
|
|
143
149
|
let pendingRowsStatsCount = 0;
|
|
144
150
|
let iterations = 0;
|
|
@@ -218,7 +224,6 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
218
224
|
branchIdOfMainWorktree: branchIdOfMainWorktree,
|
|
219
225
|
stashes: gitStash?.stashes,
|
|
220
226
|
reachableFromHEAD: reachableFromHEAD,
|
|
221
|
-
reachableFromBranches: reachableFromBranches,
|
|
222
227
|
avatars: avatars,
|
|
223
228
|
}
|
|
224
229
|
: undefined;
|
|
@@ -229,7 +234,14 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
229
234
|
// - SHA + limit = 0: Find SHA, stop immediately
|
|
230
235
|
// - No SHA + limit > 0: Load exactly `limit` commits
|
|
231
236
|
// - No SHA + limit = 0: Load everything remaining
|
|
232
|
-
|
|
237
|
+
// - SHA + limit > 0 + still unfound past 10× limit: defensive cap so an unreachable
|
|
238
|
+
// SHA (e.g. a stale merge-base the webview hasn't yet seen invalidated) can't
|
|
239
|
+
// walk the entire history. `hasMore=true` lets callers retry; the graph-wrapper
|
|
240
|
+
// side deduplicates re-requests so the cap doesn't loop.
|
|
241
|
+
if (
|
|
242
|
+
(limit && count >= limit && (!sha || found || count >= limit * 10)) ||
|
|
243
|
+
(!limit && sha && found)
|
|
244
|
+
) {
|
|
233
245
|
hasMore = true;
|
|
234
246
|
aborter.abort();
|
|
235
247
|
break;
|
|
@@ -245,6 +257,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
245
257
|
total++;
|
|
246
258
|
shaOrRemapped = remappedIds.get(commit.sha);
|
|
247
259
|
if (shaOrRemapped && ids.has(shaOrRemapped)) continue;
|
|
260
|
+
|
|
248
261
|
shaOrRemapped ??= commit.sha;
|
|
249
262
|
|
|
250
263
|
ids.add(shaOrRemapped);
|
|
@@ -340,34 +353,46 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
340
353
|
}
|
|
341
354
|
}
|
|
342
355
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
356
|
+
// Seed reachability from all ref types on this commit
|
|
357
|
+
if (refHeads.length > 0 || refRemoteHeads.length > 0 || refTags.length > 0) {
|
|
358
|
+
let refs = reachableRefs.get(shaOrRemapped);
|
|
359
|
+
if (refs == null) {
|
|
360
|
+
refs = new Map<string, ReachableRef>();
|
|
361
|
+
reachableRefs.set(shaOrRemapped, refs);
|
|
362
|
+
}
|
|
363
|
+
for (const h of refHeads) {
|
|
364
|
+
const key = `b:${h.name}`;
|
|
365
|
+
refs.set(key, { refType: 'branch', name: h.name, remote: false, current: h.isCurrentHead });
|
|
366
|
+
}
|
|
367
|
+
for (const r of refRemoteHeads) {
|
|
368
|
+
const name = `${r.owner}/${r.name}`;
|
|
369
|
+
refs.set(`r:${name}`, { refType: 'branch', name: name, remote: true });
|
|
348
370
|
}
|
|
349
|
-
for (const
|
|
350
|
-
|
|
371
|
+
for (const t of refTags) {
|
|
372
|
+
refs.set(`t:${t.name}`, { refType: 'tag', name: t.name });
|
|
351
373
|
}
|
|
352
374
|
}
|
|
353
375
|
|
|
354
|
-
|
|
355
|
-
|
|
376
|
+
// Propagate reachability to parents
|
|
377
|
+
const currentRefs = reachableRefs.get(shaOrRemapped);
|
|
378
|
+
if (currentRefs != null && currentRefs.size > 0) {
|
|
356
379
|
for (parent of parents) {
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
359
|
-
|
|
360
|
-
|
|
380
|
+
let parentRefs = reachableRefs.get(parent);
|
|
381
|
+
if (parentRefs == null) {
|
|
382
|
+
parentRefs = new Map<string, ReachableRef>();
|
|
383
|
+
reachableRefs.set(parent, parentRefs);
|
|
361
384
|
}
|
|
362
|
-
for (const
|
|
363
|
-
|
|
385
|
+
for (const [key, ref] of currentRefs) {
|
|
386
|
+
if (!parentRefs.has(key)) {
|
|
387
|
+
parentRefs.set(key, ref);
|
|
388
|
+
}
|
|
364
389
|
}
|
|
365
390
|
}
|
|
366
391
|
}
|
|
367
392
|
|
|
368
393
|
stash = gitStash?.stashes.get(shaOrRemapped);
|
|
369
394
|
if (stash != null) {
|
|
370
|
-
const
|
|
395
|
+
const refs = reachableRefs.get(shaOrRemapped);
|
|
371
396
|
const row: GitGraphRow = {
|
|
372
397
|
sha: shaOrRemapped,
|
|
373
398
|
// Always only return the first parent for stashes, as it is a Git implementation for the index and untracked files
|
|
@@ -381,7 +406,9 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
381
406
|
heads: refHeads,
|
|
382
407
|
remotes: refRemoteHeads,
|
|
383
408
|
tags: refTags,
|
|
384
|
-
|
|
409
|
+
reachability: refs?.size
|
|
410
|
+
? { partial: true, refs: [...refs.values()].sort(compareReachableRefs) }
|
|
411
|
+
: undefined,
|
|
385
412
|
isCurrentUser: true,
|
|
386
413
|
};
|
|
387
414
|
rowProcessor?.processRow(row, graphCtx!);
|
|
@@ -397,7 +424,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
397
424
|
} else {
|
|
398
425
|
isCurrentUser = isUserMatch(currentUser, commit.author, commit.authorEmail);
|
|
399
426
|
|
|
400
|
-
const
|
|
427
|
+
const refs = reachableRefs.get(shaOrRemapped);
|
|
401
428
|
const row: GitGraphRow = {
|
|
402
429
|
sha: shaOrRemapped,
|
|
403
430
|
parents: onlyFollowFirstParent ? parents.slice(0, 1) : parents,
|
|
@@ -410,7 +437,9 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
410
437
|
heads: refHeads,
|
|
411
438
|
remotes: refRemoteHeads,
|
|
412
439
|
tags: refTags,
|
|
413
|
-
|
|
440
|
+
reachability: refs?.size
|
|
441
|
+
? { partial: true, refs: [...refs.values()].sort(compareReachableRefs) }
|
|
442
|
+
: undefined,
|
|
414
443
|
isCurrentUser: isCurrentUser || undefined,
|
|
415
444
|
};
|
|
416
445
|
rowProcessor?.processRow(row, graphCtx!);
|
|
@@ -442,8 +471,8 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
442
471
|
}
|
|
443
472
|
args.push(`--${ordering}-order`, '--all');
|
|
444
473
|
|
|
445
|
-
const statsResult = await this.git.
|
|
446
|
-
{ cwd: repoPath, configs: gitConfigsLog, stdin: stdin },
|
|
474
|
+
const statsResult = await this.git.run(
|
|
475
|
+
{ cwd: repoPath, configs: gitConfigsLog, stdin: stdin, priority: 'background' },
|
|
447
476
|
'log',
|
|
448
477
|
stdin ? '--stdin' : undefined,
|
|
449
478
|
...args,
|
|
@@ -455,7 +484,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
455
484
|
for (const stat of statsParser.parse(statsResult.stdout)) {
|
|
456
485
|
statShaOrRemapped = remappedIds.get(stat.sha) ?? stat.sha;
|
|
457
486
|
|
|
458
|
-
//
|
|
487
|
+
// Don't overwrite stats already populated for this sha
|
|
459
488
|
if (rowStats.has(statShaOrRemapped)) continue;
|
|
460
489
|
|
|
461
490
|
rowStats.set(statShaOrRemapped, stat.stats);
|
|
@@ -485,7 +514,6 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
485
514
|
worktrees: worktrees,
|
|
486
515
|
worktreesByBranch: worktreesByBranch,
|
|
487
516
|
reachableFromHEAD: reachableFromHEAD,
|
|
488
|
-
reachableFromBranches: reachableFromBranches,
|
|
489
517
|
rows: rows,
|
|
490
518
|
id: sha ?? rev,
|
|
491
519
|
rowsStats: rowStats,
|
|
@@ -595,7 +623,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
595
623
|
// Don't include stashes when using ref: filter, as they would add unrelated commits
|
|
596
624
|
// There *HAS* to be a better way to get git log to return stashes, but this is the best we've found
|
|
597
625
|
({ stdin, stashes, remappedIds } = convertStashesToStdin(
|
|
598
|
-
await this.provider.stash?.getStash(repoPath,
|
|
626
|
+
await this.provider.stash?.getStash(repoPath, { includeFiles: false }, cancellation),
|
|
599
627
|
));
|
|
600
628
|
} else {
|
|
601
629
|
remappedIds = new Map();
|
|
@@ -705,6 +733,7 @@ export class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
705
733
|
runningTotal: results.size,
|
|
706
734
|
hasMore: true,
|
|
707
735
|
};
|
|
736
|
+
|
|
708
737
|
batch.length = 0;
|
|
709
738
|
lastProgressTime = Date.now();
|
|
710
739
|
}
|