@gitkraken/core-gitlens 0.69.0 → 0.70.1

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 (49) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/dist/git/cache.d.ts +9 -0
  3. package/dist/git/cache.js +14 -0
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/providers/diff.d.ts +10 -1
  6. package/dist/git/providers/status.d.ts +2 -0
  7. package/dist/git/service.d.ts +5 -1
  8. package/dist/git/service.js +8 -4
  9. package/dist/git/service.js.map +1 -1
  10. package/dist/git/watching/watchService.d.ts +7 -1
  11. package/dist/git/watching/watchService.js +17 -2
  12. package/dist/git/watching/watchService.js.map +1 -1
  13. package/dist/git/watching/worktreeSummary.d.ts +9 -0
  14. package/dist/git/watching/worktreeSummary.js +17 -5
  15. package/dist/git/watching/worktreeSummary.js.map +1 -1
  16. package/dist/git-cli/cliGitProvider.d.ts +8 -1
  17. package/dist/git-cli/cliGitProvider.js +14 -3
  18. package/dist/git-cli/cliGitProvider.js.map +1 -1
  19. package/dist/git-cli/exec/exec.d.ts +2 -2
  20. package/dist/git-cli/exec/exec.js +2 -2
  21. package/dist/git-cli/exec/git.js +4 -3
  22. package/dist/git-cli/exec/git.js.map +1 -1
  23. package/dist/git-cli/exec/indexRefresh.d.ts +38 -6
  24. package/dist/git-cli/exec/indexRefresh.js +84 -3
  25. package/dist/git-cli/exec/indexRefresh.js.map +1 -1
  26. package/dist/git-cli/providers/diff.d.ts +4 -1
  27. package/dist/git-cli/providers/diff.js +17 -1
  28. package/dist/git-cli/providers/diff.js.map +1 -1
  29. package/dist/git-cli/providers/status.d.ts +4 -0
  30. package/dist/git-cli/providers/status.js +114 -16
  31. package/dist/git-cli/providers/status.js.map +1 -1
  32. package/dist/git-cli/service.d.ts +13 -1
  33. package/dist/git-cli/service.js +3 -0
  34. package/dist/git-cli/service.js.map +1 -1
  35. package/dist/plus/integrations/models/publicIntegration.d.ts +0 -1
  36. package/dist/plus/integrations/providers/issueSorts.d.ts +0 -1
  37. package/dist/plus/integrations/reads/drains.d.ts +0 -1
  38. package/dist/utils/env/browser/platform.d.ts +1 -0
  39. package/dist/utils/env/browser/platform.js +4 -1
  40. package/dist/utils/env/browser/platform.js.map +1 -1
  41. package/dist/utils/env/node/exec.d.ts +1 -0
  42. package/dist/utils/env/node/exec.js +9 -3
  43. package/dist/utils/env/node/exec.js.map +1 -1
  44. package/dist/utils/env/node/platform.d.ts +1 -0
  45. package/dist/utils/env/node/platform.js +4 -1
  46. package/dist/utils/env/node/platform.js.map +1 -1
  47. package/dist/utils/platform.d.ts +2 -2
  48. package/dist/utils/platform.js +2 -2
  49. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.70.1] - 2026-12-05
10
+
11
+ ### Fixed
12
+
13
+ - Fixes `getStatus` with `reuseGeneration` returning an outdated status, possibly forever, for a checkout nothing watches, since nothing advances its status generation. It now reuses a read only while the checkout's working tree and git directory are reliably watched, as answered by the new `Cache.setStatusReuseGate`, which `createCliGitService` sets from the new `WatchService.isWorkingTreeWatched`; with no gate set it always reads. A checkout watched again advances its status generation, so a status read before the gap isn't reused after it: `onDidChangeWorkingTree` also fires as a working tree's watch goes live and reliable (git, git-cli)
14
+
15
+ ## [0.70.0] - 2026-12-05
16
+
17
+ ### Added
18
+
19
+ - Adds `reuseGeneration?: boolean` to `getStatus`. With it, a read answers without running git from one with the same options, also made with it, that already settled in the current status generation. Without it, reads stay point-in-time. It is meant for callers the watcher drives, since the watcher advances the generation on every working-tree change (git, git-cli)
20
+ - Adds `summaryDirtyFromStatus` to `createCliGitService` (and `dirtyFromStatus` to `WorktreeSummaryServiceOptions`). With it, a subscribed worktree's summary reads its dirty flag with `git status --porcelain=v2 -unormal` (through `getStatus` with `reuseGeneration`), not `git diff --quiet HEAD` plus `ls-files --others`. A host that also calls `getStatus({ untracked: 'normal', reuseGeneration: true })` on each working-tree change then costs one status per change instead of two reads; on a 13k-file checkout the dirty re-read was a third of all git processes per change. Off by default, since a full status costs more than the early-exiting `git diff --quiet` unless the host shares it. With it, a submodule holding only untracked files makes a subscribed summary dirty, as `git status` reports it (git, git-cli)
21
+ - Adds `getChangedFilesCountByCommit(repoPath, shas, options?: { priority }, cancellation?)` to the diff provider: each commit's `--shortstat` against its first parent for many commits in one `git log` process, where `getChangedFilesCount` runs one `git diff` per commit (git, git-cli)
22
+
23
+ ### Changed
24
+
25
+ - `refreshIndexAfterWrites` now also refreshes a checkout's index when a `getStatus` read of the whole checkout finds entries git had to re-check, as git's trace2 output (`refresh/sum_lstat`) reports, beyond the files the status lists as changed in the working tree. This covers git run outside core, such as a `git worktree add` or `git checkout` from a terminal or an agent, which left status and diff reads at 350–620 ms on an 11.7k-file checkout until something rewrote the index; after a refresh they take ~10 ms. A read of a healthy index schedules none, so an outside `git add` or `git commit` costs a refresh only when it left entries git can't trust. Such a refresh waits until the checkout has had no such read for 2 seconds, runs at most once per checkout per 10 seconds, is skipped while a rebase, merge, cherry-pick or revert is paused, and, while reads find no more entries than it last ran for, is retried only after 30 seconds, doubling with each such refresh up to 30 minutes until a read finds none, so a refresh that failed or found the index locked still gets another try while entries no refresh clears, such as each clean submodule's, cost one twice an hour at most. A checkout with fewer than 1000 index entries, or with `core.preloadIndex` off, gets none (git-cli)
26
+
9
27
  ## [0.69.0] - 2026-12-05
