@gitkraken/core-gitlens 0.4.101 → 0.5.101
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 +29 -6
- package/dist/git/models/graph.d.ts +63 -33
- package/dist/git/models/graph.d.ts.map +1 -1
- package/dist/git/models/graph.js.map +1 -1
- package/dist/git/models/graphSession.d.ts +3 -84
- package/dist/git/models/graphSession.d.ts.map +1 -1
- package/dist/git/models/graphSession.js +1 -6
- package/dist/git/models/graphSession.js.map +1 -1
- package/dist/git/models/issue.d.ts +4 -3
- package/dist/git/models/issue.d.ts.map +1 -1
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/providers/graph.d.ts +1 -15
- package/dist/git/providers/graph.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts +2 -0
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.js +8 -6
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/git/utils/reachability.utils.d.ts +1 -1
- package/dist/git/utils/reachability.utils.js +1 -1
- package/dist/git/utils/remote.utils.d.ts +3 -0
- package/dist/git/utils/remote.utils.d.ts.map +1 -1
- package/dist/git/utils/remote.utils.js +5 -0
- package/dist/git/utils/remote.utils.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +1 -3
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +37 -214
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +1 -0
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +21 -1
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts.map +1 -1
- package/dist/git-cli/providers/staging.js +10 -1
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +18 -5
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +6 -4
- package/dist/plus/git-github/models.d.ts.map +1 -1
- package/dist/plus/git-github/models.js +19 -26
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/git-github/providers/github/graph.d.ts +1 -3
- package/dist/plus/git-github/providers/github/graph.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/graph.js +8 -10
- package/dist/plus/git-github/providers/github/graph.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +38 -48
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +22 -5
- package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts +39 -0
- package/dist/plus/integrations/authentication/rejectedTokenTracker.d.ts.map +1 -0
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js +53 -0
- package/dist/plus/integrations/authentication/rejectedTokenTracker.js.map +1 -0
- package/dist/plus/integrations/collectionMetadata.d.ts +21 -1
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -1
- package/dist/plus/integrations/collectionMetadata.js +82 -6
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +3 -3
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js +19 -3
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +19 -6
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +20 -0
- package/dist/plus/integrations/models/integration.d.ts.map +1 -1
- package/dist/plus/integrations/models/integration.js +64 -6
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js +5 -5
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +1 -0
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
- package/dist/plus/integrations/providers/providersApi.js +4 -2
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +2 -0
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -1
- package/dist/plus/integrations/providers/trello.js +1 -1
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +4 -2
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js +34 -22
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +4 -2
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -1
- package/dist/plus/integrations/reads/warnings.js +4 -2
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +5 -3
- package/dist/utils/date.js.map +1 -1
- package/package.json +2 -2
- package/src/git/models/graph.ts +59 -41
- package/src/git/models/graphSession.ts +3 -106
- package/src/git/models/issue.ts +3 -2
- package/src/git/providers/graph.ts +1 -15
- package/src/git/providers/pausedOperations.ts +8 -1
- package/src/git/utils/issue.utils.ts +9 -6
- package/src/git/utils/reachability.utils.ts +1 -1
- package/src/git/utils/remote.utils.ts +6 -0
- package/src/git-cli/providers/graph.ts +37 -250
- package/src/git-cli/providers/pausedOperations.ts +29 -2
- package/src/git-cli/providers/staging.ts +8 -1
- package/src/plus/git-github/api/github.ts +19 -9
- package/src/plus/git-github/models.ts +27 -31
- package/src/plus/git-github/providers/github/graph.ts +8 -15
- package/src/plus/integrations/authentication/integrationAuthenticationProvider.ts +62 -40
- package/src/plus/integrations/authentication/rejectedTokenTracker.ts +56 -0
- package/src/plus/integrations/collectionMetadata.ts +97 -7
- package/src/plus/integrations/integrationService.ts +37 -9
- package/src/plus/integrations/models/gitHostIntegration.ts +19 -6
- package/src/plus/integrations/models/integration.ts +71 -7
- package/src/plus/integrations/models/issuesIntegration.ts +5 -5
- package/src/plus/integrations/providers/models.ts +4 -1
- package/src/plus/integrations/providers/providersApi.ts +6 -10
- package/src/plus/integrations/providers/trello.ts +3 -2
- package/src/plus/integrations/providers/utils/providerPaging.ts +46 -24
- package/src/plus/integrations/reads/warnings.ts +4 -2
- package/src/utils/date.ts +6 -3
|
@@ -2,6 +2,9 @@ import type { GitRemote } from '../models/remote.js';
|
|
|
2
2
|
import type { RemoteProvider } from '../models/remoteProvider.js';
|
|
3
3
|
import type { RemoteResource } from '../models/remoteResource.js';
|
|
4
4
|
export declare function getDefaultRemoteOrHighlander<T extends GitRemote>(remotes: T[]): T | undefined;
|
|
5
|
+
/** Like {@link getDefaultRemoteOrHighlander}, but falls back to `origin` when no remote is designated
|
|
6
|
+
* default — otherwise features keyed on "the default remote" silently do nothing on multi-remote repos */
|
|
7
|
+
export declare function getDefaultRemoteOrOrigin<T extends GitRemote>(remotes: T[]): T | undefined;
|
|
5
8
|
export declare function getHighlanderProviderName(remotes: GitRemote<RemoteProvider>[]): string | undefined;
|
|
6
9
|
export declare function getHighlanderProviders(remotes: GitRemote<RemoteProvider>[]): RemoteProvider[] | undefined;
|
|
7
10
|
export declare function getRemoteArrowsGlyph(remote: GitRemote): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.utils.d.ts","sourceRoot":"","sources":["../../../src/git/utils/remote.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAA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AE,cAAc,GAAG,MAAM,CAqB1E"}
|
|
@@ -2,6 +2,11 @@ import { RemoteResourceType } from '../models/remoteResource.js';
|
|
|
2
2
|
export function getDefaultRemoteOrHighlander(remotes) {
|
|
3
3
|
return remotes.length === 1 ? remotes[0] : remotes.find(r => r.default);
|
|
4
4
|
}
|
|
5
|
+
/** Like {@link getDefaultRemoteOrHighlander}, but falls back to `origin` when no remote is designated
|
|
6
|
+
* default — otherwise features keyed on "the default remote" silently do nothing on multi-remote repos */
|
|
7
|
+
export function getDefaultRemoteOrOrigin(remotes) {
|
|
8
|
+
return getDefaultRemoteOrHighlander(remotes) ?? remotes.find(r => r.name === 'origin');
|
|
9
|
+
}
|
|
5
10
|
export function getHighlanderProviderName(remotes) {
|
|
6
11
|
if (remotes.length === 0)
|
|
7
12
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.utils.js","sourceRoot":"","sources":["../../../src/git/utils/remote.utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,UAAU,4BAA4B,CAAsB,OAAY;IAC7E,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,OAAoC;IAC7E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IACrD,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEhD,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC9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
2
2
|
import type { GitServiceContext } from '../../git/context.js';
|
|
3
3
|
import type { GitGraph, GitGraphRowsStats, GraphIncrementalSeed, GraphReachabilityTable, GraphRowProcessor, IncrementalGraphOutcome } from '../../git/models/graph.js';
|
|
4
4
|
import type { GitGraphSearch, GitGraphSearchCursor, GitGraphSearchProgress, GitGraphSearchResults } from '../../git/models/graphSearch.js';
|
|
5
|
-
import type { GitGraphSession
|
|
5
|
+
import type { GitGraphSession } from '../../git/models/graphSession.js';
|
|
6
6
|
import type { SearchQuery } from '../../git/models/search.js';
|
|
7
7
|
import type { GitGraphSubProvider } from '../../git/providers/graph.js';
|
|
8
8
|
import type { CliGitProviderInternal } from '../cliGitProvider.js';
|
|
@@ -39,8 +39,6 @@ export declare class GraphGitSubProvider implements GitGraphSubProvider {
|
|
|
39
39
|
include?: {
|
|
40
40
|
stats?: boolean;
|
|
41
41
|
};
|
|
42
|
-
restore?: GitGraphSessionSnapshot;
|
|
43
|
-
onRestore?: (result: GraphSessionRestoreResult) => void;
|
|
44
42
|
}, cancellation?: AbortSignal): Promise<GitGraphSession>;
|
|
45
43
|
getGraph(repoPath: string, rev: string | undefined, options?: {
|
|
46
44
|
include?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/git-cli/providers/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,OAAO,KAAK,EACX,QAAQ,EAIR,iBAAiB,EAIjB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EAEjB,uBAAuB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACX,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EAEtB,qBAAqB,EACrB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRo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e;CAwR9B"}
|
|
@@ -57,7 +57,6 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
57
57
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
58
58
|
});
|
|
59
59
|
import { GitSearchError } from '../../git/errors.js';
|
|
60
|
-
import { graphSessionSnapshotVersion } from '../../git/models/graphSession.js';
|
|
61
60
|
import { getBranchId, getBranchNameWithoutRemote, getRemoteNameFromBranchName, } from '../../git/utils/branch.utils.js';
|
|
62
61
|
import { appendRowsAtCursor, mergeAvatarsForward } from '../../git/utils/graph.utils.js';
|
|
63
62
|
import { computeGraphRowContextFlags, createReachabilityTableBuilder } from '../../git/utils/reachability.utils.js';
|
|
@@ -180,108 +179,11 @@ function downstreamsChanged(prior, next) {
|
|
|
180
179
|
}
|
|
181
180
|
return false;
|
|
182
181
|
}
|
|
183
|
-
/**
|
|
184
|
-
* Cap on the number of window rows a {@link GraphSession.serialize} persists. A longer window persists only
|
|
185
|
-
* its TOP slice with `hasMore` forced true (restore then behaves as a shorter loaded window — the bottom
|
|
186
|
-
* re-pages on demand). Pragmatic: generous enough that a typical session restores its whole window, bounded
|
|
187
|
-
* enough that the JSON file stays sub-MB-class (rows are a few hundred bytes each).
|
|
188
|
-
*/
|
|
189
|
-
const maxPersistedGraphRows = 2000;
|
|
190
182
|
/** The walk-shape key (`ordering|onlyFollowFirstParent`) an incremental seed is gated on — one builder so the
|
|
191
|
-
*
|
|
183
|
+
* refresh/rebuild sites can't drift in how they stringify it. */
|
|
192
184
|
function buildShapeKey(shape) {
|
|
193
185
|
return `${shape.ordering}|${shape.onlyFollowFirstParent}`;
|
|
194
186
|
}
|
|
195
|
-
/**
|
|
196
|
-
* Validates a persisted {@link GitGraphSessionSnapshot} structurally before it's trusted to seed a restore.
|
|
197
|
-
* Returns the discard reason on any failure (→ the caller ignores the snapshot and does a normal initial
|
|
198
|
-
* walk), or `undefined` when it's coherent. Never throws — a corrupt/adversarial cache must degrade to a
|
|
199
|
-
* full walk, never crash the open. Deep validation (does the cache match current git?) is NOT done here:
|
|
200
|
-
* that's the restore's immediate refresh, which reconciles a stale-but-valid snapshot against ground truth.
|
|
201
|
-
*/
|
|
202
|
-
function validateGraphSnapshot(snapshot, repoPath, currentBuildShape) {
|
|
203
|
-
if (snapshot.v !== graphSessionSnapshotVersion)
|
|
204
|
-
return 'schema';
|
|
205
|
-
if (snapshot.repoPath !== repoPath)
|
|
206
|
-
return 'repo-path';
|
|
207
|
-
// A shape change reshapes every row's parents/order — the cached rows can't be reused.
|
|
208
|
-
if (snapshot.buildShape !== currentBuildShape)
|
|
209
|
-
return 'shape';
|
|
210
|
-
if (!Array.isArray(snapshot.rows) || snapshot.rows.length === 0)
|
|
211
|
-
return 'empty';
|
|
212
|
-
if (!Array.isArray(snapshot.refTips) ||
|
|
213
|
-
snapshot.refTips.some(t => !Array.isArray(t) || t.length !== 2 || typeof t[0] !== 'string' || typeof t[1] !== 'string')) {
|
|
214
|
-
return 'tips';
|
|
215
|
-
}
|
|
216
|
-
// Each row must be structurally sane — a corrupt row poisons the seed / stitch math. Duplicate shas break
|
|
217
|
-
// the ids set / stitch dedup (they'd re-appear as "already seen"), so reject them too.
|
|
218
|
-
const seenShas = new Set();
|
|
219
|
-
for (const row of snapshot.rows) {
|
|
220
|
-
if (row == null || typeof row.sha !== 'string' || !Array.isArray(row.parents) || typeof row.date !== 'number') {
|
|
221
|
-
return 'rows';
|
|
222
|
-
}
|
|
223
|
-
if (seenShas.has(row.sha))
|
|
224
|
-
return 'rows';
|
|
225
|
-
seenShas.add(row.sha);
|
|
226
|
-
}
|
|
227
|
-
// Every row's `reachabilityIndex` must be a valid index into the table's `sets` (the decode reads it
|
|
228
|
-
// directly). Guards against a truncated table / mismatched pairing.
|
|
229
|
-
const reachability = snapshot.reachability;
|
|
230
|
-
if (reachability != null && (!Array.isArray(reachability.sets) || !Array.isArray(reachability.dictionary))) {
|
|
231
|
-
return 'reachability';
|
|
232
|
-
}
|
|
233
|
-
const setCount = reachability?.sets?.length ?? 0;
|
|
234
|
-
for (const row of snapshot.rows) {
|
|
235
|
-
const index = row.contexts?.reachabilityIndex;
|
|
236
|
-
if (index != null && (!Number.isInteger(index) || index < 0 || index >= setCount))
|
|
237
|
-
return 'reachability';
|
|
238
|
-
}
|
|
239
|
-
// Downstreams must be `[upstream name, tracking branch names]` entries (reconstructed into a Map on restore).
|
|
240
|
-
if (!Array.isArray(snapshot.downstreams) ||
|
|
241
|
-
snapshot.downstreams.some(d => !Array.isArray(d) || d.length !== 2 || typeof d[0] !== 'string' || !Array.isArray(d[1]))) {
|
|
242
|
-
return 'downstreams';
|
|
243
|
-
}
|
|
244
|
-
// Per-sha stats, when present, must be `[sha, stats-object]` entries (reconstructed into a Map on restore).
|
|
245
|
-
if (snapshot.rowsStats != null &&
|
|
246
|
-
(!Array.isArray(snapshot.rowsStats) ||
|
|
247
|
-
snapshot.rowsStats.some(s => !Array.isArray(s) ||
|
|
248
|
-
s.length !== 2 ||
|
|
249
|
-
typeof s[0] !== 'string' ||
|
|
250
|
-
typeof s[1] !== 'object' ||
|
|
251
|
-
s[1] == null))) {
|
|
252
|
-
return 'rowsStats';
|
|
253
|
-
}
|
|
254
|
-
return undefined;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Reconstruct a persisted snapshot into the synthetic `GitGraph` a {@link GraphSession.restore} hands to its
|
|
258
|
-
* immediate refresh as the PRIOR generation — carrying exactly the fields the refresh's seed construction +
|
|
259
|
-
* change-diffing read (`refTips`, `reachability`, `rowsStats`, `downstreams`, `paging.hasMore`). Avatars are
|
|
260
|
-
* deliberately empty: resolved avatar URLs are webview-instance-bound and don't survive a restart, so the
|
|
261
|
-
* refresh re-derives them (and the write-once merge over an empty prior map is a no-op). The side-queried
|
|
262
|
-
* collections (`branches`/`remotes`/`stashes`/`worktrees`) aren't read by the refresh, so they're left empty.
|
|
263
|
-
*/
|
|
264
|
-
function buildRestoredGraph(snapshot) {
|
|
265
|
-
return {
|
|
266
|
-
repoPath: snapshot.repoPath,
|
|
267
|
-
avatars: new Map(),
|
|
268
|
-
ids: new Set(snapshot.rows.map(r => r.sha)),
|
|
269
|
-
includes: snapshot.includesStats ? { stats: true } : undefined,
|
|
270
|
-
branches: new Map(),
|
|
271
|
-
remotes: new Map(),
|
|
272
|
-
downstreams: new Map(snapshot.downstreams),
|
|
273
|
-
stashes: undefined,
|
|
274
|
-
worktrees: undefined,
|
|
275
|
-
worktreesByBranch: undefined,
|
|
276
|
-
reachability: snapshot.reachability,
|
|
277
|
-
refTips: new Map(snapshot.refTips),
|
|
278
|
-
decorationFingerprint: snapshot.decorationFingerprint,
|
|
279
|
-
shallow: snapshot.shallow,
|
|
280
|
-
rows: snapshot.rows,
|
|
281
|
-
rowsStats: snapshot.rowsStats != null ? new Map(snapshot.rowsStats) : undefined,
|
|
282
|
-
paging: { limit: snapshot.rows.length, startingCursor: undefined, hasMore: snapshot.hasMore },
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
187
|
export class GraphGitSubProvider {
|
|
286
188
|
context;
|
|
287
189
|
git;
|
|
@@ -341,31 +243,6 @@ export class GraphGitSubProvider {
|
|
|
341
243
|
};
|
|
342
244
|
};
|
|
343
245
|
const session = new GraphSession(this, repoPath, options?.rowProcessor, getWalkShape);
|
|
344
|
-
// R7c restart persistence: seed from a persisted snapshot when it's structurally valid for THIS repo +
|
|
345
|
-
// walk shape, then immediately refresh (the snapshot is exactly an R6 seed — enumeration + the tip/FF/
|
|
346
|
-
// stash gates reconcile a stale one). Any validation failure discards it and falls through to a normal
|
|
347
|
-
// initial walk. Never trusted over git.
|
|
348
|
-
const restore = options?.restore;
|
|
349
|
-
if (restore != null) {
|
|
350
|
-
const shape = getWalkShape();
|
|
351
|
-
const reason = validateGraphSnapshot(restore, repoPath, buildShapeKey(shape));
|
|
352
|
-
if (reason == null) {
|
|
353
|
-
try {
|
|
354
|
-
const refresh = await session.restore(restore, options, cancellation);
|
|
355
|
-
options?.onRestore?.({ restored: true, rows: restore.rows.length, refresh: refresh });
|
|
356
|
-
return session;
|
|
357
|
-
}
|
|
358
|
-
catch {
|
|
359
|
-
// Belt-and-suspenders: structural validation can't catch a snapshot that reconstructs but
|
|
360
|
-
// throws in the restore's refresh (e.g. a garbage rev its enumerate chokes on). A corrupt
|
|
361
|
-
// cache must degrade to a full walk, never crash the open — report a miss and fall through.
|
|
362
|
-
options?.onRestore?.({ restored: false, reason: 'corrupt' });
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
options?.onRestore?.({ restored: false, reason: reason });
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
246
|
await session.initialize(options, cancellation);
|
|
370
247
|
return session;
|
|
371
248
|
}
|
|
@@ -641,6 +518,9 @@ export class GraphGitSubProvider {
|
|
|
641
518
|
// `defaultLocalName!` is non-null here because `tip === defaultBranchName` short-circuits when `defaultBranchName` is null.
|
|
642
519
|
isDefault: tip === defaultBranchName && !branchMap.has(defaultLocalName),
|
|
643
520
|
hostingServiceType: remote.provider?.gkProviderId,
|
|
521
|
+
// `branchMap` is keyed by full name, so the remote ref resolves here — the same
|
|
522
|
+
// lookup the host does today to bake `+starred` into the context string.
|
|
523
|
+
starred: branchMap.get(tip)?.starred || undefined,
|
|
644
524
|
});
|
|
645
525
|
continue;
|
|
646
526
|
}
|
|
@@ -651,18 +531,30 @@ export class GraphGitSubProvider {
|
|
|
651
531
|
const worktree = worktreesByBranch?.get(branchId) ??
|
|
652
532
|
(branchId === branchIdOfMainWorktree ? mainWorktree : undefined);
|
|
653
533
|
const worktreeRef = worktree != null
|
|
654
|
-
? {
|
|
534
|
+
? {
|
|
535
|
+
id: getWorktreeId(repoPath, worktree.name),
|
|
536
|
+
path: worktree.path,
|
|
537
|
+
isDefault: worktree.isDefault === true,
|
|
538
|
+
}
|
|
655
539
|
: undefined;
|
|
656
540
|
refHeads.push({
|
|
657
541
|
id: branchId,
|
|
658
542
|
name: tip,
|
|
659
543
|
isCurrentHead: head,
|
|
660
544
|
upstream: branch?.upstream != null
|
|
661
|
-
? {
|
|
545
|
+
? {
|
|
546
|
+
name: branch.upstream.name,
|
|
547
|
+
id: getBranchId(repoPath, true, branch.upstream.name),
|
|
548
|
+
missing: branch.upstream.missing,
|
|
549
|
+
state: {
|
|
550
|
+
ahead: branch.upstream.state.ahead,
|
|
551
|
+
behind: branch.upstream.state.behind,
|
|
552
|
+
},
|
|
553
|
+
}
|
|
662
554
|
: undefined,
|
|
663
555
|
worktree: worktreeRef,
|
|
664
|
-
worktreeId: worktree?.isDefault === false ? worktreeRef?.id : undefined,
|
|
665
556
|
isDefault: defaultLocalName != null && tip === defaultLocalName,
|
|
557
|
+
starred: branch?.starred || undefined,
|
|
666
558
|
});
|
|
667
559
|
}
|
|
668
560
|
}
|
|
@@ -679,10 +571,11 @@ export class GraphGitSubProvider {
|
|
|
679
571
|
date: Number(ordering === 'author-date' ? commit.authorDate : commit.committerDate) * 1000,
|
|
680
572
|
commitDate: Number(commit.committerDate) * 1000,
|
|
681
573
|
message: (stash.message ?? commit.message).trim(),
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
574
|
+
kind: 'stash',
|
|
575
|
+
stashNumber: stash.stashNumber,
|
|
576
|
+
heads: refHeads.length ? refHeads : undefined,
|
|
577
|
+
remotes: refRemoteHeads.length ? refRemoteHeads : undefined,
|
|
578
|
+
tags: refTags.length ? refTags : undefined,
|
|
686
579
|
isCurrentUser: true,
|
|
687
580
|
};
|
|
688
581
|
// Don't seed `rowStats` from `stash.stats` here: the graph's stash list is fetched with
|
|
@@ -700,10 +593,10 @@ export class GraphGitSubProvider {
|
|
|
700
593
|
date: Number(ordering === 'author-date' ? commit.authorDate : commit.committerDate) * 1000,
|
|
701
594
|
commitDate: Number(commit.committerDate) * 1000,
|
|
702
595
|
message: commit.message.trim(),
|
|
703
|
-
|
|
704
|
-
heads: refHeads,
|
|
705
|
-
remotes: refRemoteHeads,
|
|
706
|
-
tags: refTags,
|
|
596
|
+
kind: parents.length > 1 ? 'merge' : 'commit',
|
|
597
|
+
heads: refHeads.length ? refHeads : undefined,
|
|
598
|
+
remotes: refRemoteHeads.length ? refRemoteHeads : undefined,
|
|
599
|
+
tags: refTags.length ? refTags : undefined,
|
|
707
600
|
isCurrentUser: isCurrentUser || undefined,
|
|
708
601
|
};
|
|
709
602
|
if (commit.stats != null) {
|
|
@@ -843,7 +736,7 @@ export class GraphGitSubProvider {
|
|
|
843
736
|
rowStats.set(row.sha, seeded);
|
|
844
737
|
continue;
|
|
845
738
|
}
|
|
846
|
-
if (row.
|
|
739
|
+
if (row.kind === 'stash') {
|
|
847
740
|
missingStashStdin += `${row.sha}\n`;
|
|
848
741
|
}
|
|
849
742
|
else {
|
|
@@ -975,7 +868,7 @@ export class GraphGitSubProvider {
|
|
|
975
868
|
if (built == null)
|
|
976
869
|
continue; // remapped-stash dedup
|
|
977
870
|
const { row, refHeads, refRemoteHeads, refTags, head, parents } = built;
|
|
978
|
-
const refs = accumulateRowState(row.sha, parents, refHeads, refRemoteHeads, refTags, head, row.
|
|
871
|
+
const refs = accumulateRowState(row.sha, parents, refHeads, refRemoteHeads, refTags, head, row.kind === 'stash');
|
|
979
872
|
// Transient: the row processor's `+unique` decision reads this; stripped by finalize.
|
|
980
873
|
// Unsorted (the consumer re-sorts after decoding) — order doesn't affect interning.
|
|
981
874
|
row.reachability = refs?.size ? { partial: true, refs: [...refs.values()] } : undefined;
|
|
@@ -1189,7 +1082,7 @@ export class GraphGitSubProvider {
|
|
|
1189
1082
|
}
|
|
1190
1083
|
// Stash-set gate: any push/pop/drop changes the injected rows.
|
|
1191
1084
|
const currentStashShas = gitStash?.stashes != null ? new Set(gitStash.stashes.keys()) : new Set();
|
|
1192
|
-
const priorStashShas = seed.rows.filter(r => r.
|
|
1085
|
+
const priorStashShas = seed.rows.filter(r => r.kind === 'stash').map(r => r.sha);
|
|
1193
1086
|
if (priorStashShas.length !== currentStashShas.size || priorStashShas.some(s => !currentStashShas.has(s))) {
|
|
1194
1087
|
fallback('stash-changed');
|
|
1195
1088
|
return undefined;
|
|
@@ -1198,9 +1091,9 @@ export class GraphGitSubProvider {
|
|
|
1198
1091
|
// upstreams, worktree assignments, remote urls/providers, current user) that can change without
|
|
1199
1092
|
// moving any ref tip — e.g. `git remote set-head`, `branch --set-upstream-to`, `worktree add`.
|
|
1200
1093
|
// Reused rows keep their prior decorations (only flags/reachability are re-derived below), so ANY
|
|
1201
|
-
// change here must take the full walk that rebuilds them. An absent seed fingerprint
|
|
1202
|
-
//
|
|
1203
|
-
//
|
|
1094
|
+
// change here must take the full walk that rebuilds them. An absent seed fingerprint never matches —
|
|
1095
|
+
// safe full fallback. Deliberately LAST of the gates so the structural gates above keep their precise
|
|
1096
|
+
// reasons (a deleted tracking branch reports `ref-deleted`, not this).
|
|
1204
1097
|
if (seed.decorationFingerprint !== decorationFingerprint) {
|
|
1205
1098
|
fallback('metadata-changed');
|
|
1206
1099
|
return undefined;
|
|
@@ -1326,7 +1219,7 @@ export class GraphGitSubProvider {
|
|
|
1326
1219
|
for (const row of windowRows) {
|
|
1327
1220
|
ids.add(row.sha);
|
|
1328
1221
|
total++;
|
|
1329
|
-
const refs = accumulateRowState(row.sha, row.parents, row.heads ?? [], row.remotes ?? [], row.tags ?? [], row.sha === currentHeadSha, row.
|
|
1222
|
+
const refs = accumulateRowState(row.sha, row.parents, row.heads ?? [], row.remotes ?? [], row.tags ?? [], row.sha === currentHeadSha, row.kind === 'stash');
|
|
1330
1223
|
if (freshShas.has(row.sha)) {
|
|
1331
1224
|
// Fresh rows are raw — run the full processor (contexts, emojify, avatar). Reused rows keep
|
|
1332
1225
|
// their already-processed contexts/message; only their flags (below) are recomputed.
|
|
@@ -1335,7 +1228,7 @@ export class GraphGitSubProvider {
|
|
|
1335
1228
|
}
|
|
1336
1229
|
// Authoritative flags for every commit row (membership can shift on reused rows too — e.g. a new
|
|
1337
1230
|
// interior branch flips `+unique`). Stash rows carry none.
|
|
1338
|
-
if (row.
|
|
1231
|
+
if (row.kind !== 'stash') {
|
|
1339
1232
|
(row.contexts ??= {}).flags = computeGraphRowContextFlags(row.sha, refs?.values(), graphCtx);
|
|
1340
1233
|
}
|
|
1341
1234
|
finalizeRowReachability(row, row.sha, refs);
|
|
@@ -1750,32 +1643,6 @@ class GraphSession {
|
|
|
1750
1643
|
const graph = await this.provider.getGraph(this.repoPath, options?.rev, { include: options?.include, limit: options?.limit, rowProcessor: this.rowProcessor }, cancellation);
|
|
1751
1644
|
this.applyRebuild(graph, shape);
|
|
1752
1645
|
}
|
|
1753
|
-
/**
|
|
1754
|
-
* R7c restart persistence. Reconstruct the prior generation from a persisted snapshot as an R6 seed
|
|
1755
|
-
* WITHOUT any git (its window/tips/reachability/stats become this session's prior `current`/`window`/
|
|
1756
|
-
* `buildShape`), then IMMEDIATELY {@link refresh} to current truth — the enumeration + tip/FF/stash gates
|
|
1757
|
-
* reconcile a stale snapshot (fast when unchanged, a full walk on any structural change). The session
|
|
1758
|
-
* handed back is ALWAYS post-refresh; the raw snapshot is never surfaced. The caller has already validated
|
|
1759
|
-
* the snapshot structurally. Returns the refresh outcome so the caller can report the restore result.
|
|
1760
|
-
*/
|
|
1761
|
-
async restore(snapshot, options, cancellation) {
|
|
1762
|
-
this._window = snapshot.rows;
|
|
1763
|
-
this._buildShape = snapshot.buildShape;
|
|
1764
|
-
this._current = buildRestoredGraph(snapshot);
|
|
1765
|
-
// Anchor the re-walk on the window's BOTTOM commit so it spans the whole restored window (the host's
|
|
1766
|
-
// rebuild-anchor discipline), matching to at least the current limit so a since-grown repo still fills a
|
|
1767
|
-
// full page. Stash rows aren't real revs, so skip them when picking the anchor.
|
|
1768
|
-
let anchor;
|
|
1769
|
-
for (let i = snapshot.rows.length - 1; i >= 0; i--) {
|
|
1770
|
-
const type = snapshot.rows[i].type;
|
|
1771
|
-
if (type === 'commit-node' || type === 'merge-node') {
|
|
1772
|
-
anchor = snapshot.rows[i].sha;
|
|
1773
|
-
break;
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
const limit = Math.max(snapshot.rows.length, options?.limit ?? 0);
|
|
1777
|
-
return this.refresh({ rev: anchor, limit: limit, include: options?.include }, cancellation);
|
|
1778
|
-
}
|
|
1779
1646
|
async refresh(options, cancellation) {
|
|
1780
1647
|
const shape = this.getWalkShape();
|
|
1781
1648
|
const buildShape = buildShapeKey(shape);
|
|
@@ -1880,52 +1747,8 @@ class GraphSession {
|
|
|
1880
1747
|
this.applyPage(updated);
|
|
1881
1748
|
return true;
|
|
1882
1749
|
}
|
|
1883
|
-
serialize() {
|
|
1884
|
-
const current = this._current;
|
|
1885
|
-
// Nothing worth persisting: no window yet, no build shape recorded, or no ref tips (the restore's
|
|
1886
|
-
// tip-diff gate has nothing to diff — never true for the CLI provider, but guards a defensive future).
|
|
1887
|
-
if (this._window.length === 0 || this._buildShape == null || current?.refTips == null)
|
|
1888
|
-
return undefined;
|
|
1889
|
-
const [ordering, onlyFollowFirstParent] = this._buildShape.split('|');
|
|
1890
|
-
// Cap the persisted window to a bounded top slice; a longer window persists its top with `hasMore`
|
|
1891
|
-
// forced true (restore behaves as a shorter loaded window — the bottom re-pages on demand). Slicing
|
|
1892
|
-
// makes a new array of the SAME row objects — no mutation of the live window.
|
|
1893
|
-
const capped = this._window.length > maxPersistedGraphRows;
|
|
1894
|
-
const rows = capped ? this._window.slice(0, maxPersistedGraphRows) : this._window;
|
|
1895
|
-
const hasMore = capped || (current.paging?.hasMore ?? false);
|
|
1896
|
-
// Stats are immutable per sha; when capped, trim to the persisted shas (entries for dropped rows are
|
|
1897
|
-
// dead weight). The reachability table is kept whole even when capped — it's proportional to distinct
|
|
1898
|
-
// ref-sets (small), the persisted rows' indices stay valid, and extra sets are harmless on decode.
|
|
1899
|
-
let rowsStats;
|
|
1900
|
-
if (current.includes?.stats === true && current.rowsStats != null && current.rowsStats.size > 0) {
|
|
1901
|
-
const shas = capped ? new Set(rows.map(r => r.sha)) : undefined;
|
|
1902
|
-
rowsStats = [];
|
|
1903
|
-
for (const [sha, stats] of current.rowsStats) {
|
|
1904
|
-
if (shas != null && !shas.has(sha))
|
|
1905
|
-
continue;
|
|
1906
|
-
rowsStats.push([sha, stats]);
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
return {
|
|
1910
|
-
v: graphSessionSnapshotVersion,
|
|
1911
|
-
repoPath: this.repoPath,
|
|
1912
|
-
buildShape: this._buildShape,
|
|
1913
|
-
ordering: ordering,
|
|
1914
|
-
onlyFollowFirstParent: onlyFollowFirstParent === 'true',
|
|
1915
|
-
rows: rows,
|
|
1916
|
-
refTips: [...current.refTips],
|
|
1917
|
-
decorationFingerprint: current.decorationFingerprint,
|
|
1918
|
-
reachability: current.reachability,
|
|
1919
|
-
rowsStats: rowsStats,
|
|
1920
|
-
downstreams: Array.from(current.downstreams, ([k, v]) => [k, [...v]]),
|
|
1921
|
-
hasMore: hasMore,
|
|
1922
|
-
includesStats: current.includes?.stats === true,
|
|
1923
|
-
shallow: current.shallow ?? false,
|
|
1924
|
-
};
|
|
1925
|
-
}
|
|
1926
1750
|
dispose() {
|
|
1927
|
-
// No-op — the window lives entirely in memory
|
|
1928
|
-
// serializes this session (debounced + on its own dispose) and owns the storage IO.
|
|
1751
|
+
// No-op — the window lives entirely in memory and dies with the session.
|
|
1929
1752
|
}
|
|
1930
1753
|
/** A cursor-less rebuild (full walk / fast path) IS the full window. */
|
|
1931
1754
|
applyRebuild(graph, shape) {
|