@gitkraken/core-gitlens 0.15.4 → 0.15.5
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 +18 -1
- package/dist/git/cache.d.ts +9 -12
- package/dist/git/cache.js +34 -16
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +19 -2
- package/dist/git/context.js.map +1 -1
- package/dist/git/providers/provider.d.ts +7 -0
- package/dist/git/service.d.ts +5 -1
- package/dist/git/service.js +8 -4
- package/dist/git/service.js.map +1 -1
- package/dist/git/watching/changeEvent.d.ts +25 -1
- package/dist/git/watching/changeEvent.js +36 -2
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/configSections.d.ts +35 -0
- package/dist/git/watching/configSections.js +210 -0
- package/dist/git/watching/configSections.js.map +1 -0
- package/dist/git/watching/watchGroup.d.ts +36 -3
- package/dist/git/watching/watchGroup.js +107 -2
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +14 -3
- package/dist/git/watching/watchService.js +10 -7
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +52 -21
- package/dist/git/watching/watchSession.js +164 -42
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +9 -7
- package/dist/git/watching/worktreeSummary.js +21 -10
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +6 -1
- package/dist/git-cli/cliGitProvider.js +45 -5
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +2 -2
- package/dist/git-cli/providers/branches.js +17 -15
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +13 -0
- package/dist/git-cli/providers/config.js +38 -1
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +35 -1
- package/dist/git-cli/providers/operations.js +175 -16
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +1 -0
- package/dist/git-cli/providers/stash.js +9 -3
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/worktrees.js +11 -4
- package/dist/git-cli/providers/worktrees.js.map +1 -1
- package/dist/git-cli/service.js +5 -1
- package/dist/git-cli/service.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +0 -1
- package/dist/plus/integrations/reads/drains.d.ts +0 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.15.5] - 2026-10-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Adds optional `refs` and `options.configConfinedToRefs` to `GitServiceHooks.repository.onChanged`: `refs` are the full ref names a write created, moved or deleted, and a ref kind with names among them is fully described by them, so a host can skip work for refs it doesn't follow; `configConfinedToRefs` says the write changed `.git/config` only in the `branch.<name>` sections of the local branches `refs` names. Siblings sharing the repository hear the names and the flag with the shared kinds. Branch create, delete, rename and upstream changes, `checkout -b`, a worktree's new branch, a commit (its branch, read from the worktree's `HEAD` before and after the run, and named only when both agree) and stash writes (`refs/stash`, by a pop only when it dropped the entry) name their refs; a host that ignores them treats every kind as unnamed, as before (git, git-cli)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Changes how the watch layer tells a write's own reports from outside changes once announcements name refs: a raw report is the write's echo only when every ref it names, or every branch whose config section it changed, is among those the write announced (or it reports `HEAD`, which a commit locks, under a write that announced `head`), and it arrives within the debounce delay of the announcement, so an outside change to another ref or config section, or a later change to the same ref, is kept and reaches its subscribers unannounced. A watch group now diffs the shared `.git/config` by section on each report (one read for every worktree of the repository) and delivers a change confined to `branch.<name>` sections as confined to those branches (`WatcherRepoChangeEvent.configBranches`, `mayHaveChangedConfig`), whoever wrote it; anything else, an unreadable or unparsable file, a read that doesn't settle within 5 seconds, or another config file is unconfined. Ref-filtered subscriptions and worktree summaries narrow a confined change like a named ref (git)
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Fixes worktree summaries keeping an outdated ahead-of-base target after checkout-specific Git configuration changes. Each checkout now compares its effective configuration, including branch-conditional includes, with the configuration used for its current base.
|
|
22
|
+
- Fixes a fetch announcing `remotes` to every worktree of the repository, and resetting the branch and tag caches, whether or not anything moved, so each worktree summary re-read its base after every fetch: in a Kepler daemon with ~60 worktrees one task launch cost ~490 git processes. A fetch now compares the refs it can write (its refspecs' destinations, the fetched remotes' configured destinations, symref targets included, and tags) before and after it runs, announces nothing when none moved, and otherwise names exactly what moved; a snapshot it can't read falls back to the previous announcement (git-cli)
|
|
23
|
+
- Fixes deleting, creating or renaming a branch making every worktree of the repository re-read its base, since the write's `.git/config` change and the watcher's later report of it reached every subscriber; one task removal cost ~460 git processes over ~60 worktrees (git, git-cli)
|
|
24
|
+
|
|
9
25
|
## [0.15.4] - 2026-10-22
|
|
10
26
|
|
|
11
27
|
### Added
|
|
@@ -830,7 +846,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
830
846
|
|
|
831
847
|
- 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.
|
|
832
848
|
|
|
833
|
-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.
|
|
849
|
+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.5...HEAD
|
|
850
|
+
[0.15.5]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.4...gitkraken:releases/core/v0.15.5
|
|
834
851
|
[0.15.4]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.3...gitkraken:releases/core/v0.15.4
|
|
835
852
|
[0.15.3]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.2...gitkraken:releases/core/v0.15.3
|
|
836
853
|
[0.15.2]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.1...gitkraken:releases/core/v0.15.2
|
package/dist/git/cache.d.ts
CHANGED
|
@@ -238,17 +238,17 @@ export declare class Cache implements Disposable {
|
|
|
238
238
|
* Call this when a worktree is deleted or a repo is closed so stale registry entries
|
|
239
239
|
* and derived cache entries don't persist.
|
|
240
240
|
*
|
|
241
|
-
* Targeted — does NOT cascade to sibling worktrees sharing the same commonPath.
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
241
|
+
* Targeted — does NOT cascade to sibling worktrees sharing the same commonPath. Shared caches
|
|
242
|
+
* stay warm until the last worktree closes, except raw git results co-located with a closing main
|
|
243
|
+
* checkout: those must retire with its config fingerprint so reopening cannot attest an old command
|
|
244
|
+
* with new config. Detached promises keep their existing callers and abort wiring. Other entries
|
|
245
|
+
* use soft-invalidate where supported so any in-flight factory/mapper keeps its abort
|
|
246
246
|
* wiring intact — a caller whose signal aborts after unregister can still propagate
|
|
247
247
|
* cancellation into the underlying work rather than leaving it orphaned. Controller-backed
|
|
248
248
|
* entries self-evict on settle; plain `.set()`-based entries hard-delete immediately.
|
|
249
249
|
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
250
|
+
* The status clock advances even for an unregistered path so a fresh registration cannot join a
|
|
251
|
+
* status read that started before it.
|
|
252
252
|
*/
|
|
253
253
|
unregisterRepoPath(repoPath: string): void;
|
|
254
254
|
reset(): void;
|
|
@@ -423,11 +423,8 @@ export declare class Cache implements Disposable {
|
|
|
423
423
|
*/
|
|
424
424
|
deleteBranchMetadata(repoPath: string): void;
|
|
425
425
|
getBranchMergedStatus(repoPath: string, cacheKey: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<GitBranchMergedStatus>, cancellation?: AbortSignal): Promise<GitBranchMergedStatus>;
|
|
426
|
-
/**
|
|
427
|
-
|
|
428
|
-
* it (see {@link clearCaches}), so a read issued after the change never joins one that started before it.
|
|
429
|
-
*/
|
|
430
|
-
getAheadOfBaseConfigKey(repoPath: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
426
|
+
/** Config can differ by checkout through config.worktree and conditional includes. */
|
|
427
|
+
getAheadOfBaseConfigKey(repoPath: string, factory: (repoPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
431
428
|
getBranchMetadataMap(repoPath: string, factory: (commonPath: string) => PromiseOrValue<Map<string, BranchMetadata>>): Promise<Map<string, BranchMetadata>>;
|
|
432
429
|
getDefaultBranchName(repoPath: string, remote: string, factory: (commonPath: string, cacheable: CacheController, cancellation?: AbortSignal) => PromiseOrValue<string | undefined>, cancellation?: AbortSignal): Promise<string | undefined>;
|
|
433
430
|
/** Clears the cached default branch for one `remote` key (the networked lookup or its `:local` variant). */
|
package/dist/git/cache.js
CHANGED
|
@@ -54,7 +54,6 @@ function getSettledOrPending(cache, key) {
|
|
|
54
54
|
}
|
|
55
55
|
/** Compile-time enforced: adding a key to SharedCaches without listing it here is a type error */
|
|
56
56
|
const sharedCacheKeys = new Set(exhaustiveArray()([
|
|
57
|
-
"aheadOfBaseConfigKey",
|
|
58
57
|
"baseBranchName",
|
|
59
58
|
"branchMergedStatus",
|
|
60
59
|
"branchMetadataMap",
|
|
@@ -419,7 +418,10 @@ var Cache = class Cache {
|
|
|
419
418
|
keysToClear.add("reachability");
|
|
420
419
|
keysToClear.add("resolvedRevisions");
|
|
421
420
|
}
|
|
422
|
-
if (types.includes("branch"))
|
|
421
|
+
if (types.includes("branch")) {
|
|
422
|
+
keysToClear.add("aheadOfBaseConfigKey");
|
|
423
|
+
keysToClear.add("baseBranchName");
|
|
424
|
+
}
|
|
423
425
|
if (types.includes("branches")) {
|
|
424
426
|
keysToClear.add("branchMetadataMap");
|
|
425
427
|
keysToClear.add("branches");
|
|
@@ -488,8 +490,12 @@ var Cache = class Cache {
|
|
|
488
490
|
const cache = this._caches[key];
|
|
489
491
|
if (cache == null) continue;
|
|
490
492
|
if (repoPath == null) cache.clear();
|
|
493
|
+
else if (key === "aheadOfBaseConfigKey" && !worktreeOnly && (!types.length || types.includes("config"))) this.evictShared(key, repoPath, "evict");
|
|
491
494
|
else if (sharedCacheKeys.has(key)) {
|
|
492
|
-
if (!worktreeOnly)
|
|
495
|
+
if (!worktreeOnly) {
|
|
496
|
+
const hardEvict = key === "gitResults" && (types.includes("config") || types.includes("branch"));
|
|
497
|
+
this.evictShared(key, repoPath, hardEvict ? "evict" : inFlight);
|
|
498
|
+
}
|
|
493
499
|
} else cache.delete(repoPath);
|
|
494
500
|
}
|
|
495
501
|
}
|
|
@@ -596,6 +602,12 @@ var Cache = class Cache {
|
|
|
596
602
|
registerRepoPath(repoPath, gitDir) {
|
|
597
603
|
const normalizedPath = getRepositoryOrWorktreePath(repoPath);
|
|
598
604
|
const commonPath = gitDir.commonUri != null ? getCommonRepositoryPath(gitDir.commonUri) : normalizedPath;
|
|
605
|
+
const previousCommonPath = this._commonPathRegistry.get(normalizedPath);
|
|
606
|
+
if (previousCommonPath != null && previousCommonPath !== commonPath) this.unregisterRepoPath(normalizedPath);
|
|
607
|
+
if (previousCommonPath !== commonPath) {
|
|
608
|
+
this._caches.aheadOfBaseConfigKey?.delete(normalizedPath);
|
|
609
|
+
this._caches.gitResults?.delete(normalizedPath);
|
|
610
|
+
}
|
|
599
611
|
this._commonPathRegistry.set(normalizedPath, commonPath);
|
|
600
612
|
let worktrees = this._worktreesByCommonPath.get(commonPath);
|
|
601
613
|
if (worktrees == null) {
|
|
@@ -611,17 +623,17 @@ var Cache = class Cache {
|
|
|
611
623
|
* Call this when a worktree is deleted or a repo is closed so stale registry entries
|
|
612
624
|
* and derived cache entries don't persist.
|
|
613
625
|
*
|
|
614
|
-
* Targeted — does NOT cascade to sibling worktrees sharing the same commonPath.
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
626
|
+
* Targeted — does NOT cascade to sibling worktrees sharing the same commonPath. Shared caches
|
|
627
|
+
* stay warm until the last worktree closes, except raw git results co-located with a closing main
|
|
628
|
+
* checkout: those must retire with its config fingerprint so reopening cannot attest an old command
|
|
629
|
+
* with new config. Detached promises keep their existing callers and abort wiring. Other entries
|
|
630
|
+
* use soft-invalidate where supported so any in-flight factory/mapper keeps its abort
|
|
619
631
|
* wiring intact — a caller whose signal aborts after unregister can still propagate
|
|
620
632
|
* cancellation into the underlying work rather than leaving it orphaned. Controller-backed
|
|
621
633
|
* entries self-evict on settle; plain `.set()`-based entries hard-delete immediately.
|
|
622
634
|
*
|
|
623
|
-
*
|
|
624
|
-
*
|
|
635
|
+
* The status clock advances even for an unregistered path so a fresh registration cannot join a
|
|
636
|
+
* status read that started before it.
|
|
625
637
|
*/
|
|
626
638
|
unregisterRepoPath(repoPath) {
|
|
627
639
|
this.incrementStatusGeneration(repoPath);
|
|
@@ -632,6 +644,11 @@ var Cache = class Cache {
|
|
|
632
644
|
for (const key of Object.keys(this._caches)) {
|
|
633
645
|
const cache = this._caches[key];
|
|
634
646
|
if (cache == null) continue;
|
|
647
|
+
if (key === "aheadOfBaseConfigKey" || key === "gitResults") {
|
|
648
|
+
cache.delete(repoPath);
|
|
649
|
+
if (key === "gitResults" && isLastWorktree && repoPath !== commonPath) cache.delete(commonPath);
|
|
650
|
+
continue;
|
|
651
|
+
}
|
|
635
652
|
const invalidate = cache.invalidate;
|
|
636
653
|
const evict = typeof invalidate === "function" ? (k) => invalidate.call(cache, k) : (k) => cache.delete(k);
|
|
637
654
|
if (sharedCacheKeys.has(key)) {
|
|
@@ -687,7 +704,11 @@ var Cache = class Cache {
|
|
|
687
704
|
types.add("fileLog");
|
|
688
705
|
}
|
|
689
706
|
if (hasAny("index")) types.add("tracking");
|
|
690
|
-
if (hasAny("config"))
|
|
707
|
+
if (hasAny("config")) {
|
|
708
|
+
types.add("config");
|
|
709
|
+
types.add("branches");
|
|
710
|
+
types.add("worktrees");
|
|
711
|
+
}
|
|
691
712
|
if (hasAny("heads")) {
|
|
692
713
|
types.add("branches");
|
|
693
714
|
types.add("contributors");
|
|
@@ -1104,12 +1125,9 @@ var Cache = class Cache {
|
|
|
1104
1125
|
};
|
|
1105
1126
|
}, { cancellation });
|
|
1106
1127
|
}
|
|
1107
|
-
/**
|
|
1108
|
-
* The `getAheadOfBase` config snapshot, read once per commonPath for every worktree. Any config change hard-evicts
|
|
1109
|
-
* it (see {@link clearCaches}), so a read issued after the change never joins one that started before it.
|
|
1110
|
-
*/
|
|
1128
|
+
/** Config can differ by checkout through config.worktree and conditional includes. */
|
|
1111
1129
|
getAheadOfBaseConfigKey(repoPath, factory, cancellation) {
|
|
1112
|
-
return this.
|
|
1130
|
+
return this.aheadOfBaseConfigKey.getOrCreate(repoPath, (cacheable, signal) => Promise.resolve(factory(repoPath, cacheable, signal)), cancellation);
|
|
1113
1131
|
}
|
|
1114
1132
|
getBranchMetadataMap(repoPath, factory) {
|
|
1115
1133
|
return this.getSharedSimple(this.branchMetadataMap, repoPath, factory);
|