@gitkraken/core-gitlens 0.7.2 → 0.9.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 +72 -1
- package/dist/git/cache.d.ts +29 -5
- package/dist/git/cache.js +52 -11
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +6 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +28 -1
- package/dist/git/errors.js +45 -1
- package/dist/git/errors.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.js +1 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/models/reflog.d.ts +6 -0
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/revision.d.ts +0 -1
- package/dist/git/models/revision.js +1 -2
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/providers/branches.d.ts +5 -1
- package/dist/git/providers/commits.d.ts +44 -2
- package/dist/git/providers/config.d.ts +7 -1
- package/dist/git/providers/operations.d.ts +19 -0
- package/dist/git/providers/provider.d.ts +29 -2
- package/dist/git/providers/refs.d.ts +48 -3
- package/dist/git/providers/revision.d.ts +7 -1
- package/dist/git/providers/staging.d.ts +13 -0
- package/dist/git/providers/stash.d.ts +3 -2
- package/dist/git/providers/status.d.ts +4 -0
- package/dist/git/providers/worktrees.d.ts +23 -3
- package/dist/git/run.types.d.ts +22 -0
- package/dist/git-cli/cliGitProvider.d.ts +39 -2
- package/dist/git-cli/cliGitProvider.js +109 -11
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +31 -0
- package/dist/git-cli/exec/commandClassifier.js +391 -0
- package/dist/git-cli/exec/commandClassifier.js.map +1 -0
- package/dist/git-cli/exec/git.d.ts +36 -5
- package/dist/git-cli/exec/git.js +163 -28
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +4 -1
- package/dist/git-cli/exec/gitQueue.js +1 -1
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts +7 -0
- package/dist/git-cli/parsers/reflogParser.js +11 -1
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +10 -1
- package/dist/git-cli/providers/branches.js +31 -22
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +27 -3
- package/dist/git-cli/providers/commits.js +112 -12
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.js +2 -1
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/diff.js +4 -4
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +13 -0
- package/dist/git-cli/providers/operations.js +64 -5
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.js +21 -45
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +20 -3
- package/dist/git-cli/providers/refs.js +140 -10
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.js +3 -2
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +5 -1
- package/dist/git-cli/providers/revision.js +20 -5
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +9 -0
- package/dist/git-cli/providers/staging.js +63 -6
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +3 -2
- package/dist/git-cli/providers/stash.js +34 -22
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +2 -0
- package/dist/git-cli/providers/status.js +27 -9
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +31 -2
- package/dist/git-cli/providers/worktrees.js +75 -7
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +64 -3
- package/dist/plus/git-github/api/github.js +237 -24
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/providers/github/branches.d.ts +3 -1
- package/dist/plus/git-github/providers/github/branches.js +2 -1
- package/dist/plus/git-github/providers/github/branches.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts +4 -2
- package/dist/plus/git-github/providers/github/commits.js +3 -1
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/refs.d.ts +10 -3
- package/dist/plus/git-github/providers/github/refs.js +4 -4
- package/dist/plus/git-github/providers/github/refs.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts +4 -1
- package/dist/plus/git-github/providers/github/revision.js +6 -1
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +5 -2
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +35 -9
- package/dist/plus/integrations/integrationService.js +16 -3
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +107 -37
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +128 -13
- package/dist/plus/integrations/models/gitHostIntegration.js +130 -17
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +51 -3
- package/dist/plus/integrations/models/integration.js +125 -18
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +18 -5
- package/dist/plus/integrations/models/issuesIntegration.js +40 -10
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +1 -1
- package/dist/plus/integrations/providers/azure/azure.js +13 -17
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +29 -0
- package/dist/plus/integrations/providers/azure/models.js +112 -1
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +54 -2
- package/dist/plus/integrations/providers/azureDevOps.js +80 -2
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.js +2 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +61 -0
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js +165 -23
- package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket/models.d.ts +6 -1
- package/dist/plus/integrations/providers/bitbucket/models.js +4 -3
- package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/pullRequestSearch.js +1 -1
- package/dist/plus/integrations/providers/bitbucket-server/pullRequestSearch.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +38 -1
- package/dist/plus/integrations/providers/bitbucket-server.js +33 -1
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +36 -1
- package/dist/plus/integrations/providers/bitbucket.js +29 -1
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +48 -4
- package/dist/plus/integrations/providers/github.js +101 -6
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +35 -0
- package/dist/plus/integrations/providers/gitlab/gitlab.js +132 -15
- package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/models.d.ts +1 -0
- package/dist/plus/integrations/providers/gitlab/models.js +1 -1
- package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +48 -1
- package/dist/plus/integrations/providers/gitlab.js +79 -3
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/jira-server.d.ts +3 -3
- package/dist/plus/integrations/providers/jira-server.js +3 -3
- package/dist/plus/integrations/providers/jira-server.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +12 -1
- package/dist/plus/integrations/providers/models.js +11 -1
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts +9 -1
- package/dist/plus/integrations/providers/providerErrors.js +10 -1
- package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +59 -0
- package/dist/plus/integrations/providers/providersApi.js +136 -1
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +42 -0
- package/dist/plus/integrations/providers/utils/providerPaging.js +58 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/providers/utils.d.ts +1 -1
- package/dist/plus/integrations/reads/currentAccount.d.ts +35 -0
- package/dist/plus/integrations/reads/currentAccount.js +46 -0
- package/dist/plus/integrations/reads/currentAccount.js.map +1 -0
- package/dist/plus/integrations/reads/drains.d.ts +4 -1
- package/dist/plus/integrations/reads/drains.js +7 -3
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +72 -12
- package/dist/plus/integrations/reads/issueBatch.js +193 -48
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBatch.d.ts +57 -0
- package/dist/plus/integrations/reads/pullRequestBatch.js +80 -0
- package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequestBranches.d.ts +58 -0
- package/dist/plus/integrations/reads/pullRequestBranches.js +111 -0
- package/dist/plus/integrations/reads/pullRequestBranches.js.map +1 -0
- package/dist/plus/integrations/reads/pullRequests.js +3 -3
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.js +3 -3
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +5 -2
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/utils/env/node/exec.js +1 -1
- package/dist/utils/env/node/exec.js.map +1 -1
- package/docs/integrations.md +90 -36
- package/docs/kepler-git-write-api-parity.md +365 -0
- package/docs/kepler-read-api-parity.md +75 -28
- package/package.json +1 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts +0 -33
- package/dist/plus/integrations/reads/trackerIssue.js +0 -60
- package/dist/plus/integrations/reads/trackerIssue.js.map +0 -1
package/dist/git/features.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../git/src/features.d.ts
|
|
2
|
-
export type GitFeatures = 'git:checkout:pathspec-from-file' | 'git:commit-graph' | 'git:commit-graph:changed-paths' | 'git:for-each-ref:worktreePath' | 'git:fsmonitor' | 'git:fsmonitor:linux' | 'git:ignoreRevsFile' | 'git:index:skipHash' | 'git:maintenance' | 'git:maintenance:pack-refs' | 'git:maintenance:start' | 'git:maintenance:start:systemd' | 'git:manyFiles' | 'git:merge-tree:merge-base' | 'git:merge-tree:write-tree' | 'git:push:force-if-includes' | 'git:rebase:autosquash' | 'git:rev-parse:end-of-options' | 'git:signing:ssh' | 'git:signing:x509' | 'git:sparse-index' | 'git:stash:push:pathspecs' | 'git:stash:push:staged' | 'git:stash:push:stdin' | 'git:status:find-renames' | 'git:status:porcelain-v2' | 'git:untrackedCache' | 'git:worktrees';
|
|
2
|
+
export type GitFeatures = 'git:checkout:pathspec-from-file' | 'git:commit-graph' | 'git:commit-graph:changed-paths' | 'git:fetch:no-write-fetch-head' | 'git:for-each-ref:worktreePath' | 'git:fsmonitor' | 'git:fsmonitor:linux' | 'git:ignoreRevsFile' | 'git:index:skipHash' | 'git:maintenance' | 'git:maintenance:pack-refs' | 'git:maintenance:start' | 'git:maintenance:start:systemd' | 'git:manyFiles' | 'git:merge-tree:merge-base' | 'git:merge-tree:write-tree' | 'git:push:force-if-includes' | 'git:rebase:autosquash' | 'git:rev-parse:end-of-options' | 'git:signing:ssh' | 'git:signing:x509' | 'git:sparse-index' | 'git:stash:push:pathspecs' | 'git:stash:push:staged' | 'git:stash:push:stdin' | 'git:status:find-renames' | 'git:status:porcelain-v2' | 'git:untrackedCache' | 'git:worktrees';
|
|
3
3
|
type ExtractPrefix<T> = T extends `${infer Prefix}:${infer Rest}` ? Rest extends `${infer SubPrefix}:${string}` ? T | `${Prefix}:${SubPrefix}` | Prefix : T | Prefix : never;
|
|
4
4
|
export type GitFeatureOrPrefix = ExtractPrefix<GitFeatures>;
|
|
5
5
|
export type FilteredGitFeatures<T extends GitFeatureOrPrefix> = T extends GitFeatures ? T : Extract<GitFeatures, T | `${T}:${string}`>;
|
package/dist/git/features.js
CHANGED
|
@@ -4,6 +4,7 @@ const gitFeaturesByVersion = /* @__PURE__ */ new Map([
|
|
|
4
4
|
["git:checkout:pathspec-from-file", "2.26"],
|
|
5
5
|
["git:commit-graph", "2.24"],
|
|
6
6
|
["git:commit-graph:changed-paths", "2.31"],
|
|
7
|
+
["git:fetch:no-write-fetch-head", "2.29"],
|
|
7
8
|
["git:for-each-ref:worktreePath", "2.23"],
|
|
8
9
|
["git:fsmonitor", "2.37"],
|
|
9
10
|
["git:fsmonitor:linux", "2.55"],
|
package/dist/git/features.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","names":[],"sources":["../../../git/src/features.ts"],"sourcesContent":["// GitFeature's must start with `git:` to be recognized in all usages\nexport type GitFeatures =\n\t| 'git:checkout:pathspec-from-file'\n\t| 'git:commit-graph'\n\t| 'git:commit-graph:changed-paths'\n\t| 'git:for-each-ref:worktreePath'\n\t| 'git:fsmonitor'\n\t| 'git:fsmonitor:linux'\n\t| 'git:ignoreRevsFile'\n\t| 'git:index:skipHash'\n\t| 'git:maintenance'\n\t| 'git:maintenance:pack-refs'\n\t| 'git:maintenance:start'\n\t| 'git:maintenance:start:systemd'\n\t| 'git:manyFiles'\n\t| 'git:merge-tree:merge-base'\n\t| 'git:merge-tree:write-tree'\n\t| 'git:push:force-if-includes'\n\t| 'git:rebase:autosquash'\n\t| 'git:rev-parse:end-of-options'\n\t| 'git:signing:ssh'\n\t| 'git:signing:x509'\n\t| 'git:sparse-index'\n\t| 'git:stash:push:pathspecs'\n\t| 'git:stash:push:staged'\n\t| 'git:stash:push:stdin'\n\t| 'git:status:find-renames'\n\t| 'git:status:porcelain-v2'\n\t| 'git:untrackedCache'\n\t| 'git:worktrees';\n\ntype ExtractPrefix<T> = T extends `${infer Prefix}:${infer Rest}`\n\t? Rest extends `${infer SubPrefix}:${string}`\n\t\t? T | `${Prefix}:${SubPrefix}` | Prefix\n\t\t: T | Prefix\n\t: never;\n\nexport type GitFeatureOrPrefix = ExtractPrefix<GitFeatures>;\nexport type FilteredGitFeatures<T extends GitFeatureOrPrefix> = T extends GitFeatures\n\t? T\n\t: Extract<GitFeatures, T | `${T}:${string}`>;\n\nexport const gitMinimumVersion = '2.7.2';\nexport const gitFeaturesByVersion = new Map<GitFeatures, string>([\n\t['git:checkout:pathspec-from-file', '2.26'],\n\t// 2.24 is when git READS the commit-graph file by default (core.commitGraph on); writing it for\n\t// older gits would be dead weight.\n\t['git:commit-graph', '2.24'],\n\t// Changed-path Bloom filters (`--changed-paths`), the v2 filter format — pre-2.31 shipped Bloom filters\n\t// with real correctness bugs (bad results for merge commits), so 2.31 is the safe floor to write them.\n\t['git:commit-graph:changed-paths', '2.31'],\n\t['git:for-each-ref:worktreePath', '2.23'],\n\t// `core.fsmonitor=true` selects the built-in FSMonitor daemon (accepting a bool rather than only a\n\t// hook path). This 2.37 floor is the Windows + macOS one.\n\t['git:fsmonitor', '2.37'],\n\t// Linux got its own FSMonitor backend (inotify) only in 2.55, hence a separate floor. Note the backend\n\t// places a watch on EVERY directory, so a large repo can exhaust `fs.inotify.max_user_watches` and the\n\t// daemon fails at runtime even on a new enough git — the apply path must still probe, not just gate.\n\t['git:fsmonitor:linux', '2.55'],\n\t['git:ignoreRevsFile', '2.23'],\n\t// `index.skipHash` (skip the trailing index checksum for faster writes); part of `feature.manyFiles`.\n\t['git:index:skipHash', '2.40'],\n\t// `git maintenance run --task=…`. The `maintenance` builtin + `commit-graph`/`gc` tasks are 2.29, but\n\t// the loose-objects + incremental-repack tasks the auto tier uses landed in 2.30 (and `core.multiPackIndex`\n\t// is default-on from 2.30, so no separate midx config write is needed) — 2.30 is the safe floor.\n\t['git:maintenance', '2.30'],\n\t// The pack-refs maintenance task landed one release after the maintenance builtin.\n\t['git:maintenance:pack-refs', '2.31'],\n\t// `git maintenance start` — the subcommands exist from 2.30 (cron only); launchctl (macOS) + schtasks\n\t// (Windows) scheduling arrived in 2.31, so 2.31 is the cross-platform-safe floor.\n\t['git:maintenance:start', '2.31'],\n\t// `git maintenance start` systemd-timer scheduling. On Linux, 2.31–2.33 is cron-only and modern distros\n\t// often ship without cron (scheduling then silently fails); the systemd fallback arrived in 2.34.\n\t['git:maintenance:start:systemd', '2.34'],\n\t// `feature.manyFiles` umbrella (index v4 + untracked cache + skipHash where available).\n\t['git:manyFiles', '2.24'],\n\t['git:merge-tree:merge-base', '2.40'],\n\t// `merge-tree --write-tree` mode with `-z`/`--name-only`/`--no-messages`; the older trivial mode can't check conflicts\n\t['git:merge-tree:write-tree', '2.38'],\n\t['git:push:force-if-includes', '2.30.0'],\n\t// `--autosquash` WITHOUT `-i` (folding `fixup!`/`squash!` commits into a plain/automatic rebase).\n\t// Interactive rebases support autosquash on every git version GitLens supports, so this floor only\n\t// gates the non-interactive path.\n\t['git:rebase:autosquash', '2.44'],\n\t['git:rev-parse:end-of-options', '2.30'],\n\t['git:signing:ssh', '2.34.0'],\n\t['git:signing:x509', '2.19.0'],\n\t// Sparse-index support debuted earlier, but 2.33 shipped a corruption fix and 2.34 broadened command\n\t// support. Use 2.34 as the conservative floor before offering a repository mutation.\n\t['git:sparse-index', '2.34'],\n\t['git:stash:push:pathspecs', '2.13.2'],\n\t['git:stash:push:staged', '2.35.0'],\n\t['git:stash:push:stdin', '2.30.0'],\n\t['git:status:find-renames', '2.18'],\n\t['git:status:porcelain-v2', '2.11'],\n\t// `core.untrackedCache=true` (repo-local cache of untracked-file scans — the auto-tier config lever).\n\t['git:untrackedCache', '2.8'],\n\t['git:worktrees', '2.17.0'],\n]);\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"features.js","names":[],"sources":["../../../git/src/features.ts"],"sourcesContent":["// GitFeature's must start with `git:` to be recognized in all usages\nexport type GitFeatures =\n\t| 'git:checkout:pathspec-from-file'\n\t| 'git:commit-graph'\n\t| 'git:commit-graph:changed-paths'\n\t| 'git:fetch:no-write-fetch-head'\n\t| 'git:for-each-ref:worktreePath'\n\t| 'git:fsmonitor'\n\t| 'git:fsmonitor:linux'\n\t| 'git:ignoreRevsFile'\n\t| 'git:index:skipHash'\n\t| 'git:maintenance'\n\t| 'git:maintenance:pack-refs'\n\t| 'git:maintenance:start'\n\t| 'git:maintenance:start:systemd'\n\t| 'git:manyFiles'\n\t| 'git:merge-tree:merge-base'\n\t| 'git:merge-tree:write-tree'\n\t| 'git:push:force-if-includes'\n\t| 'git:rebase:autosquash'\n\t| 'git:rev-parse:end-of-options'\n\t| 'git:signing:ssh'\n\t| 'git:signing:x509'\n\t| 'git:sparse-index'\n\t| 'git:stash:push:pathspecs'\n\t| 'git:stash:push:staged'\n\t| 'git:stash:push:stdin'\n\t| 'git:status:find-renames'\n\t| 'git:status:porcelain-v2'\n\t| 'git:untrackedCache'\n\t| 'git:worktrees';\n\ntype ExtractPrefix<T> = T extends `${infer Prefix}:${infer Rest}`\n\t? Rest extends `${infer SubPrefix}:${string}`\n\t\t? T | `${Prefix}:${SubPrefix}` | Prefix\n\t\t: T | Prefix\n\t: never;\n\nexport type GitFeatureOrPrefix = ExtractPrefix<GitFeatures>;\nexport type FilteredGitFeatures<T extends GitFeatureOrPrefix> = T extends GitFeatures\n\t? T\n\t: Extract<GitFeatures, T | `${T}:${string}`>;\n\nexport const gitMinimumVersion = '2.7.2';\nexport const gitFeaturesByVersion = new Map<GitFeatures, string>([\n\t['git:checkout:pathspec-from-file', '2.26'],\n\t// 2.24 is when git READS the commit-graph file by default (core.commitGraph on); writing it for\n\t// older gits would be dead weight.\n\t['git:commit-graph', '2.24'],\n\t// Changed-path Bloom filters (`--changed-paths`), the v2 filter format — pre-2.31 shipped Bloom filters\n\t// with real correctness bugs (bad results for merge commits), so 2.31 is the safe floor to write them.\n\t['git:commit-graph:changed-paths', '2.31'],\n\t['git:fetch:no-write-fetch-head', '2.29'],\n\t['git:for-each-ref:worktreePath', '2.23'],\n\t// `core.fsmonitor=true` selects the built-in FSMonitor daemon (accepting a bool rather than only a\n\t// hook path). This 2.37 floor is the Windows + macOS one.\n\t['git:fsmonitor', '2.37'],\n\t// Linux got its own FSMonitor backend (inotify) only in 2.55, hence a separate floor. Note the backend\n\t// places a watch on EVERY directory, so a large repo can exhaust `fs.inotify.max_user_watches` and the\n\t// daemon fails at runtime even on a new enough git — the apply path must still probe, not just gate.\n\t['git:fsmonitor:linux', '2.55'],\n\t['git:ignoreRevsFile', '2.23'],\n\t// `index.skipHash` (skip the trailing index checksum for faster writes); part of `feature.manyFiles`.\n\t['git:index:skipHash', '2.40'],\n\t// `git maintenance run --task=…`. The `maintenance` builtin + `commit-graph`/`gc` tasks are 2.29, but\n\t// the loose-objects + incremental-repack tasks the auto tier uses landed in 2.30 (and `core.multiPackIndex`\n\t// is default-on from 2.30, so no separate midx config write is needed) — 2.30 is the safe floor.\n\t['git:maintenance', '2.30'],\n\t// The pack-refs maintenance task landed one release after the maintenance builtin.\n\t['git:maintenance:pack-refs', '2.31'],\n\t// `git maintenance start` — the subcommands exist from 2.30 (cron only); launchctl (macOS) + schtasks\n\t// (Windows) scheduling arrived in 2.31, so 2.31 is the cross-platform-safe floor.\n\t['git:maintenance:start', '2.31'],\n\t// `git maintenance start` systemd-timer scheduling. On Linux, 2.31–2.33 is cron-only and modern distros\n\t// often ship without cron (scheduling then silently fails); the systemd fallback arrived in 2.34.\n\t['git:maintenance:start:systemd', '2.34'],\n\t// `feature.manyFiles` umbrella (index v4 + untracked cache + skipHash where available).\n\t['git:manyFiles', '2.24'],\n\t['git:merge-tree:merge-base', '2.40'],\n\t// `merge-tree --write-tree` mode with `-z`/`--name-only`/`--no-messages`; the older trivial mode can't check conflicts\n\t['git:merge-tree:write-tree', '2.38'],\n\t['git:push:force-if-includes', '2.30.0'],\n\t// `--autosquash` WITHOUT `-i` (folding `fixup!`/`squash!` commits into a plain/automatic rebase).\n\t// Interactive rebases support autosquash on every git version GitLens supports, so this floor only\n\t// gates the non-interactive path.\n\t['git:rebase:autosquash', '2.44'],\n\t['git:rev-parse:end-of-options', '2.30'],\n\t['git:signing:ssh', '2.34.0'],\n\t['git:signing:x509', '2.19.0'],\n\t// Sparse-index support debuted earlier, but 2.33 shipped a corruption fix and 2.34 broadened command\n\t// support. Use 2.34 as the conservative floor before offering a repository mutation.\n\t['git:sparse-index', '2.34'],\n\t['git:stash:push:pathspecs', '2.13.2'],\n\t['git:stash:push:staged', '2.35.0'],\n\t['git:stash:push:stdin', '2.30.0'],\n\t['git:status:find-renames', '2.18'],\n\t['git:status:porcelain-v2', '2.11'],\n\t// `core.untrackedCache=true` (repo-local cache of untracked-file scans — the auto-tier config lever).\n\t['git:untrackedCache', '2.8'],\n\t['git:worktrees', '2.17.0'],\n]);\n"],"mappings":";AA2CA,MAAa,oBAAoB;AACjC,MAAa,uCAAuB,IAAI,IAAyB;CAChE,CAAC,mCAAmC,MAAM;CAG1C,CAAC,oBAAoB,MAAM;CAG3B,CAAC,kCAAkC,MAAM;CACzC,CAAC,iCAAiC,MAAM;CACxC,CAAC,iCAAiC,MAAM;CAGxC,CAAC,iBAAiB,MAAM;CAIxB,CAAC,uBAAuB,MAAM;CAC9B,CAAC,sBAAsB,MAAM;CAE7B,CAAC,sBAAsB,MAAM;CAI7B,CAAC,mBAAmB,MAAM;CAE1B,CAAC,6BAA6B,MAAM;CAGpC,CAAC,yBAAyB,MAAM;CAGhC,CAAC,iCAAiC,MAAM;CAExC,CAAC,iBAAiB,MAAM;CACxB,CAAC,6BAA6B,MAAM;CAEpC,CAAC,6BAA6B,MAAM;CACpC,CAAC,8BAA8B,QAAQ;CAIvC,CAAC,yBAAyB,MAAM;CAChC,CAAC,gCAAgC,MAAM;CACvC,CAAC,mBAAmB,QAAQ;CAC5B,CAAC,oBAAoB,QAAQ;CAG7B,CAAC,oBAAoB,MAAM;CAC3B,CAAC,4BAA4B,QAAQ;CACrC,CAAC,yBAAyB,QAAQ;CAClC,CAAC,wBAAwB,QAAQ;CACjC,CAAC,2BAA2B,MAAM;CAClC,CAAC,2BAA2B,MAAM;CAElC,CAAC,sBAAsB,KAAK;CAC5B,CAAC,iBAAiB,QAAQ;AAC3B,CAAC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Shape } from "../../utils/types.js";
|
|
2
2
|
//#region ../git/src/models/reflog.d.ts
|
|
3
|
+
/** One entry of `refs.getReflogEntries`; {@link GitReflog} is the aggregated HEAD walk instead */
|
|
4
|
+
export interface GitReflogEntry {
|
|
5
|
+
readonly sha: string;
|
|
6
|
+
/** The reflog subject, `%gs`. */
|
|
7
|
+
readonly message: string;
|
|
8
|
+
}
|
|
3
9
|
export interface GitReflog {
|
|
4
10
|
readonly repoPath: string;
|
|
5
11
|
readonly records: GitReflogRecord[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflog.js","names":[],"sources":["../../../../git/src/models/reflog.ts"],"sourcesContent":["import { formatDate, fromNow } from '@gitlens/utils/date.js';\nimport { loggable } from '@gitlens/utils/decorators/log.js';\nimport { memoize } from '@gitlens/utils/decorators/memoize.js';\nimport type { Shape } from '@gitlens/utils/types.js';\nimport { shortenRevision } from '../utils/revision.utils.js';\n\nexport interface GitReflog {\n\treadonly repoPath: string;\n\treadonly records: GitReflogRecord[];\n\n\treadonly count: number;\n\treadonly total: number;\n\treadonly limit: number | undefined;\n\treadonly hasMore: boolean;\n\tmore?(limit: number | undefined): Promise<GitReflog | undefined>;\n}\n\nexport type GitReflogRecordShape = Shape<GitReflogRecord>;\n\n@loggable(i => `${shortenRevision(i.sha)}|${i.command}`)\nexport class GitReflogRecord {\n\tprivate _previousSha: string | undefined;\n\n\tconstructor(\n\t\tpublic readonly repoPath: string,\n\t\tpublic readonly sha: string,\n\t\tprivate _selector: string,\n\t\tpublic readonly date: Date,\n\t\tpublic readonly command: string,\n\t\tpublic readonly commandArgs: string | undefined,\n\t\tpublic readonly details: string | undefined,\n\t) {}\n\n\t@memoize()\n\tget HEAD(): string {\n\t\tif (this._selector == null || this._selector.length === 0) return '';\n\n\t\tif (this._selector.startsWith('refs/heads')) {\n\t\t\treturn this._selector.substring(11);\n\t\t}\n\n\t\tif (this._selector.startsWith('refs/remotes')) {\n\t\t\treturn this._selector.substring(13);\n\t\t}\n\n\t\treturn this._selector;\n\t}\n\n\tget previousSha(): string | undefined {\n\t\treturn this._previousSha;\n\t}\n\n\t@memoize()\n\tget previousShortSha(): string {\n\t\treturn shortenRevision(this._previousSha);\n\t}\n\n\tget selector(): string {\n\t\treturn this._selector;\n\t}\n\n\t@memoize()\n\tget shortSha(): string {\n\t\treturn shortenRevision(this.sha);\n\t}\n\n\t/** @internal Called by the parser to set previousSha/selector before the record is published */\n\tupdate(previousSha?: string, selector?: string): void {\n\t\tif (previousSha !== undefined) {\n\t\t\tthis._previousSha = previousSha;\n\t\t}\n\t\tif (selector !== undefined) {\n\t\t\tthis._selector = selector;\n\t\t}\n\t}\n\n\tstatic is(record: unknown): record is GitReflogRecord {\n\t\treturn record instanceof GitReflogRecord;\n\t}\n\n\tstatic formatDate(record: GitReflogRecordShape, format?: string | null): string {\n\t\treturn formatDate(record.date, format ?? 'MMMM Do, YYYY h:mma');\n\t}\n\n\tstatic formatDateFromNow(record: GitReflogRecordShape): string {\n\t\treturn fromNow(record.date);\n\t}\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"reflog.js","names":[],"sources":["../../../../git/src/models/reflog.ts"],"sourcesContent":["import { formatDate, fromNow } from '@gitlens/utils/date.js';\nimport { loggable } from '@gitlens/utils/decorators/log.js';\nimport { memoize } from '@gitlens/utils/decorators/memoize.js';\nimport type { Shape } from '@gitlens/utils/types.js';\nimport { shortenRevision } from '../utils/revision.utils.js';\n\n/** One entry of `refs.getReflogEntries`; {@link GitReflog} is the aggregated HEAD walk instead */\nexport interface GitReflogEntry {\n\treadonly sha: string;\n\t/** The reflog subject, `%gs`. */\n\treadonly message: string;\n}\n\nexport interface GitReflog {\n\treadonly repoPath: string;\n\treadonly records: GitReflogRecord[];\n\n\treadonly count: number;\n\treadonly total: number;\n\treadonly limit: number | undefined;\n\treadonly hasMore: boolean;\n\tmore?(limit: number | undefined): Promise<GitReflog | undefined>;\n}\n\nexport type GitReflogRecordShape = Shape<GitReflogRecord>;\n\n@loggable(i => `${shortenRevision(i.sha)}|${i.command}`)\nexport class GitReflogRecord {\n\tprivate _previousSha: string | undefined;\n\n\tconstructor(\n\t\tpublic readonly repoPath: string,\n\t\tpublic readonly sha: string,\n\t\tprivate _selector: string,\n\t\tpublic readonly date: Date,\n\t\tpublic readonly command: string,\n\t\tpublic readonly commandArgs: string | undefined,\n\t\tpublic readonly details: string | undefined,\n\t) {}\n\n\t@memoize()\n\tget HEAD(): string {\n\t\tif (this._selector == null || this._selector.length === 0) return '';\n\n\t\tif (this._selector.startsWith('refs/heads')) {\n\t\t\treturn this._selector.substring(11);\n\t\t}\n\n\t\tif (this._selector.startsWith('refs/remotes')) {\n\t\t\treturn this._selector.substring(13);\n\t\t}\n\n\t\treturn this._selector;\n\t}\n\n\tget previousSha(): string | undefined {\n\t\treturn this._previousSha;\n\t}\n\n\t@memoize()\n\tget previousShortSha(): string {\n\t\treturn shortenRevision(this._previousSha);\n\t}\n\n\tget selector(): string {\n\t\treturn this._selector;\n\t}\n\n\t@memoize()\n\tget shortSha(): string {\n\t\treturn shortenRevision(this.sha);\n\t}\n\n\t/** @internal Called by the parser to set previousSha/selector before the record is published */\n\tupdate(previousSha?: string, selector?: string): void {\n\t\tif (previousSha !== undefined) {\n\t\t\tthis._previousSha = previousSha;\n\t\t}\n\t\tif (selector !== undefined) {\n\t\t\tthis._selector = selector;\n\t\t}\n\t}\n\n\tstatic is(record: unknown): record is GitReflogRecord {\n\t\treturn record instanceof GitReflogRecord;\n\t}\n\n\tstatic formatDate(record: GitReflogRecordShape, format?: string | null): string {\n\t\treturn formatDate(record.date, format ?? 'MMMM Do, YYYY h:mma');\n\t}\n\n\tstatic formatDateFromNow(record: GitReflogRecordShape): string {\n\t\treturn fromNow(record.date);\n\t}\n}\n"],"mappings":";;;;;;;AA2BO,IAAM,kBAAA,mBAAN,MAAM,gBAAgB;CAIX;CACA;CACR;CACQ;CACA;CACA;CACA;CATjB;CAEA,YACC,UACA,KACA,WACA,MACA,SACA,aACA,SACC;EAPe,KAAA,WAAA;EACA,KAAA,MAAA;EACR,KAAA,YAAA;EACQ,KAAA,OAAA;EACA,KAAA,UAAA;EACA,KAAA,cAAA;EACA,KAAA,UAAA;CACd;CAEH,IACI,OAAe;EAClB,IAAI,KAAK,aAAa,QAAQ,KAAK,UAAU,WAAW,GAAG,OAAO;EAElE,IAAI,KAAK,UAAU,WAAW,YAAY,GACzC,OAAO,KAAK,UAAU,UAAU,EAAE;EAGnC,IAAI,KAAK,UAAU,WAAW,cAAc,GAC3C,OAAO,KAAK,UAAU,UAAU,EAAE;EAGnC,OAAO,KAAK;CACb;CAEA,IAAI,cAAkC;EACrC,OAAO,KAAK;CACb;CAEA,IACI,mBAA2B;EAC9B,OAAO,gBAAgB,KAAK,YAAY;CACzC;CAEA,IAAI,WAAmB;EACtB,OAAO,KAAK;CACb;CAEA,IACI,WAAmB;EACtB,OAAO,gBAAgB,KAAK,GAAG;CAChC;;CAGA,OAAO,aAAsB,UAAyB;EACrD,IAAI,gBAAgB,KAAA,GACnB,KAAK,eAAe;EAErB,IAAI,aAAa,KAAA,GAChB,KAAK,YAAY;CAEnB;CAEA,OAAO,GAAG,QAA4C;EACrD,OAAO,kBAAA;CACR;CAEA,OAAO,WAAW,QAA8B,QAAgC;EAC/E,OAAO,WAAW,OAAO,MAAM,UAAU,qBAAqB;CAC/D;CAEA,OAAO,kBAAkB,QAAsC;EAC9D,OAAO,QAAQ,OAAO,IAAI;CAC3B;AACD;AAtDE,WAAA,CAAA,QAAQ,CAAA,GAAA,gBAAA,WAAA,QAAA,IAAA;AAmBR,WAAA,CAAA,QAAQ,CAAA,GAAA,gBAAA,WAAA,oBAAA,IAAA;AASR,WAAA,CAAA,QAAQ,CAAA,GAAA,gBAAA,WAAA,YAAA,IAAA;AA1CT,kBAAA,mBAAA,WAAA,CAAA,UAAS,MAAK,GAAG,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,CAAA,GAAA,eAAA"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export declare const deletedOrMissing = "0000000000000000000000000000000000000000-";
|
|
3
3
|
export declare const uncommitted = "0000000000000000000000000000000000000000";
|
|
4
4
|
export declare const uncommittedStaged = "0000000000000000000000000000000000000000:";
|
|
5
|
-
export declare const rootSha = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
6
5
|
export type GitRevisionRange = `${GitRevisionRangeNotation}${string}` | `${string}${GitRevisionRangeNotation}` | `${string}${GitRevisionRangeNotation}${string}`;
|
|
7
6
|
export type GitRevisionRangeNotation = '..' | '...';
|
|
8
7
|
//#endregion
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
const deletedOrMissing = "0000000000000000000000000000000000000000-";
|
|
3
3
|
const uncommitted = "0000000000000000000000000000000000000000";
|
|
4
4
|
const uncommittedStaged = "0000000000000000000000000000000000000000:";
|
|
5
|
-
const rootSha = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
6
5
|
//#endregion
|
|
7
|
-
export { deletedOrMissing,
|
|
6
|
+
export { deletedOrMissing, uncommitted, uncommittedStaged };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=revision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision.js","names":[],"sources":["../../../../git/src/models/revision.ts"],"sourcesContent":["export const deletedOrMissing = '0000000000000000000000000000000000000000-';\nexport const uncommitted = '0000000000000000000000000000000000000000';\nexport const uncommittedStaged = '0000000000000000000000000000000000000000:';\n
|
|
1
|
+
{"version":3,"file":"revision.js","names":[],"sources":["../../../../git/src/models/revision.ts"],"sourcesContent":["export const deletedOrMissing = '0000000000000000000000000000000000000000-';\nexport const uncommitted = '0000000000000000000000000000000000000000';\nexport const uncommittedStaged = '0000000000000000000000000000000000000000:';\n\nexport type GitRevisionRange =\n\t| `${GitRevisionRangeNotation}${string}`\n\t| `${string}${GitRevisionRangeNotation}`\n\t| `${string}${GitRevisionRangeNotation}${string}`;\n\nexport type GitRevisionRangeNotation = '..' | '...';\n"],"mappings":";AAAA,MAAa,mBAAmB;AAChC,MAAa,cAAc;AAC3B,MAAa,oBAAoB"}
|
|
@@ -30,7 +30,11 @@ export type GitBranchMergedStatus = {
|
|
|
30
30
|
localBranchOnly?: GitBranchReference;
|
|
31
31
|
};
|
|
32
32
|
export interface GitBranchesSubProvider {
|
|
33
|
-
getBranch(repoPath: string, name?: string,
|
|
33
|
+
getBranch(repoPath: string, name?: string,
|
|
34
|
+
/** `force`: skips the cached answer and any in-flight read that started before this call, and stores the fresh answer. */
|
|
35
|
+
options?: {
|
|
36
|
+
force?: boolean;
|
|
37
|
+
}, cancellation?: AbortSignal): Promise<GitBranch | undefined>;
|
|
34
38
|
getBranches(repoPath: string, options?: {
|
|
35
39
|
filter?: ((b: GitBranch) => boolean) | undefined;
|
|
36
40
|
ordering?: 'date' | 'author-date' | 'topo' | null;
|
|
@@ -45,6 +45,8 @@ export interface GitLogForPathOptions extends Omit<GitLogOptions, 'stashes'> {
|
|
|
45
45
|
export interface GitLogShasOptions extends GitLogOptionsBase {
|
|
46
46
|
all?: boolean;
|
|
47
47
|
authors?: GitUser[];
|
|
48
|
+
/** Leaves out commits reachable from these refs, relative to `rev` (`HEAD` when omitted) — see {@link GitRefExclusions} */
|
|
49
|
+
excluding?: GitRefExclusions;
|
|
48
50
|
merges?: boolean | 'first-parent';
|
|
49
51
|
pathOrUri?: string | Uri;
|
|
50
52
|
reverse?: boolean;
|
|
@@ -63,6 +65,20 @@ export interface IncomingActivityOptions extends GitLogOptionsBase {
|
|
|
63
65
|
branch?: string;
|
|
64
66
|
skip?: number;
|
|
65
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Refs whose commits a history read (`getCommitCount`, `getLogShas`) leaves out, as `--not`.
|
|
70
|
+
* `branches`/`remotes`/`tags` exclude every ref in that namespace; `except` carves full ref names or globs (`refs/heads/feat`, `refs/remotes/origin/*`)
|
|
71
|
+
* back out of an enabled namespace and is ignored otherwise; `refs` are further revisions, passed verbatim.
|
|
72
|
+
* A read is cached until a branch, remote-tracking branch or tag changes, so a `refs` entry outside those namespaces
|
|
73
|
+
* (a tool's own `refs/<tool>/…`) can move without refreshing it: pass that ref's SHA instead, which keys a new read.
|
|
74
|
+
*/
|
|
75
|
+
export interface GitRefExclusions {
|
|
76
|
+
branches?: boolean;
|
|
77
|
+
remotes?: boolean;
|
|
78
|
+
tags?: boolean;
|
|
79
|
+
refs?: readonly string[];
|
|
80
|
+
except?: readonly string[];
|
|
81
|
+
}
|
|
66
82
|
export interface GitCommitReachability {
|
|
67
83
|
readonly partial?: boolean;
|
|
68
84
|
readonly refs: ({
|
|
@@ -78,7 +94,10 @@ export interface GitCommitReachability {
|
|
|
78
94
|
}
|
|
79
95
|
export interface GitCommitsSubProvider {
|
|
80
96
|
getCommit(repoPath: string, rev: string, cancellation?: AbortSignal): Promise<GitCommit | undefined>;
|
|
81
|
-
|
|
97
|
+
/** Counts the commits reachable from `rev`, less any reachable from `excluding` — e.g. what only one branch has */
|
|
98
|
+
getCommitCount(repoPath: string, rev: string, options?: {
|
|
99
|
+
excluding?: GitRefExclusions;
|
|
100
|
+
}, cancellation?: AbortSignal): Promise<number | undefined>;
|
|
82
101
|
/** Whether `rev` has any commits not reachable from any remote-tracking ref (i.e. unpushed/unpublished).
|
|
83
102
|
* Cheap early-exit probe (`rev-list --not --remotes <rev> -n 1`) — it does NOT count them. Returns
|
|
84
103
|
* `undefined` when it can't be determined. */
|
|
@@ -112,7 +131,30 @@ export interface GitCommitsSubProvider {
|
|
|
112
131
|
isAncestorOf(repoPath: string, rev1: string, rev2: string, cancellation?: AbortSignal): Promise<boolean>;
|
|
113
132
|
hasCommitBeenPushed(repoPath: string, rev: string, cancellation?: AbortSignal): Promise<boolean>;
|
|
114
133
|
searchCommits(repoPath: string, search: SearchQuery, options?: GitSearchCommitsOptions, cancellation?: AbortSignal): Promise<SearchCommitsResult>;
|
|
115
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Creates a commit object from a tree via `commit-tree`, with explicit (zero or more) parents and an
|
|
136
|
+
* optional explicit author/committer — e.g. for merge commits assembled from multiple parents, or a
|
|
137
|
+
* commit authored on behalf of someone else. Writes the commit object only; it updates no ref, so the
|
|
138
|
+
* result is unreachable until a caller points a branch/ref at it.
|
|
139
|
+
*
|
|
140
|
+
* Signs the commit when `sign` is true, reporting a signing failure as a `SigningError`.
|
|
141
|
+
*/
|
|
142
|
+
createCommitFromTree?(repoPath: string, tree: string, options: {
|
|
143
|
+
parents: string[];
|
|
144
|
+
message: string;
|
|
145
|
+
author?: {
|
|
146
|
+
name: string;
|
|
147
|
+
email: string;
|
|
148
|
+
date?: Date | string;
|
|
149
|
+
};
|
|
150
|
+
committer?: {
|
|
151
|
+
name: string;
|
|
152
|
+
email: string;
|
|
153
|
+
date?: Date | string;
|
|
154
|
+
};
|
|
155
|
+
sign?: boolean;
|
|
156
|
+
source?: unknown;
|
|
157
|
+
}, cancellation?: AbortSignal): Promise<string>;
|
|
116
158
|
getCommitReachability?(repoPath: string, rev: string, cancellation?: AbortSignal): Promise<GitCommitReachability | undefined>;
|
|
117
159
|
getCommitSignature?(repoPath: string, sha: string): Promise<CommitSignature | undefined>;
|
|
118
160
|
/**
|
|
@@ -3,7 +3,9 @@ import { SigningConfig, ValidationResult } from "../models/signature.js";
|
|
|
3
3
|
import { GitUser } from "../models/user.js";
|
|
4
4
|
import { GkConfigInvalidationTarget } from "../cache.js";
|
|
5
5
|
//#region ../git/src/providers/config.d.ts
|
|
6
|
-
export type GitCoreConfigKeys = 'commit.gpgsign' | 'core.excludesFile' |
|
|
6
|
+
export type GitCoreConfigKeys = 'commit.gpgsign' | 'core.excludesFile' |
|
|
7
|
+
/** `core.hooksPath` — the directory git runs hooks from instead of `$GIT_DIR/hooks` */
|
|
8
|
+
'core.hooksPath' | 'diff.guitool' | 'diff.tool' |
|
|
7
9
|
/** `fetch.prune` — whether `git fetch` removes remote-tracking branches that no longer exist on the remote */
|
|
8
10
|
'fetch.prune' | 'gpg.format' | 'gpg.program' | 'gpg.ssh.program' | 'gpg.ssh.allowedSignersFile' | 'init.defaultBranch' |
|
|
9
11
|
/** `merge.autoStash` — whether `git merge` (and so a merging `git pull`) stashes and reapplies uncommitted changes */
|
|
@@ -23,6 +25,10 @@ export type GitCoreConfigKeys = 'commit.gpgsign' | 'core.excludesFile' | 'diff.g
|
|
|
23
25
|
/** `remote.pushDefault` — the remote `git push` targets when a branch has no explicit push remote configured */
|
|
24
26
|
'remote.pushDefault' | 'user.email' | 'user.name' | 'user.signingkey';
|
|
25
27
|
export type GitConfigKeys = GitCoreConfigKeys |
|
|
28
|
+
/** `remote` — the branch's upstream remote */
|
|
29
|
+
`branch.${string}.remote` |
|
|
30
|
+
/** `merge` — the upstream ref on that remote, e.g. `refs/heads/main`; together with `remote`, this is what `--set-upstream-to` writes, and writing them directly sets an upstream whose remote ref does not exist yet */
|
|
31
|
+
`branch.${string}.merge` |
|
|
26
32
|
/** `vscode-merge-base` — value determined by VS Code that is used to determine the merge base for the current branch. Once `gk-merge-base` is determined, we stop using `vscode-merge-base` */
|
|
27
33
|
`branch.${string}.vscode-merge-base` |
|
|
28
34
|
/** `github-pr-owner-number` — value determined by VS Code/GitHub PR extension that is used to determine the PR number for the current branch */
|
|
@@ -47,6 +47,19 @@ export interface GitOperationsSubProvider {
|
|
|
47
47
|
prune?: boolean | undefined;
|
|
48
48
|
pull?: boolean | undefined;
|
|
49
49
|
remote?: string | undefined;
|
|
50
|
+
refspecs?: undefined;
|
|
51
|
+
/** Leaves `FETCH_HEAD` for a user's own `git pull` to read (`--no-write-fetch-head`); ignored on git older than 2.29 */
|
|
52
|
+
preserveFetchHead?: boolean | undefined;
|
|
53
|
+
} | {
|
|
54
|
+
all?: undefined;
|
|
55
|
+
branch?: undefined;
|
|
56
|
+
prune?: boolean | undefined;
|
|
57
|
+
pull?: undefined;
|
|
58
|
+
remote: string;
|
|
59
|
+
/** Passed verbatim after `remote`; never adds `-u`, so git keeps refusing to write into a checked-out branch. */
|
|
60
|
+
refspecs: readonly string[];
|
|
61
|
+
/** Leaves `FETCH_HEAD` for a user's own `git pull` to read (`--no-write-fetch-head`); ignored on git older than 2.29 */
|
|
62
|
+
preserveFetchHead?: boolean | undefined;
|
|
50
63
|
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
51
64
|
merge(repoPath: string, ref: string, options?: {
|
|
52
65
|
fastForward?: boolean | 'only';
|
|
@@ -56,6 +69,12 @@ export interface GitOperationsSubProvider {
|
|
|
56
69
|
}, runOptions?: GitOperationRunOptions): Promise<GitOperationResult>;
|
|
57
70
|
pull(repoPath: string, options?: {
|
|
58
71
|
branch?: GitBranchReference | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* `'only'` requires a fast-forward (`--ff-only`) and refuses rather than merging or rebasing — a
|
|
74
|
+
* `branch` checked out nowhere is then fast-forwarded by fetching `<upstream>:<branch>`. Spelled as
|
|
75
|
+
* `merge`'s option; `--ff`/`--no-ff` are left out because a pull configured to rebase ignores them.
|
|
76
|
+
*/
|
|
77
|
+
fastForward?: 'only' | undefined;
|
|
59
78
|
rebase?: boolean | undefined;
|
|
60
79
|
tags?: boolean | undefined;
|
|
61
80
|
source?: unknown;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { Uri } from "../../utils/uri.js";
|
|
2
2
|
import { GitProviderDescriptor } from "./types.js";
|
|
3
3
|
import { GitIgnoreFilter } from "../watching/gitIgnoreFilter.js";
|
|
4
|
+
import { RepositoryChange } from "../models/repository.js";
|
|
4
5
|
import { GitMaintenanceSubProvider } from "./maintenance.js";
|
|
5
6
|
import { GitCommitsSubProvider } from "./commits.js";
|
|
6
7
|
import { GitBranchesSubProvider } from "./branches.js";
|
|
7
8
|
import { GitContributorsSubProvider } from "./contributors.js";
|
|
8
9
|
import { GitRevisionSubProvider } from "./revision.js";
|
|
10
|
+
import { CachedGitTypes } from "../cache.js";
|
|
11
|
+
import { GitOperationRunOptions, GitOperationsSubProvider } from "./operations.js";
|
|
9
12
|
import { GitBlameSubProvider } from "./blame.js";
|
|
10
13
|
import { GitConfigSubProvider } from "./config.js";
|
|
11
14
|
import { GitStagingSubProvider } from "./staging.js";
|
|
12
15
|
import { GitDiffSubProvider } from "./diff.js";
|
|
13
16
|
import { GitGraphSubProvider } from "./graph.js";
|
|
14
|
-
import { GitOperationsSubProvider } from "./operations.js";
|
|
15
17
|
import { GitPatchSubProvider } from "./patch.js";
|
|
16
18
|
import { GitPausedOperationsSubProvider } from "./pausedOperations.js";
|
|
17
19
|
import { GitRefsSubProvider } from "./refs.js";
|
|
@@ -31,11 +33,36 @@ export interface GitProvider {
|
|
|
31
33
|
readonly descriptor: GitProviderDescriptor;
|
|
32
34
|
getAbsoluteUri(pathOrUri: string | Uri, base: string | Uri): Uri;
|
|
33
35
|
getRelativePath(pathOrUri: string | Uri, base: string | Uri): string;
|
|
34
|
-
clone?(url: string, parentPath: string
|
|
36
|
+
clone?(url: string, parentPath: string, options?: {
|
|
37
|
+
/** Used exactly, with no collision probing or auto-numbering; git itself refuses a non-empty target. */
|
|
38
|
+
folderName?: string;
|
|
39
|
+
},
|
|
40
|
+
/** Spread into the run (`env`, `cancellation`, `timeout`) — the caller decides the timeout for a large clone. */
|
|
41
|
+
runOptions?: GitOperationRunOptions): Promise<string | undefined>;
|
|
35
42
|
excludeIgnoredUris?(repoPath: string, uris: Uri[]): Promise<Uri[]>;
|
|
36
43
|
getIgnoreFilter?(repoPath: string, gitDirPath: string): GitIgnoreFilter;
|
|
37
44
|
getIgnoredUrisFilter?(repoPath: string): Promise<(uri: Uri) => boolean>;
|
|
38
45
|
getLastFetchedTimestamp?(repoPath: string): Promise<number | undefined>;
|
|
46
|
+
/** Creates a new repository at `path` (`git init`), creating `path` itself if it doesn't yet exist. */
|
|
47
|
+
init?(path: string, options?: {
|
|
48
|
+
defaultBranch?: string;
|
|
49
|
+
bare?: boolean;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Notifies the provider that `repoPath` was mutated outside of a typed sub-provider method — e.g. a
|
|
53
|
+
* consumer that ran a command through the raw `git.run`/`provider.git.run` escape hatch. Fires the same
|
|
54
|
+
* `cache.onReset`/`repository.onChanged` hooks a typed mutator would, so, exactly as after a typed write,
|
|
55
|
+
* the provider clears its own caches for `repoPath` and the repository's pending commands before the
|
|
56
|
+
* host's handlers run.
|
|
57
|
+
*
|
|
58
|
+
* What is reset: `options.cache` when given (`'all'` for everything, `[]` for nothing); otherwise the
|
|
59
|
+
* cache types `changes` map to, the same mapping a file watcher's changes get. An empty `changes`, or one
|
|
60
|
+
* naming `'unknown'` or `'closed'`, resets everything. Changes that map to no cache type (e.g.
|
|
61
|
+
* `'starred'`) reset nothing and fire no `onReset`; `onChanged` always fires.
|
|
62
|
+
*/
|
|
63
|
+
notifyChanged?(repoPath: string, changes: readonly RepositoryChange[], options?: {
|
|
64
|
+
cache?: readonly CachedGitTypes[] | 'all';
|
|
65
|
+
}): void;
|
|
39
66
|
readonly branches: GitBranchesSubProvider;
|
|
40
67
|
readonly commits: GitCommitsSubProvider;
|
|
41
68
|
readonly config: GitConfigSubProvider;
|
|
@@ -3,6 +3,7 @@ import { GitRefTip, GitReference } from "../models/reference.js";
|
|
|
3
3
|
import { GitBranch } from "../models/branch.js";
|
|
4
4
|
import { GitTag } from "../models/tag.js";
|
|
5
5
|
import { GitCommandPriority } from "../run.types.js";
|
|
6
|
+
import { GitReflogEntry } from "../models/reflog.js";
|
|
6
7
|
//#region ../git/src/providers/refs.d.ts
|
|
7
8
|
export interface GitRefsSubProvider {
|
|
8
9
|
checkIfCouldBeValidBranchOrTagName(repoPath: string, ref: string): Promise<boolean>;
|
|
@@ -10,7 +11,20 @@ export interface GitRefsSubProvider {
|
|
|
10
11
|
forkPoint?: boolean | undefined;
|
|
11
12
|
priority?: GitCommandPriority;
|
|
12
13
|
}, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
13
|
-
getReference(repoPath: string, ref: string,
|
|
14
|
+
getReference(repoPath: string, ref: string,
|
|
15
|
+
/** `force`: skips the cached answer and any in-flight read that started before this call, and stores the fresh answer. */
|
|
16
|
+
options?: {
|
|
17
|
+
force?: boolean;
|
|
18
|
+
}, cancellation?: AbortSignal): Promise<GitReference | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Reads `ref`'s reflog, newest first, optionally keeping only entries whose message matches `grep` (git's
|
|
21
|
+
* `--grep-reflog` pattern). Resolves `[]` when nothing matches or `ref` has no reflog, and rejects when the
|
|
22
|
+
* read fails (e.g. `ref` doesn't exist), so "no answer" is distinguishable from "never read".
|
|
23
|
+
*/
|
|
24
|
+
getReflogEntries?(repoPath: string, ref: string, options?: {
|
|
25
|
+
grep?: string;
|
|
26
|
+
priority?: GitCommandPriority;
|
|
27
|
+
}, cancellation?: AbortSignal): Promise<GitReflogEntry[]>;
|
|
14
28
|
/**
|
|
15
29
|
* Lightweight enumeration of ref tips (heads/remotes/tags) — no enrichment.
|
|
16
30
|
* Use this when you need a SHA-to-refs map; use `getBranches`/`getTags` for full models.
|
|
@@ -38,8 +52,39 @@ export interface GitRefsSubProvider {
|
|
|
38
52
|
} | undefined;
|
|
39
53
|
}, cancellation?: AbortSignal): Promise<boolean>;
|
|
40
54
|
isValidReference(repoPath: string, ref: string, pathOrUri?: string | Uri, cancellation?: AbortSignal): Promise<boolean>;
|
|
41
|
-
validateReference(repoPath: string, ref: string,
|
|
42
|
-
|
|
55
|
+
validateReference(repoPath: string, ref: string, options?: {
|
|
56
|
+
relativePath?: string;
|
|
57
|
+
/** Skips the cached answer and any in-flight read that started before this call, and stores the fresh answer. */
|
|
58
|
+
force?: boolean;
|
|
59
|
+
}, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Deletes `ref` — a symbolic ref itself, never the ref it points to; `HEAD` is refused. `expected` makes
|
|
62
|
+
* it a compare-and-swap: the delete is refused unless the ref is at that sha. Without `expected`,
|
|
63
|
+
* deleting a ref that doesn't exist succeeds — git treats it as already-done rather than an error.
|
|
64
|
+
*
|
|
65
|
+
* A local branch (`refs/heads/<name>`) is deleted the way `git branch -d` would leave things, minus its
|
|
66
|
+
* merged check: refused while checked out in any worktree, and its `branch.<name>` config section and
|
|
67
|
+
* GitLens's per-branch metadata go with it. Prefer `branches.deleteLocalBranch` unless you need the
|
|
68
|
+
* compare-and-swap.
|
|
69
|
+
*
|
|
70
|
+
* Optional because only a real git host can offer it.
|
|
71
|
+
*
|
|
72
|
+
* @throws {ReferenceUpdateError} `'conflict'` when the ref is elsewhere, `'notFound'` when
|
|
73
|
+
* `expected` was given and the ref doesn't exist, `'checkedOut'` for a branch checked out in a worktree.
|
|
74
|
+
*/
|
|
75
|
+
deleteReference?(repoPath: string, ref: string, options?: {
|
|
76
|
+
expected?: string;
|
|
77
|
+
}, cancellation?: AbortSignal): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Points `ref` at `sha`. `expected` makes it a compare-and-swap: a sha requires the ref to be there
|
|
80
|
+
* already, `'absent'` requires it not to exist at all (create-only).
|
|
81
|
+
*
|
|
82
|
+
* @throws {ReferenceUpdateError} `'conflict'` when the compare-and-swap lost, `'invalidRef'` for a
|
|
83
|
+
* malformed name, `'invalidObject'` when `sha` is unknown.
|
|
84
|
+
*/
|
|
85
|
+
updateReference(repoPath: string, ref: string, sha: string, options?: {
|
|
86
|
+
expected?: string | 'absent';
|
|
87
|
+
}, cancellation?: AbortSignal): Promise<void>;
|
|
43
88
|
}
|
|
44
89
|
//#endregion
|
|
45
90
|
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -18,13 +18,19 @@ export interface GitRevisionSubProvider {
|
|
|
18
18
|
exists?(repoPath: string, path: string, revOrOptions?: string | {
|
|
19
19
|
untracked?: 'only' | 'include';
|
|
20
20
|
}): Promise<boolean>;
|
|
21
|
+
/** The empty tree's id in this repository's object format (SHA-1 or SHA-256). */
|
|
22
|
+
getEmptyTreeSha(repoPath: string): Promise<string>;
|
|
21
23
|
getRevisionContent(repoPath: string, path: string, rev: string): Promise<Uint8Array | undefined>;
|
|
22
24
|
getSubmoduleHead?(repoPath: string, submodulePath: string): Promise<string | undefined>;
|
|
23
25
|
/** Gets tracked file paths from the index (reflects working tree state, even during rebase) */
|
|
24
26
|
getTrackedFiles(repoPath: string): Promise<string[]>;
|
|
25
27
|
getTreeEntryForRevision(repoPath: string, path: string, rev: string): Promise<GitTreeEntry | undefined>;
|
|
26
28
|
getTreeForRevision(repoPath: string, rev: string): Promise<GitTreeEntry[]>;
|
|
27
|
-
resolveRevision(repoPath: string, ref: string, pathOrUri?: string | Uri
|
|
29
|
+
resolveRevision(repoPath: string, ref: string, pathOrUri?: string | Uri,
|
|
30
|
+
/** `force`: skips the cached answer and any in-flight read that started before this call, and stores the fresh answer. */
|
|
31
|
+
options?: {
|
|
32
|
+
force?: boolean;
|
|
33
|
+
}): Promise<ResolvedRevision>;
|
|
28
34
|
}
|
|
29
35
|
//#endregion
|
|
30
36
|
//# sourceMappingURL=revision.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Uri } from "../../utils/uri.js";
|
|
2
2
|
import { UnifiedAsyncDisposable } from "../../utils/disposable.js";
|
|
3
|
+
import { GitOperationRunOptions } from "./operations.js";
|
|
3
4
|
//#region ../git/src/providers/staging.d.ts
|
|
4
5
|
export interface DisposableTemporaryGitIndex extends UnifiedAsyncDisposable {
|
|
5
6
|
path: string;
|
|
@@ -37,6 +38,18 @@ export interface GitStagingSubProvider {
|
|
|
37
38
|
}): Promise<void>;
|
|
38
39
|
stageAll(repoPath: string): Promise<void>;
|
|
39
40
|
unstageAll(repoPath: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Removes untracked files from the working tree (`git clean`). `force` defaults to `true`, since git
|
|
43
|
+
* refuses to clean without `-f` unless `clean.requireForce` is `false`. Pass
|
|
44
|
+
* `directories: true` to also remove untracked directories, `ignored: true` to also remove files git
|
|
45
|
+
* would otherwise skip (gitignored), and `paths` to restrict the clean to specific files/directories.
|
|
46
|
+
*/
|
|
47
|
+
clean(repoPath: string, options?: {
|
|
48
|
+
paths?: (string | Uri)[];
|
|
49
|
+
directories?: boolean;
|
|
50
|
+
force?: boolean;
|
|
51
|
+
ignored?: boolean;
|
|
52
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
40
53
|
}
|
|
41
54
|
//#endregion
|
|
42
55
|
//# sourceMappingURL=staging.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Uri } from "../../utils/uri.js";
|
|
2
2
|
import { GitFileChange } from "../models/fileChange.js";
|
|
3
3
|
import { GitStash } from "../models/stash.js";
|
|
4
|
+
import { GitOperationRunOptions } from "./operations.js";
|
|
4
5
|
//#region ../git/src/providers/stash.d.ts
|
|
5
6
|
export interface StashApplyResult {
|
|
6
7
|
readonly conflicted: boolean;
|
|
@@ -15,7 +16,7 @@ export interface GitStashSubProvider {
|
|
|
15
16
|
applyStash(repoPath: string, stashNameOrSha: string, options?: {
|
|
16
17
|
deleteAfter?: boolean | undefined;
|
|
17
18
|
index?: boolean | undefined;
|
|
18
|
-
}): Promise<StashApplyResult>;
|
|
19
|
+
}, runOptions?: GitOperationRunOptions): Promise<StashApplyResult>;
|
|
19
20
|
/**
|
|
20
21
|
* Creates a stash commit without adding it to the stash list (plumbing — equivalent to
|
|
21
22
|
* `git stash create`). Returns the created commit SHA, or `undefined` if there was nothing to
|
|
@@ -36,7 +37,7 @@ export interface GitStashSubProvider {
|
|
|
36
37
|
includeUntracked?: boolean;
|
|
37
38
|
keepIndex?: boolean;
|
|
38
39
|
onlyStaged?: boolean;
|
|
39
|
-
}): Promise<void>;
|
|
40
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
40
41
|
saveSnapshot(repoPath: string, message?: string): Promise<void>;
|
|
41
42
|
}
|
|
42
43
|
//#endregion
|
|
@@ -14,6 +14,10 @@ export interface GitStatusSubProvider {
|
|
|
14
14
|
getStatus(repoPath: string | undefined, options?: {
|
|
15
15
|
priority?: GitCommandPriority;
|
|
16
16
|
force?: boolean;
|
|
17
|
+
/** `git status -u<value>`; defaults to `'all'` (today's `-u`, listing files in an untracked directory individually). */
|
|
18
|
+
untracked?: 'no' | 'normal' | 'all';
|
|
19
|
+
/** `false` omits `--branch`, computing no upstream ahead/behind; the result's `branch`, `sha`, `upstream` and `detached` are then not read and mean nothing */
|
|
20
|
+
branch?: false;
|
|
17
21
|
}, cancellation?: AbortSignal): Promise<GitStatus | undefined>;
|
|
18
22
|
getStatusForFile?(repoPath: string, pathOrUri: string | Uri, options?: {
|
|
19
23
|
renames?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Uri } from "../../utils/uri.js";
|
|
2
2
|
import { GitWorktree } from "../models/worktree.js";
|
|
3
|
+
import { GitOperationRunOptions } from "./operations.js";
|
|
3
4
|
//#region ../git/src/providers/worktrees.d.ts
|
|
4
5
|
export interface GitWorktreesSubProvider {
|
|
5
6
|
createWorktree(repoPath: string, path: string, options?: {
|
|
@@ -8,20 +9,39 @@ export interface GitWorktreesSubProvider {
|
|
|
8
9
|
detach?: boolean;
|
|
9
10
|
force?: boolean;
|
|
10
11
|
noTracking?: boolean;
|
|
11
|
-
}): Promise<void>;
|
|
12
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
12
13
|
createWorktreeWithResult(repoPath: string, path: string, options?: {
|
|
13
14
|
commitish?: string;
|
|
14
15
|
createBranch?: string;
|
|
15
16
|
detach?: boolean;
|
|
16
17
|
force?: boolean;
|
|
17
18
|
noTracking?: boolean;
|
|
18
|
-
}): Promise<GitWorktree | undefined>;
|
|
19
|
+
}, runOptions?: GitOperationRunOptions): Promise<GitWorktree | undefined>;
|
|
19
20
|
getWorktree(repoPath: string, predicate: (w: GitWorktree) => boolean, cancellation?: AbortSignal): Promise<GitWorktree | undefined>;
|
|
20
21
|
getWorktrees(repoPath: string, cancellation?: AbortSignal): Promise<GitWorktree[]>;
|
|
21
22
|
getWorktreesDefaultUri(repoPath: string): Uri | undefined;
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Deletes a worktree. Pass `force: 'locked'` to also override a locked worktree.
|
|
25
|
+
*
|
|
26
|
+
* `runOptions` are spread into the underlying git invocation (e.g. `{ timeout: 0 }` for a large
|
|
27
|
+
* worktree whose removal may exceed the default command timeout).
|
|
28
|
+
*
|
|
29
|
+
* On failure, the thrown error's `original` property carries the raw underlying error (stderr/stdout
|
|
30
|
+
* included) untouched, for a caller that needs to classify a platform-specific failure itself.
|
|
31
|
+
*/
|
|
23
32
|
deleteWorktree(repoPath: string, path: string | Uri, options?: {
|
|
24
33
|
force?: boolean | 'locked';
|
|
34
|
+
}, runOptions?: GitOperationRunOptions): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Removes administrative files for worktrees whose working directory no longer exists
|
|
37
|
+
* (`git worktree prune`). Pass `expire` to only prune worktrees that have been inaccessible for longer than the given time.
|
|
38
|
+
*/
|
|
39
|
+
pruneWorktrees(repoPath: string, options?: {
|
|
40
|
+
expire?: string;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
/** Locks a worktree against removal/pruning, optionally recording a reason. */
|
|
43
|
+
lockWorktree(repoPath: string, path: string | Uri, options?: {
|
|
44
|
+
reason?: string;
|
|
25
45
|
}): Promise<void>;
|
|
26
46
|
unlockWorktree(repoPath: string, path: string | Uri): Promise<void>;
|
|
27
47
|
}
|
package/dist/git/run.types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CacheController } from "../utils/promiseCache.js";
|
|
2
2
|
import { GitWarningKey } from "./errors.js";
|
|
3
|
+
import { RepositoryChange } from "./models/repository.js";
|
|
3
4
|
import { GitHealthSlownessCategory } from "./gitHealth.js";
|
|
4
5
|
//#region ../git/src/run.types.d.ts
|
|
5
6
|
export type GitErrorHandling = 'throw' | 'ignore';
|
|
@@ -76,6 +77,7 @@ export interface GitResultCache {
|
|
|
76
77
|
accessTTL?: number;
|
|
77
78
|
cancellation?: AbortSignal;
|
|
78
79
|
}): Promise<GitResult<unknown>>;
|
|
80
|
+
delete(repoPath: string, key: string): void;
|
|
79
81
|
}
|
|
80
82
|
/**
|
|
81
83
|
* Priority levels for git commands.
|
|
@@ -119,7 +121,27 @@ export interface GitRunOptions {
|
|
|
119
121
|
createTTL?: number;
|
|
120
122
|
accessTTL?: number;
|
|
121
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* Drops this command's cached result first, so the run neither returns the stale value nor joins
|
|
126
|
+
* an in-flight run of it, and stores the fresh result for later unforced reads.
|
|
127
|
+
*/
|
|
128
|
+
force?: boolean;
|
|
122
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* Opt-in: after the run settles (success, failure, or cancellation), announce a change to the provider
|
|
132
|
+
* for this run's repository, the same way a typed sub-provider mutator does. `'infer'` classifies the
|
|
133
|
+
* command's argv (a `-C <path>` re-scopes which repository); a read-only or object-store-only command
|
|
134
|
+
* then announces nothing. An explicit array announces exactly those {@link RepositoryChange} kinds,
|
|
135
|
+
* regardless of what the argv looks like. Left unset, nothing is classified or announced — zero cost
|
|
136
|
+
* for every existing caller. The change is announced for `cwd`, or the `-C` target, as given: run from the
|
|
137
|
+
* repository root, since that's the path core's caches are keyed by. A `-C`-scoped verb whose effect every
|
|
138
|
+
* worktree shares (`branch`, `fetch`, …) is announced for the caller's `cwd` too, resetting once per repository.
|
|
139
|
+
*
|
|
140
|
+
* The announcement resets only the caches the announced kinds can have made stale, the same ones a file
|
|
141
|
+
* watcher's change of those kinds clears, and drops the repository's pending git runs. A write `'infer'`
|
|
142
|
+
* can't classify announces `[]`, which resets everything, as does `['unknown']`.
|
|
143
|
+
*/
|
|
144
|
+
notify?: 'infer' | readonly RepositoryChange[];
|
|
123
145
|
cwd?: string;
|
|
124
146
|
readonly env?: Record<string, string | undefined>;
|
|
125
147
|
readonly encoding?: BufferEncoding | 'buffer' | string;
|