@gitkraken/core-gitlens 0.70.1 → 0.70.3
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 +17 -2
- package/dist/git/service.d.ts +3 -2
- package/dist/git/service.js +3 -2
- package/dist/git/service.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +2 -1
- package/dist/git/watching/watchService.js +6 -4
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +2 -1
- package/dist/git/watching/worktreeSummary.js +1 -1
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/exec/git.js +6 -3
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/service.js +1 -0
- package/dist/git-cli/service.js.map +1 -1
- package/dist/plus/integrations/models/publicIntegration.d.ts +1 -0
- package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
- package/dist/plus/integrations/reads/drains.d.ts +1 -0
- package/package.json +1 -1
package/dist/git-cli/service.js
CHANGED
|
@@ -95,6 +95,7 @@ function createCliGitService(options) {
|
|
|
95
95
|
service.watchService?.onDidChangeWorkingTree((repoPath) => provider.cache.onWorkingTreeChanged(repoPath));
|
|
96
96
|
provider.cache.setStatusReuseGate((repoPath) => service.watchService?.isWorkingTreeWatched(repoPath) ?? false);
|
|
97
97
|
service.watchService?.onDidChangeRepoWatched((e) => provider.cache.onWorkingTreeChanged(e.repoPath));
|
|
98
|
+
service.watchService?.onDidChangeWatchMode((e) => provider.cache.onWorkingTreeChanged(e.repoPath));
|
|
98
99
|
service.watchService?.onDidChangeRepository((e) => {
|
|
99
100
|
const changes = e.getUnannouncedChanges();
|
|
100
101
|
if (changes.length) provider.cache.onRepositoryChanged(e.repoPath, changes, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","names":[],"sources":["../../../git-cli/src/service.ts"],"sourcesContent":["import { readdir, readFile } from 'node:fs/promises';\nimport { env } from 'node:process';\nimport { FileType } from '@gitlens/git/context.js';\nimport { GitService } from '@gitlens/git/service.js';\nimport type { FileWatchingProvider } from '@gitlens/git/watching/provider.js';\nimport { UnwatchedCacheValidator } from '@gitlens/git/watching/unwatchedCacheValidator.js';\nimport { isNotFound } from '@gitlens/git/watching/watchGroup.js';\nimport type { WatchPollingOptions } from '@gitlens/git/watching/watchService.js';\nimport type { WorktreeSummaryServiceOptions } from '@gitlens/git/watching/worktreeSummary.js';\nimport { fileUri } from '@gitlens/utils/uri.js';\nimport type { CliGitProviderOptions } from './cliGitProvider.js';\nimport { CliGitProvider } from './cliGitProvider.js';\nimport type { GitLocation } from './exec/locator.js';\nimport { findGitPath } from './exec/locator.js';\nimport { statLocal, StatWorkerPool } from './exec/statWorkers.js';\n\n/**\n * Options for {@link createCliGitService}.\n */\nexport interface CliGitServiceOptions {\n\t/**\n\t * Path(s) to the git binary.\n\t * Auto-detected if omitted (searches PATH, platform-specific locations).\n\t * Ignored when {@link locator} is provided.\n\t */\n\tgitPath?: string | string[];\n\n\t/**\n\t * Custom git binary resolver. When provided, used instead of the\n\t * default `findGitPath(gitPath)` lookup.\n\t */\n\tlocator?: () => Promise<GitLocation>;\n\n\t/** Host-provided context hooks (cache events, workspace, integrations, telemetry, fs) */\n\tcontext: CliGitProviderOptions['context'];\n\n\t/**\n\t * Git execution options passed through to the underlying Git executor. `gitOptions.isTrusted(repoPath)` is the\n\t * per-repository trust gate: a `false` answer rejects git runs in that path with `WorkspaceUntrustedError` before\n\t * any process starts. It applies only when `context.workspace.isTrusted` is unset; that flag wins when present.\n\t */\n\tgitOptions?: CliGitProviderOptions['gitOptions'];\n\n\t/** Use an existing Cache instance, or one will be created */\n\tcache?: CliGitProviderOptions['cache'];\n\n\t/** Folders, relative to a repository's common git dir, whose worktrees core acts as if didn't exist */\n\tignoredWorktreeFolders?: CliGitProviderOptions['ignoredWorktreeFolders'];\n\n\t/**\n\t * Refreshes a checkout's index after core's own writes rewrote it, and once a status read of the whole checkout\n\t * finds entries git had to re-check, after 2 seconds without another such read, at most once per checkout per 10\n\t * seconds, and never while a rebase, merge, cherry-pick or revert is paused (see `CliGitProviderOptions`); off by\n\t * default\n\t */\n\trefreshIndexAfterWrites?: CliGitProviderOptions['refreshIndexAfterWrites'];\n\n\t/**\n\t * Filesystem watching provider. When provided, the {@link GitService}\n\t * will watch repositories for changes (file creates, edits, deletes).\n\t */\n\twatchingProvider?: FileWatchingProvider;\n\n\t/**\n\t * Polls in place of (or beside) the watchers {@link watchingProvider} reports it can't trust. When omitted, no\n\t * watcher is asked.\n\t */\n\twatchPolling?: WatchPollingOptions;\n\n\t/**\n\t * Keeps the caches that never expire (branches, current branch, refs, tags, remotes, worktrees, stashes, gk config,\n\t * paused operation, and what derives from them) fresh for repositories whose `.git` directory nothing watches:\n\t * before such a read, stats the files a watcher would have reported, and lists the ref directories and worktree\n\t * admin entries, applying what moved as a watcher event would. Files git writes by rename are read only once the\n\t * directory they're in moved, so a read of an idle repository costs a stat per git dir, per ref directory, per\n\t * linked worktree and per file git writes in place, at most once per 250ms per repository; a watched one costs\n\t * nothing, unless its watch is suspended, which holds what it hears until it resumes. Never runs git: a repository\n\t * whose git dir nothing resolved yet is read from its own files, and one whose files can't show it (bare, a\n\t * submodule, `--separate-git-dir`, `core.worktree`) isn't validated until a read resolves it, its files looked at\n\t * again every 30 seconds. What moves in a worktree under an {@link ignoredWorktreeFolders} folder clears nothing. Without a\n\t * {@link watchingProvider}, every repository counts as unwatched. A read waits at most `timeoutMs` (default 1000)\n\t * for the stats, then is served from the cache. Its stats, listings and file reads are made straight on the local\n\t * file system rather than through `context.fs`, and the stats a repository's git dirs need together as one batch\n\t * on a worker thread (on the calling thread while no worker is free). The calls run one at a time per repository\n\t * and two at once overall. A call on a hung mount holds its thread (a worker's, or one of Node's file-system\n\t * threads) until it returns; one outstanding past `timeoutMs` lets other repositories' calls go on, as long as the\n\t * calls hold no more threads than Node's file-system pool has less two (`UV_THREADPOOL_SIZE`, default 4), which\n\t * leaves the host two. Off by default.\n\t */\n\tvalidateUnwatchedCaches?: boolean | { readonly timeoutMs?: number };\n\n\t/** For tests only; production never passes it (see `WorktreeSummaryServiceOptions.verifyBaseRemeasure`) */\n\tverifyBaseRemeasure?: WorktreeSummaryServiceOptions['verifyBaseRemeasure'];\n\n\t/**\n\t * Reads a subscribed worktree summary's dirty flag from `getStatus({ untracked: 'normal', reuseGeneration: true })`,\n\t * for a host that reads that status on every working-tree change (see\n\t * `WorktreeSummaryServiceOptions.dirtyFromStatus`). The service advances the provider's status clock on the watch\n\t * service's working-tree changes, as that requires. Off by default.\n\t */\n\tsummaryDirtyFromStatus?: WorktreeSummaryServiceOptions['dirtyFromStatus'];\n}\n\n/**\n * Creates a ready-to-use {@link GitService} backed by the CLI git provider.\n *\n * This is the primary entry point for standalone (non-VS Code) consumers\n * of the `@gitlens/git-cli` library. It creates a singleton {@link GitService},\n * wires up a {@link CliGitProvider}, and registers it for all repository paths.\n *\n * @example\n * ```typescript\n * const git = createCliGitService({ context: {} });\n *\n * const repo = git.forRepo('/path/to/repo')!;\n * const branches = await repo.branches.getBranches();\n * const status = await repo.status.getStatus();\n * await repo.ops!.fetch({ remote: 'origin' });\n *\n * git.dispose(); // cleans up provider, cache, and module-level state\n * ```\n *\n * The cache shares a repository's data between its checkouts only once each checkout is registered\n * (`cache.registerRepoPath`). A host that registers checkouts in the background can have each one registered before\n * its first read through `forRepo` by setting a registrar once it has the service (see\n * `Cache.setRepoPathRegistrar`; `undefined` declines a path):\n *\n * ```typescript\n * cache.setRepoPathRegistrar(path =>\n * \tisKnownCheckout(path)\n * \t\t? git.forRepo(path)!.config.getGitDir!().then(gitDir => {\n * \t\t\t\tif (gitDir != null) cache.registerRepoPath(fileUri(path), gitDir);\n * \t\t\t})\n * \t\t: undefined,\n * );\n * ```\n */\nexport function createCliGitService(options: CliGitServiceOptions): GitService {\n\tconst maxFsThreads = getThreadPoolSize() - 2;\n\tconst statWorkers = options.validateUnwatchedCaches ? new StatWorkerPool({ maxWorkers: maxFsThreads }) : undefined;\n\tconst service = GitService.createSingleton(options.watchingProvider, {\n\t\twatchPolling: options.watchPolling,\n\t\tverifyBaseRemeasure: options.verifyBaseRemeasure,\n\t\tsummaryDirtyFromStatus: options.summaryDirtyFromStatus,\n\t\treadFile: path => options.context.fs.readFile(fileUri(path)),\n\t\treadDirectory: path => options.context.fs.readDirectory(fileUri(path)),\n\t\tdisposables: statWorkers != null ? [statWorkers] : undefined,\n\t});\n\n\tconst locator = options.locator ?? (() => findGitPath(options.gitPath ?? null));\n\tconst provider = new CliGitProvider({\n\t\tcontext: options.context,\n\t\tlocator: locator,\n\t\tgitOptions: options.gitOptions,\n\t\tcache: options.cache,\n\t\tignoredWorktreeFolders: options.ignoredWorktreeFolders,\n\t\trefreshIndexAfterWrites: options.refreshIndexAfterWrites,\n\t});\n\n\tservice.register(provider, () => true);\n\n\tif (statWorkers != null) {\n\t\tconst validator = new UnwatchedCacheValidator({\n\t\t\tcache: provider.cache,\n\t\t\ttimeoutMs:\n\t\t\t\ttypeof options.validateUnwatchedCaches === 'object'\n\t\t\t\t\t? options.validateUnwatchedCaches.timeoutMs\n\t\t\t\t\t: undefined,\n\t\t\tmaxFsThreads: maxFsThreads,\n\t\t\t// KEEP: every read here from the local file system, never `context.fs`: a worker can't call it, and a\n\t\t\t// failed batch re-read one path at a time must read alike or it reports moves that aren't\n\t\t\tstatMany: paths => statWorkers.statMany(paths),\n\t\t\tstat: statLocal,\n\t\t\treadDirectory: async path => {\n\t\t\t\tconst entries = await readdir(path, { withFileTypes: true });\n\t\t\t\treturn entries.map(\n\t\t\t\t\te =>\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\te.name,\n\t\t\t\t\t\t\t(e.isDirectory() ? FileType.Directory : FileType.File) |\n\t\t\t\t\t\t\t\t(e.isSymbolicLink() ? FileType.SymbolicLink : 0),\n\t\t\t\t\t\t] as const,\n\t\t\t\t);\n\t\t\t},\n\t\t\treadFile: async path => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await readFile(path);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tif (isNotFound(ex)) return undefined;\n\n\t\t\t\t\tthrow ex;\n\t\t\t\t}\n\t\t\t},\n\t\t\t// KEEP: only for a path whose git dir is cached, so the validator never runs git\n\t\t\tgetIgnoredWorktreeRoots: repoPath =>\n\t\t\t\tprovider.cache.gitDir.get(repoPath) != null\n\t\t\t\t\t? provider.getIgnoredWorktreeRoots(repoPath)\n\t\t\t\t\t: Promise.resolve([]),\n\t\t\tresolveGitDir: repoPath => provider.config.resolveGitDirWithoutGit(repoPath),\n\t\t\tisWatched: repoPath => service.watchService?.isRepoWatched(repoPath) ?? false,\n\t\t});\n\t\tprovider.cache.setReadValidator(\n\t\t\trepoPath => validator.validate(repoPath),\n\t\t\t() => validator.getResourceUsage(),\n\t\t);\n\t\tservice.watchService?.onDidChangeRepoWatched(e => {\n\t\t\tif (e.watched) {\n\t\t\t\tvalidator.onWatched(e.repoPath);\n\t\t\t} else {\n\t\t\t\tvalidator.onUnwatched(e.repoPath);\n\t\t\t}\n\t\t});\n\t}\n\n\t// KEEP: the status clock must advance on every working-tree change, or status reads join and reuse pre-change ones\n\tservice.watchService?.onDidChangeWorkingTree(repoPath => provider.cache.onWorkingTreeChanged(repoPath));\n\tprovider.cache.setStatusReuseGate(repoPath => service.watchService?.isWorkingTreeWatched(repoPath) ?? false);\n\t// KEEP: a checkout watched again may have changed unheard while it wasn't\n\tservice.watchService?.onDidChangeRepoWatched(e => provider.cache.onWorkingTreeChanged(e.repoPath));\n\t// KEEP: never pass announced changes; evicting them again discards what the host re-read since the announcement\n\tservice.watchService?.onDidChangeRepository(e => {\n\t\tconst changes = e.getUnannouncedChanges();\n\t\tif (changes.length) {\n\t\t\tprovider.cache.onRepositoryChanged(e.repoPath, changes, {\n\t\t\t\tmovedWorktrees: e.movedWorktrees,\n\t\t\t\tobservedAt: e.observedAt,\n\t\t\t});\n\t\t}\n\t});\n\tservice.watchService?.onDidChangeFetchHead(repoPath =>\n\t\tprovider.cache.onRepositoryChanged(repoPath, ['lastFetched']),\n\t);\n\treturn service;\n}\n\n/** The size of libuv's thread pool, which runs Node's file-system calls, as libuv reads it at its first use */\nfunction getThreadPoolSize(): number {\n\tconst size = Number.parseInt(env.UV_THREADPOOL_SIZE ?? '', 10);\n\treturn Number.isNaN(size) ? 4 : Math.min(Math.max(size, 1), 1024);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,SAAgB,oBAAoB,SAA2C;CAC9E,MAAM,eAAe,kBAAkB,IAAI;CAC3C,MAAM,cAAc,QAAQ,0BAA0B,IAAI,eAAe,EAAE,YAAY,aAAa,CAAC,IAAI,KAAA;CACzG,MAAM,UAAU,WAAW,gBAAgB,QAAQ,kBAAkB;EACpE,cAAc,QAAQ;EACtB,qBAAqB,QAAQ;EAC7B,wBAAwB,QAAQ;EAChC,WAAU,SAAQ,QAAQ,QAAQ,GAAG,SAAS,QAAQ,IAAI,CAAC;EAC3D,gBAAe,SAAQ,QAAQ,QAAQ,GAAG,cAAc,QAAQ,IAAI,CAAC;EACrE,aAAa,eAAe,OAAO,CAAC,WAAW,IAAI,KAAA;CACpD,CAAC;CAED,MAAM,UAAU,QAAQ,kBAAkB,YAAY,QAAQ,WAAW,IAAI;CAC7E,MAAM,WAAW,IAAI,eAAe;EACnC,SAAS,QAAQ;EACR;EACT,YAAY,QAAQ;EACpB,OAAO,QAAQ;EACf,wBAAwB,QAAQ;EAChC,yBAAyB,QAAQ;CAClC,CAAC;CAED,QAAQ,SAAS,gBAAgB,IAAI;CAErC,IAAI,eAAe,MAAM;EACxB,MAAM,YAAY,IAAI,wBAAwB;GAC7C,OAAO,SAAS;GAChB,WACC,OAAO,QAAQ,4BAA4B,WACxC,QAAQ,wBAAwB,YAChC,KAAA;GACU;GAGd,WAAU,UAAS,YAAY,SAAS,KAAK;GAC7C,MAAM;GACN,eAAe,OAAM,SAAQ;IAE5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,aAAa,CAAC,CAC7D;CACA,OAAO;AACR;;AAGA,SAAS,oBAA4B;CACpC,MAAM,OAAO,OAAO,SAAS,IAAI,sBAAsB,IAAI,EAAE;CAC7D,OAAO,OAAO,MAAM,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC,GAAG,IAAI;AACjE"}
|
|
1
|
+
{"version":3,"file":"service.js","names":[],"sources":["../../../git-cli/src/service.ts"],"sourcesContent":["import { readdir, readFile } from 'node:fs/promises';\nimport { env } from 'node:process';\nimport { FileType } from '@gitlens/git/context.js';\nimport { GitService } from '@gitlens/git/service.js';\nimport type { FileWatchingProvider } from '@gitlens/git/watching/provider.js';\nimport { UnwatchedCacheValidator } from '@gitlens/git/watching/unwatchedCacheValidator.js';\nimport { isNotFound } from '@gitlens/git/watching/watchGroup.js';\nimport type { WatchPollingOptions } from '@gitlens/git/watching/watchService.js';\nimport type { WorktreeSummaryServiceOptions } from '@gitlens/git/watching/worktreeSummary.js';\nimport { fileUri } from '@gitlens/utils/uri.js';\nimport type { CliGitProviderOptions } from './cliGitProvider.js';\nimport { CliGitProvider } from './cliGitProvider.js';\nimport type { GitLocation } from './exec/locator.js';\nimport { findGitPath } from './exec/locator.js';\nimport { statLocal, StatWorkerPool } from './exec/statWorkers.js';\n\n/**\n * Options for {@link createCliGitService}.\n */\nexport interface CliGitServiceOptions {\n\t/**\n\t * Path(s) to the git binary.\n\t * Auto-detected if omitted (searches PATH, platform-specific locations).\n\t * Ignored when {@link locator} is provided.\n\t */\n\tgitPath?: string | string[];\n\n\t/**\n\t * Custom git binary resolver. When provided, used instead of the\n\t * default `findGitPath(gitPath)` lookup.\n\t */\n\tlocator?: () => Promise<GitLocation>;\n\n\t/** Host-provided context hooks (cache events, workspace, integrations, telemetry, fs) */\n\tcontext: CliGitProviderOptions['context'];\n\n\t/**\n\t * Git execution options passed through to the underlying Git executor. `gitOptions.isTrusted(repoPath)` is the\n\t * per-repository trust gate: a `false` answer rejects git runs in that path with `WorkspaceUntrustedError` before\n\t * any process starts. It applies only when `context.workspace.isTrusted` is unset; that flag wins when present.\n\t */\n\tgitOptions?: CliGitProviderOptions['gitOptions'];\n\n\t/** Use an existing Cache instance, or one will be created */\n\tcache?: CliGitProviderOptions['cache'];\n\n\t/** Folders, relative to a repository's common git dir, whose worktrees core acts as if didn't exist */\n\tignoredWorktreeFolders?: CliGitProviderOptions['ignoredWorktreeFolders'];\n\n\t/**\n\t * Refreshes a checkout's index after core's own writes rewrote it, and once a status read of the whole checkout\n\t * finds entries git had to re-check, after 2 seconds without another such read, at most once per checkout per 10\n\t * seconds, and never while a rebase, merge, cherry-pick or revert is paused (see `CliGitProviderOptions`); off by\n\t * default\n\t */\n\trefreshIndexAfterWrites?: CliGitProviderOptions['refreshIndexAfterWrites'];\n\n\t/**\n\t * Filesystem watching provider. When provided, the {@link GitService}\n\t * will watch repositories for changes (file creates, edits, deletes).\n\t */\n\twatchingProvider?: FileWatchingProvider;\n\n\t/**\n\t * Polls in place of (or beside) the watchers {@link watchingProvider} reports it can't trust. When omitted, no\n\t * watcher is asked.\n\t */\n\twatchPolling?: WatchPollingOptions;\n\n\t/**\n\t * Keeps the caches that never expire (branches, current branch, refs, tags, remotes, worktrees, stashes, gk config,\n\t * paused operation, and what derives from them) fresh for repositories whose `.git` directory nothing watches:\n\t * before such a read, stats the files a watcher would have reported, and lists the ref directories and worktree\n\t * admin entries, applying what moved as a watcher event would. Files git writes by rename are read only once the\n\t * directory they're in moved, so a read of an idle repository costs a stat per git dir, per ref directory, per\n\t * linked worktree and per file git writes in place, at most once per 250ms per repository; a watched one costs\n\t * nothing, unless its watch is suspended, which holds what it hears until it resumes. Never runs git: a repository\n\t * whose git dir nothing resolved yet is read from its own files, and one whose files can't show it (bare, a\n\t * submodule, `--separate-git-dir`, `core.worktree`) isn't validated until a read resolves it, its files looked at\n\t * again every 30 seconds. What moves in a worktree under an {@link ignoredWorktreeFolders} folder clears nothing. Without a\n\t * {@link watchingProvider}, every repository counts as unwatched. A read waits at most `timeoutMs` (default 1000)\n\t * for the stats, then is served from the cache. Its stats, listings and file reads are made straight on the local\n\t * file system rather than through `context.fs`, and the stats a repository's git dirs need together as one batch\n\t * on a worker thread (on the calling thread while no worker is free). The calls run one at a time per repository\n\t * and two at once overall. A call on a hung mount holds its thread (a worker's, or one of Node's file-system\n\t * threads) until it returns; one outstanding past `timeoutMs` lets other repositories' calls go on, as long as the\n\t * calls hold no more threads than Node's file-system pool has less two (`UV_THREADPOOL_SIZE`, default 4), which\n\t * leaves the host two. Off by default.\n\t */\n\tvalidateUnwatchedCaches?: boolean | { readonly timeoutMs?: number };\n\n\t/** For tests only; production never passes it (see `WorktreeSummaryServiceOptions.verifyBaseRemeasure`) */\n\tverifyBaseRemeasure?: WorktreeSummaryServiceOptions['verifyBaseRemeasure'];\n\n\t/**\n\t * Reads a subscribed worktree summary's dirty flag from `getStatus({ untracked: 'normal', reuseGeneration: true })`,\n\t * for a host that reads that status on every working-tree change (see\n\t * `WorktreeSummaryServiceOptions.dirtyFromStatus`). The service advances the provider's status clock on the watch\n\t * service's working-tree changes, as that requires. Off by default.\n\t */\n\tsummaryDirtyFromStatus?: WorktreeSummaryServiceOptions['dirtyFromStatus'];\n}\n\n/**\n * Creates a ready-to-use {@link GitService} backed by the CLI git provider.\n *\n * This is the primary entry point for standalone (non-VS Code) consumers\n * of the `@gitlens/git-cli` library. It creates a singleton {@link GitService},\n * wires up a {@link CliGitProvider}, and registers it for all repository paths.\n *\n * @example\n * ```typescript\n * const git = createCliGitService({ context: {} });\n *\n * const repo = git.forRepo('/path/to/repo')!;\n * const branches = await repo.branches.getBranches();\n * const status = await repo.status.getStatus();\n * await repo.ops!.fetch({ remote: 'origin' });\n *\n * git.dispose(); // cleans up provider, cache, and module-level state\n * ```\n *\n * The cache shares a repository's data between its checkouts only once each checkout is registered\n * (`cache.registerRepoPath`). A host that registers checkouts in the background can have each one registered before\n * its first read through `forRepo` by setting a registrar once it has the service (see\n * `Cache.setRepoPathRegistrar`; `undefined` declines a path):\n *\n * ```typescript\n * cache.setRepoPathRegistrar(path =>\n * \tisKnownCheckout(path)\n * \t\t? git.forRepo(path)!.config.getGitDir!().then(gitDir => {\n * \t\t\t\tif (gitDir != null) cache.registerRepoPath(fileUri(path), gitDir);\n * \t\t\t})\n * \t\t: undefined,\n * );\n * ```\n */\nexport function createCliGitService(options: CliGitServiceOptions): GitService {\n\tconst maxFsThreads = getThreadPoolSize() - 2;\n\tconst statWorkers = options.validateUnwatchedCaches ? new StatWorkerPool({ maxWorkers: maxFsThreads }) : undefined;\n\tconst service = GitService.createSingleton(options.watchingProvider, {\n\t\twatchPolling: options.watchPolling,\n\t\tverifyBaseRemeasure: options.verifyBaseRemeasure,\n\t\tsummaryDirtyFromStatus: options.summaryDirtyFromStatus,\n\t\treadFile: path => options.context.fs.readFile(fileUri(path)),\n\t\treadDirectory: path => options.context.fs.readDirectory(fileUri(path)),\n\t\tdisposables: statWorkers != null ? [statWorkers] : undefined,\n\t});\n\n\tconst locator = options.locator ?? (() => findGitPath(options.gitPath ?? null));\n\tconst provider = new CliGitProvider({\n\t\tcontext: options.context,\n\t\tlocator: locator,\n\t\tgitOptions: options.gitOptions,\n\t\tcache: options.cache,\n\t\tignoredWorktreeFolders: options.ignoredWorktreeFolders,\n\t\trefreshIndexAfterWrites: options.refreshIndexAfterWrites,\n\t});\n\n\tservice.register(provider, () => true);\n\n\tif (statWorkers != null) {\n\t\tconst validator = new UnwatchedCacheValidator({\n\t\t\tcache: provider.cache,\n\t\t\ttimeoutMs:\n\t\t\t\ttypeof options.validateUnwatchedCaches === 'object'\n\t\t\t\t\t? options.validateUnwatchedCaches.timeoutMs\n\t\t\t\t\t: undefined,\n\t\t\tmaxFsThreads: maxFsThreads,\n\t\t\t// KEEP: every read here from the local file system, never `context.fs`: a worker can't call it, and a\n\t\t\t// failed batch re-read one path at a time must read alike or it reports moves that aren't\n\t\t\tstatMany: paths => statWorkers.statMany(paths),\n\t\t\tstat: statLocal,\n\t\t\treadDirectory: async path => {\n\t\t\t\tconst entries = await readdir(path, { withFileTypes: true });\n\t\t\t\treturn entries.map(\n\t\t\t\t\te =>\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\te.name,\n\t\t\t\t\t\t\t(e.isDirectory() ? FileType.Directory : FileType.File) |\n\t\t\t\t\t\t\t\t(e.isSymbolicLink() ? FileType.SymbolicLink : 0),\n\t\t\t\t\t\t] as const,\n\t\t\t\t);\n\t\t\t},\n\t\t\treadFile: async path => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await readFile(path);\n\t\t\t\t} catch (ex) {\n\t\t\t\t\tif (isNotFound(ex)) return undefined;\n\n\t\t\t\t\tthrow ex;\n\t\t\t\t}\n\t\t\t},\n\t\t\t// KEEP: only for a path whose git dir is cached, so the validator never runs git\n\t\t\tgetIgnoredWorktreeRoots: repoPath =>\n\t\t\t\tprovider.cache.gitDir.get(repoPath) != null\n\t\t\t\t\t? provider.getIgnoredWorktreeRoots(repoPath)\n\t\t\t\t\t: Promise.resolve([]),\n\t\t\tresolveGitDir: repoPath => provider.config.resolveGitDirWithoutGit(repoPath),\n\t\t\tisWatched: repoPath => service.watchService?.isRepoWatched(repoPath) ?? false,\n\t\t});\n\t\tprovider.cache.setReadValidator(\n\t\t\trepoPath => validator.validate(repoPath),\n\t\t\t() => validator.getResourceUsage(),\n\t\t);\n\t\tservice.watchService?.onDidChangeRepoWatched(e => {\n\t\t\tif (e.watched) {\n\t\t\t\tvalidator.onWatched(e.repoPath);\n\t\t\t} else {\n\t\t\t\tvalidator.onUnwatched(e.repoPath);\n\t\t\t}\n\t\t});\n\t}\n\n\t// KEEP: the status clock must advance on every working-tree change, or status reads join and reuse pre-change ones\n\tservice.watchService?.onDidChangeWorkingTree(repoPath => provider.cache.onWorkingTreeChanged(repoPath));\n\tprovider.cache.setStatusReuseGate(repoPath => service.watchService?.isWorkingTreeWatched(repoPath) ?? false);\n\t// KEEP: a checkout watched again, or no longer polled, may have changed unheard meanwhile\n\tservice.watchService?.onDidChangeRepoWatched(e => provider.cache.onWorkingTreeChanged(e.repoPath));\n\tservice.watchService?.onDidChangeWatchMode(e => provider.cache.onWorkingTreeChanged(e.repoPath));\n\t// KEEP: never pass announced changes; evicting them again discards what the host re-read since the announcement\n\tservice.watchService?.onDidChangeRepository(e => {\n\t\tconst changes = e.getUnannouncedChanges();\n\t\tif (changes.length) {\n\t\t\tprovider.cache.onRepositoryChanged(e.repoPath, changes, {\n\t\t\t\tmovedWorktrees: e.movedWorktrees,\n\t\t\t\tobservedAt: e.observedAt,\n\t\t\t});\n\t\t}\n\t});\n\tservice.watchService?.onDidChangeFetchHead(repoPath =>\n\t\tprovider.cache.onRepositoryChanged(repoPath, ['lastFetched']),\n\t);\n\treturn service;\n}\n\n/** The size of libuv's thread pool, which runs Node's file-system calls, as libuv reads it at its first use */\nfunction getThreadPoolSize(): number {\n\tconst size = Number.parseInt(env.UV_THREADPOOL_SIZE ?? '', 10);\n\treturn Number.isNaN(size) ? 4 : Math.min(Math.max(size, 1), 1024);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,SAAgB,oBAAoB,SAA2C;CAC9E,MAAM,eAAe,kBAAkB,IAAI;CAC3C,MAAM,cAAc,QAAQ,0BAA0B,IAAI,eAAe,EAAE,YAAY,aAAa,CAAC,IAAI,KAAA;CACzG,MAAM,UAAU,WAAW,gBAAgB,QAAQ,kBAAkB;EACpE,cAAc,QAAQ;EACtB,qBAAqB,QAAQ;EAC7B,wBAAwB,QAAQ;EAChC,WAAU,SAAQ,QAAQ,QAAQ,GAAG,SAAS,QAAQ,IAAI,CAAC;EAC3D,gBAAe,SAAQ,QAAQ,QAAQ,GAAG,cAAc,QAAQ,IAAI,CAAC;EACrE,aAAa,eAAe,OAAO,CAAC,WAAW,IAAI,KAAA;CACpD,CAAC;CAED,MAAM,UAAU,QAAQ,kBAAkB,YAAY,QAAQ,WAAW,IAAI;CAC7E,MAAM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MAAM,oBAAmB,aAAY,QAAQ,cAAc,qBAAqB,QAAQ,KAAK,KAAK;CAE3G,QAAQ,cAAc,wBAAuB,MAAK,SAAS,MAAM,qBAAqB,EAAE,QAAQ,CAAC;CACjG,QAAQ,cAAc,sBAAqB,MAAK,SAAS,MAAM,qBAAqB,EAAE,QAAQ,CAAC;CAE/F,QAAQ,cAAc,uBAAsB,MAAK;EAChD,MAAM,UAAU,EAAE,sBAAsB;EACxC,IAAI,QAAQ,QACX,SAAS,MAAM,oBAAoB,EAAE,UAAU,SAAS;GACvD,gBAAgB,EAAE;GAClB,YAAY,EAAE;EACf,CAAC;CAEH,CAAC;CACD,QAAQ,cAAc,sBAAqB,aAC1C,SAAS,MAAM,oBAAoB,UAAU,CAAC,aAAa,CAAC,CAC7D;CACA,OAAO;AACR;;AAGA,SAAS,oBAA4B;CACpC,MAAM,OAAO,OAAO,SAAS,IAAI,sBAAsB,IAAI,EAAE;CAC7D,OAAO,OAAO,MAAM,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC,GAAG,IAAI;AACjE"}
|
|
@@ -10,6 +10,7 @@ import { RepositoryMetadata } from "../../../git/models/repositoryMetadata.js";
|
|
|
10
10
|
import { PullRequestUrlIdentity } from "../../../git/utils/pullRequest.utils.js";
|
|
11
11
|
import { GitCloudHostIntegrationId, IntegrationIds, IssuesCloudHostIntegrationId, IssuesHostIntegrationIds } from "../constants.js";
|
|
12
12
|
import { Sources } from "../telemetry.js";
|
|
13
|
+
import "../providerFilters.js";
|
|
13
14
|
import { ProviderRepositoryShape } from "../results.js";
|
|
14
15
|
import { ProviderRepositoriesInput } from "../manager.js";
|
|
15
16
|
//#region ../plus/integrations/src/models/publicIntegration.d.ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IssueSorting } from "../../../git/models/issue.js";
|
|
2
|
+
import "../providerFilters.js";
|
|
2
3
|
//#region ../plus/integrations/src/providers/issueSorts.d.ts
|
|
3
4
|
/** GitHub and GHE: one `search` channel serves all three issue reads, so all three order the same way. */
|
|
4
5
|
export declare const githubIssueSorts: IssueSorting[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ResourceDescriptor } from "../../../git/models/resourceDescriptor.js";
|
|
2
2
|
import { PullRequest, PullRequestFilter, PullRequestStateFilter } from "../../../git/models/pullRequest.js";
|
|
3
3
|
import { IntegrationIds } from "../constants.js";
|
|
4
|
+
import "../providerFilters.js";
|
|
4
5
|
import { ProviderWarning } from "../results.js";
|
|
5
6
|
import { ProviderSweepTarget, PullRequestSweepOptions } from "../manager.js";
|
|
6
7
|
import { IntegrationResult } from "../models/publicIntegration.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/core-gitlens",
|
|
3
3
|
"description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.3",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "GitKraken",
|