@gitkraken/core-gitlens 0.16.4 → 0.17.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 +39 -1
- package/dist/git/cache.d.ts +8 -2
- package/dist/git/cache.js +15 -6
- package/dist/git/cache.js.map +1 -1
- package/dist/git/models/issue.d.ts +20 -1
- package/dist/git/models/issue.js +3 -1
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/models/repository.d.ts +4 -2
- package/dist/git/models/repository.js +1 -0
- package/dist/git/models/repository.js.map +1 -1
- package/dist/git/models/worktree.d.ts +5 -1
- package/dist/git/models/worktree.js +5 -3
- package/dist/git/models/worktree.js.map +1 -1
- package/dist/git/providers/provider.d.ts +17 -0
- package/dist/git/providers/worktrees.d.ts +17 -2
- package/dist/git/run.types.d.ts +7 -0
- package/dist/git/service.d.ts +5 -2
- package/dist/git/service.js +11 -5
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/issue.utils.js +5 -1
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/watching/classifyChange.d.ts +4 -3
- package/dist/git/watching/classifyChange.js +7 -4
- package/dist/git/watching/classifyChange.js.map +1 -1
- package/dist/git/watching/provider.d.ts +6 -0
- package/dist/git/watching/watchGroup.d.ts +142 -3
- package/dist/git/watching/watchGroup.js +424 -19
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +25 -0
- package/dist/git/watching/watchService.js +27 -7
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +13 -8
- package/dist/git/watching/watchSession.js +50 -10
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.d.ts +14 -0
- package/dist/git/watching/watcherPatterns.js +38 -1
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +64 -2
- package/dist/git/watching/worktreeSummary.js +326 -13
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +26 -0
- package/dist/git-cli/cliGitProvider.js +66 -5
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +9 -3
- package/dist/git-cli/exec/commandClassifier.js +98 -17
- package/dist/git-cli/exec/commandClassifier.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +20 -0
- package/dist/git-cli/exec/git.js +69 -7
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/headState.d.ts +5 -0
- package/dist/git-cli/exec/headState.js +14 -1
- package/dist/git-cli/exec/headState.js.map +1 -1
- package/dist/git-cli/parsers/worktreeParser.js +2 -2
- package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
- package/dist/git-cli/providers/branches.js +8 -4
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/graph.js +1 -1
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +3 -0
- package/dist/git-cli/providers/operations.js +14 -5
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/worktrees.d.ts +25 -3
- package/dist/git-cli/providers/worktrees.js +125 -32
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.d.ts +2 -0
- package/dist/git-cli/service.js +4 -2
- package/dist/git-cli/service.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +13 -0
- package/dist/plus/integrations/models/gitHostIntegration.js +20 -3
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +12 -0
- package/dist/plus/integrations/models/integration.js +7 -1
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +13 -0
- package/dist/plus/integrations/providers/azure/azure.js +11 -3
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/models.d.ts +3 -1
- package/dist/plus/integrations/providers/azure/models.js +11 -5
- package/dist/plus/integrations/providers/azure/models.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +33 -5
- package/dist/plus/integrations/providers/azureDevOps.js +75 -11
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.js +1 -0
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +19 -0
- package/dist/plus/integrations/providers/models.js +12 -3
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/reads/etag.js +6 -1
- package/dist/plus/integrations/reads/etag.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,42 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.17.0] - 2026-10-25
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Adds `ignoredWorktreeFolders` to `CliGitProviderOptions` and `createCliGitService`: folders, relative to a repository's common git dir, whose worktrees core acts as if didn't exist, for a tool's throwaway worktrees (sync-tools' `sync-tools-worktrees`, say). They are matched under the common git dir as spelled and as it resolves through symlinks. They are left out of worktree lists, and adding, removing, locking, unlocking or moving one (by absolute path, in a `notify: 'infer'` run; the typed worktree writes still announce it) announces no `worktrees` change, so it no longer evicts every checkout's cached git results. The `.git` watchers leave the folders unwatched, so a throwaway checkout inside `.git` costs the watcher nothing. Nothing is ignored unless registered (git, git-cli)
|
|
14
|
+
- Adds `readDirectory` to `GitService.createSingleton`'s options, shaped like `FileSystemProvider.readDirectory`, which `createCliGitService` passes from the host's file system. With it and `readFile`, the watcher lists and reads a repository's worktree admin entries once as it starts, so an ignored worktree's reports, every HEAD move of a rebase in one included, reach no session, while a known worktree's reports are told at once without a read (git, git-cli)
|
|
15
|
+
- Adds `WorktreeSummaryService.getSummarySnapshot(repoPath, { probeDirty?, cancellation? })`, which answers a worktree's summary with `dirtyReadAt`, when its dirty flag was read: `undefined` for a subscribed worktree, whose summary follows its working tree. For a worktree without a subscription, `probeDirty` reads the dirty flag whatever its inputs say (git)
|
|
16
|
+
- Adds `onDidStart` to `FileWatcherOptions`, passed to working-tree watchers only, with or without polling: a provider that places its watch asynchronously calls it once the watch is live, and core rescans the working tree once for whatever changed meanwhile (git)
|
|
17
|
+
- Adds `stat` to `WorktreeSummaryServiceOptions`, which `GitService` fills from `watchPolling.stat`: with it, a worktree without a subscription re-reads its dirty flag only when its index file moved (git)
|
|
18
|
+
- Adds `GitWorktree.branchName`: the branch `git worktree list` names, set even when the branch list has no match for it, which `GitWorktree.name` now falls back to (git, git-cli)
|
|
19
|
+
- Adds a `force` option to `worktrees.getWorktrees(repoPath, options?, cancellation?)` and `worktrees.getWorktree(repoPath, predicate, options?, cancellation?)`: it re-reads `git worktree list` and evicts only the cached worktree list, for the repository and its sibling worktrees, unless a read whose git process hasn't started yet is pending, which it joins. Clearing the `'worktrees'` and `'branches'` cache types to get a fresh list made every sibling worktree re-run its branch, ref and log reads (git, git-cli)
|
|
20
|
+
- Adds `onSpawn` to `GitRunOptions`, called once when the git process starts, after any wait in core's queue; a call sharing an identical run in flight is told when that run starts (git, git-cli)
|
|
21
|
+
- Adds the `'worktreeHead'` repository change, a linked worktree's HEAD moving (a checkout in a worktree whose own `.git` isn't watched), which the `.git` watchers report beside `'worktrees'` for a worktree's `HEAD` and for an admin entry created or removed (a watcher may report a removal as its directory alone), and `git worktree add`, `remove` and `prune` (typed or `notify: 'infer'`) announce; and the `'worktreeList'` cache type, which evicts only the cached worktree list, for the repository and its sibling worktrees (git, git-cli)
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Breaking (git, git-cli)** — `worktrees.getWorktrees` and `worktrees.getWorktree` take `options` before `cancellation`, `getWorktrees(repoPath, options?, cancellation?)` and `getWorktree(repoPath, predicate, options?, cancellation?)`, like `branches.getBranch`. A caller passing a cancellation positionally must move it
|
|
26
|
+
- **Breaking (git, git-cli)** — `RepositoryChange` gains `'worktreeHead'` and `CachedGitTypes` gains `'worktreeList'`, which breaks a host's exhaustive `switch` or `Record` over either. A host that refreshed on a linked worktree's checkout by `'worktrees'` still hears it, since its report carries both
|
|
27
|
+
- Changes a lock or unlock of a worktree, typed or raw, a raw `git worktree move` or `repair`, and a watcher's report of a worktree's `locked` file, a `gitdir` written or an admin entry's directory changed, to evict only the cached worktree list rather than every worktree's cached git results and merge targets. An add, remove or prune, or a worktree's HEAD moving, still evicts them all (git, git-cli)
|
|
28
|
+
- Changes a `'providers'`-only cache reset, which only touches remote-provider metadata, to leave in-flight git runs joinable in core's typed writes and `notifyChanged`, as it already did in GitLens (git, git-cli)
|
|
29
|
+
- Changes a checkout, switch, rebase, bisect or `stash branch` core runs (typed or `notify: 'infer'`), and its move of a detached HEAD, to announce `'worktrees'` and `'worktreeHead'` beside its own kinds, so every other worktree takes the watchers' report of the rewritten HEAD for the write's own: it no longer hears it a second time as an outside change, nor evicts every worktree's cached git results again for it. A commit on a branch, which leaves the HEAD file as it was, announces neither (git-cli)
|
|
30
|
+
- Changes `getSummary` of a worktree without a subscription to answer from its last read, kept for the 256 most recently asked, rather than reading every field afresh each time (4 to 7 git processes): it re-reads only what its inputs say moved since, all of them read from core's caches, so nothing moved means no git. HEAD's branch or commit moving reads everything; the upstream's tip or name, the branch; a ref the base depends on (for a remote's `HEAD` symref, where it points), the base, re-measured from the previous one as for a subscribed worktree; the config inputs the base read consulted, the branch and the base; the index file (with `stat`), the dirty flag; and core's own write of the branch's merge target or base, the stored base values. Only a `.git` watch of the worktree (or core's own writes) keeps those caches current, so a host watches the `.git` of a worktree it asks about. Concurrent reads of one worktree share a read, which still takes no read slot, so it never waits behind subscribed worktrees' runs; a caller after core's write of a merge target or base gets a read of its own. A subscription drops the last read, and so does a failed read (git)
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Fixes a write that creates or removes the directory holding its ref (the first `team/…` branch, say) also reaching watchers as an outside change of every branch: the watcher's report of that directory is now the write's own (git)
|
|
35
|
+
- Fixes the first move of a base after a clone, or after the reflog lost the entries before it, re-measuring every worktree in full instead of in one shared read (git-cli)
|
|
36
|
+
- Fixes a worktree list pairing a worktree with no branch, or a stale one, after a change the branch caches missed (a branch `git worktree add -b` created outside core, a worktree that switched branches, a commit), so a `pull` of a branch checked out in another worktree fetched into it and failed: where `git worktree list` contradicts the cached branch list, core re-reads the branches once, first dropping the branch caches of a worktree whose branch changed, and announces an unnamed `heads` change so a host's views of the branches refresh too. A contradiction the fresh branch list still shows (a layout where git's two listings never agree) isn't re-read again until the worktree list changes (git-cli)
|
|
37
|
+
- Fixes a worktree whose HEAD points outside `refs/heads/` getting a garbled branch name; it has none (git-cli)
|
|
38
|
+
|
|
39
|
+
## [0.16.5] - 2026-10-24
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- Adds `viewer` to `IssueShape` and `Issue`: the current account as the issue's `author` and `assignees` identify it, where that can differ from the account `getCurrentAccount` returns. Set on Azure DevOps and Azure DevOps Server work items that name someone, from `listIssuesPage` (account-wide and repository-scoped), `getIssuesBatch` and the point read, and on Azure DevOps Server also from `searchIssuesPage`, to the user's identity in the work item's organization (collection). It's read from the organization's `ConnectionData`, with the same credential that read the rows, through the per-credential, per-organization cache the pull request reads use, so a host matches "assigned to me" and "authored by me" correctly for accounts whose profile id differs from that identity. A work item that names no one gets none, nor does one whose organization's identity can't be read within 10 seconds; such a row's `getIssuesBatch` etag never compares unchanged, so it's read in full again rather than kept without a viewer, and every Azure work item etag held from before this change is read in full once. Absent for every other provider ([gitkraken/kepler#4291](https://github.com/gitkraken/kepler/issues/4291)) (git, plus/integrations)
|
|
44
|
+
|
|
9
45
|
## [0.16.4] - 2026-10-23
|
|
10
46
|
|
|
11
47
|
### Added
|
|
@@ -920,7 +956,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
920
956
|
|
|
921
957
|
- Initial release. Bundles `@gitlens/utils`, `@gitlens/git`, `@gitlens/git-cli`, `@gitlens/ai`, and `@gitlens/git-github` into a single core npm package with subpath exports.
|
|
922
958
|
|
|
923
|
-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.
|
|
959
|
+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.17.0...HEAD
|
|
960
|
+
[0.17.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.5...gitkraken:releases/core/v0.17.0
|
|
961
|
+
[0.16.5]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.4...gitkraken:releases/core/v0.16.5
|
|
924
962
|
[0.16.4]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.3...gitkraken:releases/core/v0.16.4
|
|
925
963
|
[0.16.3]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.2...gitkraken:releases/core/v0.16.3
|
|
926
964
|
[0.16.2]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.16.1...gitkraken:releases/core/v0.16.2
|
package/dist/git/cache.d.ts
CHANGED
|
@@ -31,7 +31,11 @@ type RepoPath = string;
|
|
|
31
31
|
/** Cache types that are keyed by file path within a repo — support per-file clearing */
|
|
32
32
|
export type UriScopedCachedGitTypes = 'blame' | 'diff' | 'fileLog';
|
|
33
33
|
export declare function areUriScopedCachedGitTypes(types: string[]): types is UriScopedCachedGitTypes[];
|
|
34
|
-
export type CachedGitTypes = UriScopedCachedGitTypes | 'branch' | 'branches' | 'config' | 'contributors' | 'gitignore' | 'gkConfig' | 'lastFetched' | 'providers' | 'remotes' | 'stashes' | 'status' | 'tags' | 'tracking' | 'worktrees'
|
|
34
|
+
export type CachedGitTypes = UriScopedCachedGitTypes | 'branch' | 'branches' | 'config' | 'contributors' | 'gitignore' | 'gkConfig' | 'lastFetched' | 'providers' | 'remotes' | 'stashes' | 'status' | 'tags' | 'tracking' | 'worktrees' |
|
|
35
|
+
/** Only the worktree list: unlike `'worktrees'`, no worktree's git results or merge targets */
|
|
36
|
+
'worktreeList';
|
|
37
|
+
/** Whether a reset of these types makes in-flight git runs stale (none or empty meaning every type) */
|
|
38
|
+
export declare function resetDropsPendingRuns(types: readonly CachedGitTypes[] | undefined): boolean;
|
|
35
39
|
/**
|
|
36
40
|
* What a gk-config reconcile did, so `Cache` knows whether the coarse fallback is still owed.
|
|
37
41
|
*
|
|
@@ -513,7 +517,9 @@ export declare class Cache implements Disposable {
|
|
|
513
517
|
cancellation?: AbortSignal;
|
|
514
518
|
}): Promise<GitStash>;
|
|
515
519
|
getTags(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<PagedResult<GitTag>>, cancellation?: AbortSignal): Promise<PagedResult<GitTag>>;
|
|
516
|
-
getWorktrees(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<GitWorktree[]>,
|
|
520
|
+
getWorktrees(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<GitWorktree[]>, options?: {
|
|
521
|
+
force?: boolean;
|
|
522
|
+
}, cancellation?: AbortSignal): Promise<GitWorktree[]>;
|
|
517
523
|
private getSharedOrCreate;
|
|
518
524
|
private getSharedOrCreateWithKey;
|
|
519
525
|
private getSharedSimple;
|
package/dist/git/cache.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { exhaustiveArray } from "../utils/array.js";
|
|
2
|
-
import { raceWithSignal } from "../utils/cancellation.js";
|
|
2
|
+
import { CancellationError, raceWithSignal } from "../utils/cancellation.js";
|
|
3
3
|
import { debug } from "../utils/decorators/log.js";
|
|
4
4
|
import { invalidateMemoized } from "../utils/decorators/memoize.js";
|
|
5
5
|
import { Emitter } from "../utils/event.js";
|
|
@@ -19,6 +19,10 @@ const uriScopedCachedGitTypes = [
|
|
|
19
19
|
function areUriScopedCachedGitTypes(types) {
|
|
20
20
|
return types.every((t) => uriScopedCachedGitTypes.includes(t));
|
|
21
21
|
}
|
|
22
|
+
/** Whether a reset of these types makes in-flight git runs stale (none or empty meaning every type) */
|
|
23
|
+
function resetDropsPendingRuns(types) {
|
|
24
|
+
return !types?.length || types.some((t) => t !== "worktreeList" && t !== "providers");
|
|
25
|
+
}
|
|
22
26
|
/**
|
|
23
27
|
* Ceiling on how long a derived branch base is trusted. Long enough that repeated reads during normal use
|
|
24
28
|
* are served from cache, short enough that a base that changed by a route with no eviction signal (an
|
|
@@ -503,8 +507,8 @@ var Cache = class Cache {
|
|
|
503
507
|
keysToClear.add("fileExistence");
|
|
504
508
|
keysToClear.add("trackedPaths");
|
|
505
509
|
}
|
|
506
|
-
if (types.includes("worktrees")) keysToClear.add("worktrees");
|
|
507
|
-
if (types.some((t) => t !== "gitignore" && t !== "gkConfig" && t !== "providers")) keysToClear.add("gitResults");
|
|
510
|
+
if (types.includes("worktrees") || types.includes("worktreeList")) keysToClear.add("worktrees");
|
|
511
|
+
if (types.some((t) => t !== "gitignore" && t !== "gkConfig" && t !== "providers" && t !== "worktreeList")) keysToClear.add("gitResults");
|
|
508
512
|
}
|
|
509
513
|
for (const key of keysToClear) {
|
|
510
514
|
const cache = this._caches[key];
|
|
@@ -759,7 +763,8 @@ var Cache = class Cache {
|
|
|
759
763
|
}
|
|
760
764
|
if (hasAny("stash")) types.add("stashes");
|
|
761
765
|
if (hasAny("tags")) types.add("tags");
|
|
762
|
-
if (hasAny("
|
|
766
|
+
if (hasAny("worktreeHead")) types.add("worktrees");
|
|
767
|
+
else if (hasAny("worktrees")) types.add("worktreeList");
|
|
763
768
|
if (types.size) this.clearCachesCore(inFlight, repoPath, [...types], worktreeOnly);
|
|
764
769
|
return [...types];
|
|
765
770
|
}
|
|
@@ -1279,7 +1284,11 @@ var Cache = class Cache {
|
|
|
1279
1284
|
values: data.values.map((t) => t.withRepoPath(newRepoPath))
|
|
1280
1285
|
}), cancellation);
|
|
1281
1286
|
}
|
|
1282
|
-
async getWorktrees(repoPath, factory, cancellation) {
|
|
1287
|
+
async getWorktrees(repoPath, factory, options, cancellation) {
|
|
1288
|
+
if (options?.force) {
|
|
1289
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
1290
|
+
this.evictCaches(repoPath, "worktreeList");
|
|
1291
|
+
}
|
|
1283
1292
|
return this.getSharedOrCreate(this.worktrees, repoPath, factory, (data, newRepoPath) => data.map((w) => w.withRepoPath(newRepoPath)), cancellation);
|
|
1284
1293
|
}
|
|
1285
1294
|
async getSharedOrCreate(cache, repoPath, factory, mapper, cancellation) {
|
|
@@ -1345,6 +1354,6 @@ __decorate([debug({ onlyExit: true })], Cache.prototype, "reset", null);
|
|
|
1345
1354
|
__decorate([debug({ onlyExit: true })], Cache.prototype, "onRepositoryChanged", null);
|
|
1346
1355
|
__decorate([debug({ onlyExit: true })], Cache.prototype, "applyRepositoryChanges", null);
|
|
1347
1356
|
//#endregion
|
|
1348
|
-
export { Cache, areUriScopedCachedGitTypes, shouldEvictBlameCacheEntry };
|
|
1357
|
+
export { Cache, areUriScopedCachedGitTypes, resetDropsPendingRuns, shouldEvictBlameCacheEntry };
|
|
1349
1358
|
|
|
1350
1359
|
//# sourceMappingURL=cache.js.map
|