@gitkraken/core-gitlens 0.15.4 → 0.15.6

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/dist/git/cache.d.ts +9 -12
  3. package/dist/git/cache.js +34 -16
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/context.d.ts +19 -2
  6. package/dist/git/context.js.map +1 -1
  7. package/dist/git/providers/provider.d.ts +7 -0
  8. package/dist/git/service.d.ts +5 -1
  9. package/dist/git/service.js +8 -4
  10. package/dist/git/service.js.map +1 -1
  11. package/dist/git/watching/changeEvent.d.ts +25 -1
  12. package/dist/git/watching/changeEvent.js +36 -2
  13. package/dist/git/watching/changeEvent.js.map +1 -1
  14. package/dist/git/watching/configSections.d.ts +35 -0
  15. package/dist/git/watching/configSections.js +210 -0
  16. package/dist/git/watching/configSections.js.map +1 -0
  17. package/dist/git/watching/watchGroup.d.ts +36 -3
  18. package/dist/git/watching/watchGroup.js +107 -2
  19. package/dist/git/watching/watchGroup.js.map +1 -1
  20. package/dist/git/watching/watchService.d.ts +14 -3
  21. package/dist/git/watching/watchService.js +10 -7
  22. package/dist/git/watching/watchService.js.map +1 -1
  23. package/dist/git/watching/watchSession.d.ts +52 -21
  24. package/dist/git/watching/watchSession.js +164 -42
  25. package/dist/git/watching/watchSession.js.map +1 -1
  26. package/dist/git/watching/worktreeSummary.d.ts +9 -7
  27. package/dist/git/watching/worktreeSummary.js +21 -10
  28. package/dist/git/watching/worktreeSummary.js.map +1 -1
  29. package/dist/git-cli/cliGitProvider.d.ts +6 -1
  30. package/dist/git-cli/cliGitProvider.js +45 -5
  31. package/dist/git-cli/cliGitProvider.js.map +1 -1
  32. package/dist/git-cli/providers/branches.d.ts +2 -2
  33. package/dist/git-cli/providers/branches.js +17 -15
  34. package/dist/git-cli/providers/branches.js.map +1 -1
  35. package/dist/git-cli/providers/config.d.ts +13 -0
  36. package/dist/git-cli/providers/config.js +38 -1
  37. package/dist/git-cli/providers/config.js.map +1 -1
  38. package/dist/git-cli/providers/operations.d.ts +35 -1
  39. package/dist/git-cli/providers/operations.js +175 -16
  40. package/dist/git-cli/providers/operations.js.map +1 -1
  41. package/dist/git-cli/providers/stash.d.ts +1 -0
  42. package/dist/git-cli/providers/stash.js +9 -3
  43. package/dist/git-cli/providers/stash.js.map +1 -1
  44. package/dist/git-cli/providers/worktrees.js +11 -4
  45. package/dist/git-cli/providers/worktrees.js.map +1 -1
  46. package/dist/git-cli/service.js +5 -1
  47. package/dist/git-cli/service.js.map +1 -1
  48. package/dist/plus/integrations/collectionMetadata.js +4 -2
  49. package/dist/plus/integrations/collectionMetadata.js.map +1 -1
  50. package/dist/plus/integrations/providers/issueSorts.d.ts +0 -1
  51. package/dist/plus/integrations/providers/providerErrors.d.ts +22 -0
  52. package/dist/plus/integrations/providers/providerErrors.js +43 -2
  53. package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
  54. package/dist/plus/integrations/providers/providersApi.js +12 -8
  55. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  56. package/dist/plus/integrations/reads/drains.d.ts +0 -1
  57. package/dist/plus/integrations/results.d.ts +13 -3
  58. package/dist/plus/integrations/results.js +12 -2
  59. package/dist/plus/integrations/results.js.map +1 -1
  60. package/docs/integrations.md +14 -0
  61. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.15.6] - 2026-10-22
10
+
11
+ ### Fixed
12
+
13
+ - Fixes integration warnings carrying internal JavaScript error text (`response.body.map is not a function`, `Cannot read properties of undefined (reading 'id')`) when a provider answers a read with a 2xx whose JSON is not the shape the read expects, such as a gateway's JSON error on Jira Cloud's site list, Trello's boards or Linear's organization. The warning now reads "Expected data but the provider returned an unexpected response" and carries the new `cause.reason: 'unexpected-response'` on an `other` warning with `isAuth: false`; a scope failure of a fan-out core runs itself, such as Jira's per-site project reads, names the same cause. The read still fails as before, with the same `fetchFailed` and retry cursor, and the original error is logged. HTML pages, Linear GraphQL errors, transport failures and authentication, rate-limit and not-found failures keep their warnings ([#6046](https://github.com/gitkraken/vscode-gitlens/issues/6046)) (plus/integrations)
14
+
15
+ ## [0.15.5] - 2026-10-22
16
+
17
+ ### Added
18
+
19
+ - 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)
20
+
21
+ ### Changed
22
+
23
+ - 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)
24
+
25
+ ### Fixed
26
+
27
+ - 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.
28
+ - 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)
29
+ - 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)
30
+
9
31
  ## [0.15.4] - 2026-10-22
10
32
 
11
33
  ### Added
@@ -830,7 +852,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
830
852
 
831
853
  - 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
854
 
833
- [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.4...HEAD
855
+ [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.6...HEAD
856
+ [0.15.6]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.5...gitkraken:releases/core/v0.15.6
857
+ [0.15.5]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.4...gitkraken:releases/core/v0.15.5
834
858
  [0.15.4]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.3...gitkraken:releases/core/v0.15.4
835
859
  [0.15.3]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.2...gitkraken:releases/core/v0.15.3
836
860
  [0.15.2]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.15.1...gitkraken:releases/core/v0.15.2
@@ -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. The
242
- * shared commonPath entry in each shared cache is only evicted when unregistering the
243
- * last remaining worktree for that commonPath (otherwise siblings still depend on it).
244
- *
245
- * Uses soft-invalidate where supported so any in-flight factory/mapper keeps its abort
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
- * Cache eviction is a no-op if `repoPath` is not registered, but the status clock is advanced
251
- * unconditionally (a fresh registration must not let a post-reopen read join a pre-close one).
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
- * The `getAheadOfBase` config snapshot, read once per commonPath for every worktree. Any config change hard-evicts
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")) keysToClear.add("baseBranchName");
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) this.evictShared(key, repoPath, key === "aheadOfBaseConfigKey" ? "evict" : inFlight);
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. The
615
- * shared commonPath entry in each shared cache is only evicted when unregistering the
616
- * last remaining worktree for that commonPath (otherwise siblings still depend on it).
617
- *
618
- * Uses soft-invalidate where supported so any in-flight factory/mapper keeps its abort
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
- * Cache eviction is a no-op if `repoPath` is not registered, but the status clock is advanced
624
- * unconditionally (a fresh registration must not let a post-reopen read join a pre-close one).
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")) types.add("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.getSharedSimple(this.aheadOfBaseConfigKey, repoPath, factory, cancellation);
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);