10
28
 
11
29
  ### Added
@@ -1634,7 +1652,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1634
1652
 
1635
1653
  - 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.
1636
1654
 
1637
- [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.64.1...core
1655
+ [unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.70.1...core
1656
+ [0.70.1]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.70.0..releases/core/v0.70.1
1657
+ [0.70.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.69.0..releases/core/v0.70.0
1658
+ [0.69.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.68.0..releases/core/v0.69.0
1659
+ [0.68.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.67.0..releases/core/v0.68.0
1660
+ [0.67.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.66.0..releases/core/v0.67.0
1661
+ [0.66.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.65.0..releases/core/v0.66.0
1662
+ [0.65.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.64.1..releases/core/v0.65.0
1638
1663
  [0.64.1]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.64.0..releases/core/v0.64.1
1639
1664
  [0.64.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.63.0..releases/core/v0.64.0
1640
1665
  [0.63.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.62.0..releases/core/v0.63.0
@@ -209,6 +209,7 @@ export declare class Cache implements Disposable {
209
209
  private _readValidator;
210
210
  /** What the read validator reports among {@link getResourceUsage}'s */
211
211
  private _readValidatorUsage;
212
+ private _statusReuseGate;
212
213
  /** Asked to register a checkout before its first read (see {@link setRepoPathRegistrar}) */
213
214
  private _repoPathRegistrar;
214
215
  /**
@@ -231,6 +232,14 @@ export declare class Cache implements Disposable {
231
232
  * costs among {@link getResourceUsage}'s.
232
233
  */
233
234
  setReadValidator(validator: ((repoPath: string) => Promise<void> | undefined) | undefined, getResourceUsage?: () => ResourceUsage): void;
235
+ /**
236
+ * Registers what answers whether a checkout's status clock advances on every change to it, so a `reuseGeneration`
237
+ * status read can be answered from an earlier one (see {@link canReuseStatus}). `undefined` removes it. Kept across
238
+ * {@link reset}: it is host wiring, not cached state.
239
+ */
240
+ setStatusReuseGate(gate: ((repoPath: string) => boolean) | undefined): void;
241
+ /** Whether a `reuseGeneration` status read of `repoPath` may reuse a settled one; `false` with no gate set */
242
+ canReuseStatus(repoPath: string): boolean;
234
243
  /** Whether a read validator is set (see {@link setReadValidator}), so the host keeps the caches it covers current */
235
244
  get readsAreValidated(): boolean;
236
245
  /**
package/dist/git/cache.js CHANGED
@@ -337,6 +337,7 @@ var Cache = class Cache {
337
337
  _readValidator;
338
338
  /** What the read validator reports among {@link getResourceUsage}'s */
339
339
  _readValidatorUsage;
340
+ _statusReuseGate;
340
341
  /** Asked to register a checkout before its first read (see {@link setRepoPathRegistrar}) */
341
342
  _repoPathRegistrar;
342
343
  /**
@@ -351,6 +352,7 @@ var Cache = class Cache {
351
352
  this.reset();
352
353
  this._readValidator = void 0;
353
354
  this._readValidatorUsage = void 0;
355
+ this._statusReuseGate = void 0;
354
356
  this._repoPathRegistrar = void 0;
355
357
  this._onDidChangeMergeTargets.dispose();
356
358
  this._onDidUnregisterRepoPath.dispose();
@@ -372,6 +374,18 @@ var Cache = class Cache {
372
374
  this._readValidator = validator;
373
375
  this._readValidatorUsage = validator != null ? getResourceUsage : void 0;
374
376
  }
377
+ /**
378
+ * Registers what answers whether a checkout's status clock advances on every change to it, so a `reuseGeneration`
379
+ * status read can be answered from an earlier one (see {@link canReuseStatus}). `undefined` removes it. Kept across
380
+ * {@link reset}: it is host wiring, not cached state.
381
+ */
382
+ setStatusReuseGate(gate) {
383
+ this._statusReuseGate = gate;
384
+ }
385
+ /** Whether a `reuseGeneration` status read of `repoPath` may reuse a settled one; `false` with no gate set */
386
+ canReuseStatus(repoPath) {
387
+ return this._statusReuseGate?.(repoPath) ?? false;
388
+ }
375
389
  /** Whether a read validator is set (see {@link setReadValidator}), so the host keeps the caches it covers current */
376
390
  get readsAreValidated() {
377
391
  return this._readValidator != null;