@gitkraken/core-gitlens 0.8.0 → 0.9.0
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 +32 -1
- package/dist/git/cache.d.ts +11 -0
- package/dist/git/cache.js +26 -3
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +3 -2
- package/dist/git/context.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.js +1 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/models/reflog.d.ts +6 -0
- package/dist/git/models/reflog.js.map +1 -1
- package/dist/git/models/revision.d.ts +0 -1
- package/dist/git/models/revision.js +1 -2
- package/dist/git/models/revision.js.map +1 -1
- package/dist/git/providers/commits.d.ts +20 -1
- package/dist/git/providers/operations.d.ts +13 -0
- package/dist/git/providers/provider.d.ts +14 -4
- package/dist/git/providers/refs.d.ts +10 -0
- package/dist/git/providers/revision.d.ts +2 -0
- package/dist/git/providers/staging.d.ts +2 -1
- package/dist/git/providers/stash.d.ts +3 -2
- package/dist/git/providers/status.d.ts +4 -0
- package/dist/git/run.types.d.ts +16 -0
- package/dist/git-cli/cliGitProvider.d.ts +24 -3
- package/dist/git-cli/cliGitProvider.js +79 -17
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/commandClassifier.d.ts +31 -0
- package/dist/git-cli/exec/commandClassifier.js +391 -0
- package/dist/git-cli/exec/commandClassifier.js.map +1 -0
- package/dist/git-cli/exec/git.d.ts +24 -3
- package/dist/git-cli/exec/git.js +116 -12
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/parsers/reflogParser.d.ts +7 -0
- package/dist/git-cli/parsers/reflogParser.js +11 -1
- package/dist/git-cli/parsers/reflogParser.js.map +1 -1
- package/dist/git-cli/providers/branches.js +16 -14
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts +4 -2
- package/dist/git-cli/providers/commits.js +55 -4
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/diff.js +4 -4
- package/dist/git-cli/providers/diff.js.map +1 -1
- package/dist/git-cli/providers/operations.d.ts +12 -0
- package/dist/git-cli/providers/operations.js +26 -3
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/patch.js +2 -5
- package/dist/git-cli/providers/patch.js.map +1 -1
- package/dist/git-cli/providers/refs.d.ts +5 -0
- package/dist/git-cli/providers/refs.js +26 -1
- package/dist/git-cli/providers/refs.js.map +1 -1
- package/dist/git-cli/providers/remotes.js +3 -2
- package/dist/git-cli/providers/remotes.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +2 -0
- package/dist/git-cli/providers/revision.js +11 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/git-cli/providers/staging.d.ts +2 -1
- package/dist/git-cli/providers/staging.js +12 -7
- package/dist/git-cli/providers/staging.js.map +1 -1
- package/dist/git-cli/providers/stash.d.ts +3 -2
- package/dist/git-cli/providers/stash.js +34 -22
- package/dist/git-cli/providers/stash.js.map +1 -1
- package/dist/git-cli/providers/status.d.ts +2 -0
- package/dist/git-cli/providers/status.js +27 -9
- package/dist/git-cli/providers/status.js.map +1 -1
- package/dist/plus/git-github/providers/github/commits.d.ts +4 -2
- package/dist/plus/git-github/providers/github/commits.js +3 -1
- package/dist/plus/git-github/providers/github/commits.js.map +1 -1
- package/dist/plus/git-github/providers/github/revision.d.ts +1 -0
- package/dist/plus/git-github/providers/github/revision.js +5 -0
- package/dist/plus/git-github/providers/github/revision.js.map +1 -1
- package/docs/kepler-git-write-api-parity.md +140 -14
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commits.js","names":[],"sources":["../../../../../../plus/git-github/src/providers/github/commits.ts"],"sourcesContent":["import type { Cache } from '@gitlens/git/cache.js';\nimport { GitCommit, GitCommitIdentity } from '@gitlens/git/models/commit.js';\nimport { GitFileChange } from '@gitlens/git/models/fileChange.js';\nimport { GitFileIndexStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { GitLog } from '@gitlens/git/models/log.js';\nimport type { GitRevisionRange } from '@gitlens/git/models/revision.js';\nimport { deletedOrMissing } from '@gitlens/git/models/revision.js';\nimport type { SearchQuery } from '@gitlens/git/models/search.js';\nimport type { GitUser } from '@gitlens/git/models/user.js';\nimport type {\n\tGitCommitsSubProvider,\n\tGitLogForPathOptions,\n\tGitLogOptions,\n\tGitLogShasOptions,\n\tGitSearchCommitsOptions,\n\tLeftRightCommitCountResult,\n\tSearchCommitsResult,\n} from '@gitlens/git/providers/commits.js';\nimport { createUncommittedChangesCommit } from '@gitlens/git/utils/commit.utils.js';\nimport { createRevisionRange, isUncommitted, stripOrigin } from '@gitlens/git/utils/revision.utils.js';\nimport { parseSearchQueryGitHubCommand } from '@gitlens/git/utils/search.utils.js';\nimport { debug } from '@gitlens/utils/decorators/log.js';\nimport { first, last, map, some } from '@gitlens/utils/iterable.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport { isFolderGlob, normalizePath, stripFolderGlob } from '@gitlens/utils/path.js';\nimport type { Uri } from '@gitlens/utils/uri.js';\nimport { coerceUri, joinUriPath } from '@gitlens/utils/uri.js';\nimport { toTokenInfo } from '../../api/tokenUtils.js';\nimport type { GitHubCommit } from '../../models.js';\nimport { fromCommitFileStatus } from '../../models.js';\nimport type { GitHubGitProviderInternal } from '../githubProvider.js';\n\nfunction isViewer(name: string, viewer: string | undefined): boolean | undefined {\n\treturn (viewer != null && name === viewer) || undefined;\n}\n\nexport class CommitsGitSubProvider implements GitCommitsSubProvider {\n\tconstructor(\n\t\tprivate readonly cache: Cache,\n\t\tprivate readonly provider: GitHubGitProviderInternal,\n\t) {}\n\n\t@debug()\n\tgetCommit(repoPath: string, rev: string, _cancellation?: AbortSignal): Promise<GitCommit | undefined> {\n\t\tif (repoPath == null) return Promise.resolve(undefined);\n\n\t\t// Don't cache uncommitted-changes synthesis — it's date-sensitive\n\t\tif (isUncommitted(rev, true)) {\n\t\t\treturn (async () => {\n\t\t\t\treturn createUncommittedChangesCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\trev,\n\t\t\t\t\tnew Date(),\n\t\t\t\t\tawait this.provider.config.getCurrentUser(repoPath),\n\t\t\t\t);\n\t\t\t})();\n\t\t}\n\n\t\t// TODO: resolve symbolic refs (HEAD, branch names) to SHA before caching to avoid\n\t\t// short staleness windows. For now we cascade-clear on 'branch'/'branches'.\n\t\treturn this.cache.commit.getOrCreate(repoPath, stripOrigin(rev), async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\ttry {\n\t\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\t\tconst commit = await github.getCommit(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(rev),\n\t\t\t\t);\n\t\t\t\tif (commit == null) return undefined;\n\n\t\t\t\tconst repoUri = coerceUri(repoPath);\n\n\t\t\t\tconst { viewer = session.account.label } = commit;\n\n\t\t\t\treturn new GitCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\tcommit.oid,\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\tcommit.message,\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.files?.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t},\n\t\t\t\t\t[],\n\t\t\t\t);\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tgetCommitCount(repoPath: string, rev: string, _cancellation?: AbortSignal): Promise<number | undefined> {\n\t\tif (repoPath == null) return Promise.resolve(undefined);\n\n\t\treturn this.cache.commitCount.getOrCreate(repoPath, stripOrigin(rev), async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\ttry {\n\t\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\t\tconst count = await github.getCommitCount(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(rev),\n\t\t\t\t);\n\n\t\t\t\treturn count;\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tasync getCommitFiles(repoPath: string, rev: string, _cancellation?: AbortSignal): Promise<GitFileChange[]> {\n\t\tif (rev === deletedOrMissing || isUncommitted(rev)) return [];\n\n\t\tconst commit = await this.getCommit(repoPath, rev);\n\t\treturn [...(commit?.fileset?.files ?? [])];\n\t}\n\n\t@debug()\n\tasync getCommitForFile(\n\t\trepoPath: string,\n\t\tpathOrUri: string | Uri,\n\t\trev?: string | undefined,\n\t\t_options?: { firstIfNotFound?: boolean },\n\t\t_cancellation?: AbortSignal,\n\t): Promise<GitCommit | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\tconst rootUri = this.provider.getProviderRootUri(this.provider.getAbsoluteUri(pathOrUri, repoPath));\n\t\tconst file = this.provider.getRelativePath(this.provider.getAbsoluteUri(pathOrUri, repoPath), rootUri);\n\n\t\t// Resolve HEAD/empty rev to the metadata revision so the cache key is stable across callers\n\t\tconst resolvedRev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\t\t// Path-scoped variant lives in the same slot as `getCommit` but with a `|file` suffix to\n\t\t// keep it distinct from the unscoped commit entry.\n\t\tconst cacheKey = `${stripOrigin(resolvedRev)}|${file}`;\n\n\t\treturn this.cache.commit.getOrCreate(repoPath, cacheKey, async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\ttry {\n\t\t\t\tconst commit = await github.getCommitForFile(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(resolvedRev),\n\t\t\t\t\tfile,\n\t\t\t\t);\n\t\t\t\tif (commit == null) return undefined;\n\n\t\t\t\tconst repoUri = coerceUri(repoPath);\n\t\t\t\tconst { viewer = session.account.label } = commit;\n\n\t\t\t\treturn new GitCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\tcommit.oid,\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\tcommit.message,\n\t\t\t\t\tcommit.files != null\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tfiles: undefined,\n\t\t\t\t\t\t\t\tfiltered: {\n\t\t\t\t\t\t\t\t\tfiles: commit.files?.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t\t\t\t\tpathspec: file,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t},\n\t\t\t\t\t[],\n\t\t\t\t);\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tgetLeftRightCommitCount(\n\t\trepoPath: string,\n\t\trange: GitRevisionRange,\n\t\t_options?: { authors?: GitUser[]; excludeMerges?: boolean },\n\t\t_cancellation?: AbortSignal,\n\t): Promise<LeftRightCommitCountResult | undefined> {\n\t\tif (repoPath == null) return Promise.resolve(undefined);\n\n\t\treturn this.cache.leftRightCommitCount.getOrCreate(repoPath, stripOrigin(range), async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\ttry {\n\t\t\t\tconst result = await github.getComparison(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(range),\n\t\t\t\t);\n\n\t\t\t\tif (result == null) return undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\tleft: result.behind_by,\n\t\t\t\t\tright: result.ahead_by,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tasync getLog(\n\t\trepoPath: string,\n\t\trev?: string | undefined,\n\t\toptions?: GitLogOptions,\n\t\t_cancellation?: AbortSignal,\n\t): Promise<GitLog | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tconst scope = getScopedLogger();\n\n\t\tconst limit = this.provider.getPagingLimit(options?.limit);\n\n\t\ttry {\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\trev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\t\t\tconst result = await github.getCommits(\n\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\tmetadata.repo.owner,\n\t\t\t\tmetadata.repo.name,\n\t\t\t\tstripOrigin(rev),\n\t\t\t\t{\n\t\t\t\t\tall: options?.all,\n\t\t\t\t\tauthors: options?.authors,\n\t\t\t\t\tafter: options?.cursor,\n\t\t\t\t\tlimit: limit,\n\t\t\t\t\tsince: options?.since ? new Date(options.since) : undefined,\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tconst commits = new Map<string, GitCommit>();\n\t\t\tconst repoUri = coerceUri(repoPath);\n\n\t\t\tconst { viewer = session.account.label } = result;\n\t\t\tfor (const commit of result.values) {\n\t\t\t\tlet c = commits.get(commit.oid);\n\t\t\t\tif (c == null) {\n\t\t\t\t\tc = new GitCommit(\n\t\t\t\t\t\trepoPath,\n\t\t\t\t\t\tcommit.oid,\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\t\tcommit.message,\n\t\t\t\t\t\tcommit.files != null\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfiles: commit.files.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[],\n\t\t\t\t\t);\n\t\t\t\t\tcommits.set(commit.oid, c);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst log: GitLog = {\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: rev,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: limit,\n\t\t\t\thasMore: result.paging?.more ?? false,\n\t\t\t\tendingCursor: result.paging?.cursor,\n\t\t\t\tquery: (limit: number | undefined) => this.getLog(repoPath, rev, { ...options, limit: limit }),\n\t\t\t};\n\n\t\t\tif (log.hasMore) {\n\t\t\t\tlog.more = this.getLogMoreFn(log, rev, options);\n\t\t\t}\n\n\t\t\treturn log;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate getLogMoreFn(\n\t\tlog: GitLog,\n\t\trev: string | undefined,\n\t\toptions?: GitLogOptions,\n\t): (limit: number | { until: string } | undefined) => Promise<GitLog> {\n\t\treturn async (limit: number | { until: string } | undefined) => {\n\t\t\tconst moreUntil = limit != null && typeof limit === 'object' ? limit.until : undefined;\n\t\t\tlet moreLimit = typeof limit === 'number' ? limit : undefined;\n\n\t\t\tif (moreUntil && some(log.commits.values(), c => c.ref === moreUntil)) {\n\t\t\t\treturn log;\n\t\t\t}\n\n\t\t\tmoreLimit = this.provider.getPagingLimit(moreLimit);\n\n\t\t\tconst moreLog = await this.getLog(log.repoPath, rev, {\n\t\t\t\t...options,\n\t\t\t\tlimit: moreLimit,\n\t\t\t\tcursor: log.endingCursor,\n\t\t\t});\n\t\t\t// If we can't find any more, assume we have everything\n\t\t\tif (moreLog == null) return { ...log, hasMore: false, more: undefined };\n\n\t\t\tconst commits = new Map([...log.commits, ...moreLog.commits]);\n\n\t\t\tconst mergedLog: GitLog = {\n\t\t\t\trepoPath: log.repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: log.sha,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: moreUntil == null ? (log.limit ?? 0) + moreLimit : undefined,\n\t\t\t\thasMore: moreUntil == null ? moreLog.hasMore : true,\n\t\t\t\t// The oldest commit SHA of the previous page — the graph webview compares this\n\t\t\t\t// against its last displayed row to determine the merge point for appending new rows\n\t\t\t\tstartingCursor: last(log.commits)?.[0],\n\t\t\t\tendingCursor: moreLog.endingCursor,\n\t\t\t\tpagedCommits: () => {\n\t\t\t\t\t// Remove any duplicates\n\t\t\t\t\tfor (const sha of log.commits.keys()) {\n\t\t\t\t\t\tmoreLog.commits.delete(sha);\n\t\t\t\t\t}\n\t\t\t\t\treturn moreLog.commits;\n\t\t\t\t},\n\t\t\t\tquery: log.query,\n\t\t\t};\n\t\t\tif (mergedLog.hasMore) {\n\t\t\t\tmergedLog.more = this.getLogMoreFn(mergedLog, rev, options);\n\t\t\t}\n\n\t\t\treturn mergedLog;\n\t\t};\n\t}\n\n\t@debug()\n\tasync getLogForPath(\n\t\trepoPath: string,\n\t\tpathOrUri: string | Uri,\n\t\trev?: string | undefined,\n\t\toptions?: GitLogForPathOptions,\n\t\t_cancellation?: AbortSignal,\n\t): Promise<GitLog | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tlet relativePath = this.provider.getRelativePath(pathOrUri, repoPath);\n\n\t\tif (repoPath != null && repoPath === relativePath) {\n\t\t\tthrow new Error(`Path cannot match the repository path; path=${relativePath}`);\n\t\t}\n\n\t\toptions = {\n\t\t\t...options,\n\t\t\tall: false /* not supported */,\n\t\t\tlimit: this.provider.getPagingLimit(options?.limit),\n\t\t\trenames: false /* not supported */,\n\t\t};\n\n\t\tif (isFolderGlob(relativePath)) {\n\t\t\trelativePath = stripFolderGlob(relativePath);\n\t\t\toptions.isFolder = true;\n\t\t} else if (options.isFolder == null) {\n\t\t\tconst tree = await this.provider.revision.getTreeEntryForRevision(repoPath, relativePath, rev || 'HEAD');\n\t\t\toptions.isFolder = tree?.type === 'tree';\n\t\t}\n\n\t\t// Note: document caching (TrackedGitDocument) is handled by the extension wrapper.\n\t\t// The library implementation always fetches fresh data.\n\t\treturn this.getLogForPathCore(repoPath, relativePath, rev, options);\n\t}\n\n\tprivate async getLogForPathCore(\n\t\trepoPath: string,\n\t\tpath: string,\n\t\trev: string | undefined,\n\t\toptions: GitLogForPathOptions,\n\t): Promise<GitLog | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tconst limit = this.provider.getPagingLimit(options.limit);\n\n\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\tif (context == null) return undefined;\n\n\t\tconst { metadata, github, session } = context;\n\n\t\tconst uri = this.provider.getAbsoluteUri(path, repoPath);\n\t\tconst relativePath = this.provider.getRelativePath(uri, this.provider.getProviderRootUri(uri));\n\n\t\trev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\t\tconst result = await github.getCommits(\n\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\tmetadata.repo.owner,\n\t\t\tmetadata.repo.name,\n\t\t\tstripOrigin(rev),\n\t\t\t{\n\t\t\t\tall: options.all,\n\t\t\t\tafter: options.cursor,\n\t\t\t\tpath: relativePath,\n\t\t\t\tlimit: limit,\n\t\t\t\tsince: options.since ? new Date(options.since) : undefined,\n\t\t\t},\n\t\t);\n\n\t\tconst repoUri = coerceUri(repoPath);\n\t\tconst commits = new Map<string, GitCommit>();\n\n\t\tconst { viewer = session.account.label } = result;\n\t\tfor (const commit of result.values) {\n\t\t\tlet c = commits.get(commit.oid);\n\t\t\tif (c == null) {\n\t\t\t\tconst files = commit.files?.map(f => toFileChange(repoUri, repoPath, f));\n\n\t\t\t\tif (files != null && !options.isFolder && commit.changedFiles === 1) {\n\t\t\t\t\tconst index = files.findIndex(f => f.path === relativePath);\n\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\tfiles.splice(\n\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tnew GitFileChange(\n\t\t\t\t\t\t\t\trepoPath,\n\t\t\t\t\t\t\t\trelativePath,\n\t\t\t\t\t\t\t\tGitFileIndexStatus.Modified,\n\t\t\t\t\t\t\t\tjoinUriPath(repoUri, normalizePath(relativePath)),\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tcommit.changedFiles === 1\n\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t\t\t\t\t\t\tchanges: 0,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tc = new GitCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\tcommit.oid,\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\tcommit.message,\n\t\t\t\t\t{ files: undefined, filtered: { files: files, pathspec: relativePath } },\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t},\n\t\t\t\t\t[],\n\t\t\t\t);\n\t\t\t\tcommits.set(commit.oid, c);\n\t\t\t}\n\t\t}\n\n\t\tconst log: GitLog = {\n\t\t\trepoPath: repoPath,\n\t\t\tcommits: commits,\n\t\t\tsha: rev,\n\t\t\tcount: commits.size,\n\t\t\tlimit: limit,\n\t\t\thasMore: result.paging?.more ?? false,\n\t\t\tendingCursor: result.paging?.cursor,\n\t\t\tquery: (limit: number | undefined) => this.getLogForPath(repoPath, path, rev, { ...options, limit: limit }),\n\t\t};\n\t\tif (log.hasMore) {\n\t\t\tlog.more = this.getLogForPathMoreFn(log, path, rev, options);\n\t\t}\n\n\t\treturn log;\n\t}\n\n\tprivate getLogForPathMoreFn(\n\t\tlog: GitLog,\n\t\trelativePath: string,\n\t\trev: string | undefined,\n\t\toptions: GitLogForPathOptions,\n\t): (limit: number | { until: string } | undefined) => Promise<GitLog> {\n\t\treturn async (limit: number | { until: string } | undefined) => {\n\t\t\tconst moreUntil = limit != null && typeof limit === 'object' ? limit.until : undefined;\n\t\t\tlet moreLimit = typeof limit === 'number' ? limit : undefined;\n\n\t\t\tif (moreUntil && some(log.commits.values(), c => c.ref === moreUntil)) {\n\t\t\t\treturn log;\n\t\t\t}\n\n\t\t\tmoreLimit = this.provider.getPagingLimit(moreLimit);\n\n\t\t\tconst moreLog = await this.getLogForPath(log.repoPath, relativePath, rev, {\n\t\t\t\t...options,\n\t\t\t\tlimit: moreUntil == null ? moreLimit : 0,\n\t\t\t\tcursor: log.endingCursor,\n\t\t\t});\n\t\t\t// If we can't find any more, assume we have everything\n\t\t\tif (moreLog == null) return { ...log, hasMore: false, more: undefined };\n\n\t\t\tconst commits = new Map([...log.commits, ...moreLog.commits]);\n\n\t\t\tconst mergedLog: GitLog = {\n\t\t\t\trepoPath: log.repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: log.sha,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: moreUntil == null ? (log.limit ?? 0) + moreLimit : undefined,\n\t\t\t\thasMore: moreUntil == null ? moreLog.hasMore : true,\n\t\t\t\tendingCursor: moreLog.endingCursor,\n\t\t\t\tquery: log.query,\n\t\t\t};\n\n\t\t\tif (mergedLog.hasMore) {\n\t\t\t\tmergedLog.more = this.getLogForPathMoreFn(mergedLog, relativePath, rev, options);\n\t\t\t}\n\n\t\t\treturn mergedLog;\n\t\t};\n\t}\n\n\t@debug()\n\tasync getLogShas(\n\t\trepoPath: string,\n\t\trev?: string | undefined,\n\t\toptions?: GitLogShasOptions,\n\t\tcancellation?: AbortSignal,\n\t): Promise<Iterable<string>> {\n\t\tif (repoPath == null) return [];\n\n\t\tconst scope = getScopedLogger();\n\n\t\t// `authors` and `all` filters aren't supported by the lightweight SHA-only query;\n\t\t// fall back to the full log path when set.\n\t\tif (options?.authors?.length || options?.all) {\n\t\t\tlet log: GitLog | undefined;\n\t\t\tif (options?.pathOrUri != null) {\n\t\t\t\tlog = await this.getLogForPath(repoPath, options.pathOrUri, rev, options, cancellation);\n\t\t\t} else {\n\t\t\t\tlog = await this.getLog(repoPath, rev, options, cancellation);\n\t\t\t}\n\t\t\tif (log == null) return [];\n\n\t\t\tconst shas = map(log.commits.values(), c => c.ref);\n\t\t\t// Note: reversal only applies to the first page — subsequent pages loaded via pagination are not reversed\n\t\t\treturn options?.reverse ? [...shas].reverse() : shas;\n\t\t}\n\n\t\tconst limit = this.provider.getPagingLimit(options?.limit);\n\n\t\ttry {\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\trev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\n\t\t\tlet path: string | undefined;\n\t\t\tif (options?.pathOrUri != null) {\n\t\t\t\tconst rootUri = this.provider.getProviderRootUri(\n\t\t\t\t\tthis.provider.getAbsoluteUri(options.pathOrUri, repoPath),\n\t\t\t\t);\n\t\t\t\tpath = this.provider.getRelativePath(\n\t\t\t\t\tthis.provider.getAbsoluteUri(options.pathOrUri, repoPath),\n\t\t\t\t\trootUri,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst strippedRev = stripOrigin(rev);\n\t\t\tconst sinceISO = options?.since ? new Date(options.since).toISOString() : '';\n\t\t\tconst cacheKey = `${strippedRev}|${path ?? ''}|${sinceISO}|${limit}|${options?.cursor ?? ''}`;\n\n\t\t\tconst shas = await this.cache.logShas.getOrCreate(repoPath, cacheKey, async () => {\n\t\t\t\tconst result = await github.getCommitShas(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstrippedRev,\n\t\t\t\t\t{\n\t\t\t\t\t\tafter: options?.cursor,\n\t\t\t\t\t\tlimit: limit,\n\t\t\t\t\t\tpath: path,\n\t\t\t\t\t\tsince: options?.since ? new Date(options.since) : undefined,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\treturn result.values;\n\t\t\t});\n\n\t\t\t// Note: reversal only applies to the first page — subsequent pages loaded via pagination are not reversed\n\t\t\treturn options?.reverse ? shas.toReversed() : shas;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t@debug()\n\tgetOldestUnpushedShaForPath(\n\t\t_repoPath: string,\n\t\t_pathOrUri: string | Uri,\n\t\t_cancellation?: AbortSignal,\n\t): Promise<string | undefined> {\n\t\t// TODO@eamodio until we have access to the RemoteHub change store there isn't anything we can do here\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\t@debug()\n\thasCommitBeenPushed(_repoPath: string, _rev: string, _cancellation?: AbortSignal): Promise<boolean> {\n\t\t// In this env we can't have unpushed commits\n\t\treturn Promise.resolve(true);\n\t}\n\n\t@debug()\n\tasync isAncestorOf(repoPath: string, rev1: string, rev2: string, _cancellation?: AbortSignal): Promise<boolean> {\n\t\tif (repoPath == null) return false;\n\n\t\tconst scope = getScopedLogger();\n\n\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\ttry {\n\t\t\tconst result = await github.getComparison(\n\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\tmetadata.repo.owner,\n\t\t\t\tmetadata.repo.name,\n\t\t\t\tcreateRevisionRange(stripOrigin(rev1), stripOrigin(rev2), '...'),\n\t\t\t);\n\n\t\t\tswitch (result?.status) {\n\t\t\t\tcase 'ahead':\n\t\t\t\tcase 'diverged':\n\t\t\t\t\treturn false;\n\t\t\t\tcase 'identical':\n\t\t\t\tcase 'behind':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t@debug({\n\t\targs: (repoPath, s) => ({\n\t\t\trepoPath: repoPath,\n\t\t\tsearch: `[${s.matchAll ? 'A' : ''}${s.matchCase ? 'C' : ''}${s.matchRegex ? 'R' : ''}${\n\t\t\t\ts.matchWholeWord ? 'W' : ''\n\t\t\t}]: ${s.query.length > 500 ? `${s.query.substring(0, 500)}...` : s.query}`,\n\t\t}),\n\t})\n\tasync searchCommits(\n\t\trepoPath: string,\n\t\tsearch: SearchQuery,\n\t\toptions?: GitSearchCommitsOptions,\n\t\tcancellation?: AbortSignal,\n\t): Promise<SearchCommitsResult> {\n\t\tif (repoPath == null) return { search: search, log: undefined };\n\n\t\tconst scope = getScopedLogger();\n\n\t\tsearch = { matchAll: false, matchCase: false, matchRegex: true, matchWholeWord: false, ...search };\n\t\t// Note: Natural language processing is handled by the extension wrapper.\n\n\t\tconst currentUser = search.query.includes('@me')\n\t\t\t? await this.provider.config.getCurrentUser(repoPath)\n\t\t\t: undefined;\n\t\tif (cancellation?.aborted) return { search: search, log: undefined };\n\n\t\tconst { args: queryArgs, operations } = parseSearchQueryGitHubCommand(search, currentUser);\n\n\t\tconst values = operations.get('commit:');\n\t\tif (values?.size) {\n\t\t\tconst commit = await this.getCommit(repoPath, first(values)!);\n\t\t\tif (commit == null) return { search: search, log: undefined };\n\n\t\t\treturn {\n\t\t\t\tsearch: search,\n\t\t\t\tlog: {\n\t\t\t\t\trepoPath: repoPath,\n\t\t\t\t\tcommits: new Map([[commit.sha, commit]]),\n\t\t\t\t\tsha: commit.sha,\n\t\t\t\t\tcount: 1,\n\t\t\t\t\tlimit: 1,\n\t\t\t\t\thasMore: false,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tif (!queryArgs.length) return { search: search, log: undefined };\n\n\t\tconst limit = this.provider.getPagingLimit(options?.limit);\n\n\t\ttry {\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\tconst query = `repo:${metadata.repo.owner}/${metadata.repo.name}+${queryArgs.join('+').trim()}`;\n\n\t\t\tconst result = await github.searchCommits(\n\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\tquery,\n\t\t\t\t{\n\t\t\t\t\tcursor: options?.cursor,\n\t\t\t\t\tlimit: limit,\n\t\t\t\t\tsort:\n\t\t\t\t\t\toptions?.ordering === 'date'\n\t\t\t\t\t\t\t? 'committer-date'\n\t\t\t\t\t\t\t: options?.ordering === 'author-date'\n\t\t\t\t\t\t\t\t? 'author-date'\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t);\n\t\t\tif (result == null) return { search: search, log: undefined };\n\n\t\t\tconst commits = new Map<string, GitCommit>();\n\t\t\tconst repoUri = coerceUri(repoPath);\n\n\t\t\tconst viewer = session.account.label;\n\t\t\tfor (const commit of result.values) {\n\t\t\t\tlet c = commits.get(commit.oid);\n\t\t\t\tif (c == null) {\n\t\t\t\t\tc = new GitCommit(\n\t\t\t\t\t\trepoPath,\n\t\t\t\t\t\tcommit.oid,\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\t\tcommit.message,\n\t\t\t\t\t\tcommit.files != null\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfiles: commit.files.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[],\n\t\t\t\t\t);\n\t\t\t\t\tcommits.set(commit.oid, c);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst log: GitLog = {\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: undefined,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: limit,\n\t\t\t\thasMore: result.pageInfo?.hasNextPage ?? false,\n\t\t\t\tendingCursor: result.pageInfo?.endCursor ?? undefined,\n\t\t\t\tquery: (limit: number | undefined) =>\n\t\t\t\t\tthis.searchCommits(repoPath, search, { ...options, limit: limit }).then(r => r.log!),\n\t\t\t};\n\n\t\t\tif (log.hasMore) {\n\t\t\t\tconst searchCommitsCore = (log: GitLog): ((limit: number | undefined) => Promise<GitLog>) => {\n\t\t\t\t\treturn async (limit: number | undefined) => {\n\t\t\t\t\t\tlimit = this.provider.getPagingLimit(limit);\n\n\t\t\t\t\t\tconst moreLog = (\n\t\t\t\t\t\t\tawait this.searchCommits(log.repoPath, search, {\n\t\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t\t\tlimit: limit,\n\t\t\t\t\t\t\t\tcursor: log.endingCursor,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).log;\n\t\t\t\t\t\t// If we can't find any more, assume we have everything\n\t\t\t\t\t\tif (moreLog == null) return { ...log, hasMore: false, more: undefined };\n\n\t\t\t\t\t\tconst commits = new Map([...log.commits, ...moreLog.commits]);\n\n\t\t\t\t\t\tconst mergedLog: GitLog = {\n\t\t\t\t\t\t\trepoPath: log.repoPath,\n\t\t\t\t\t\t\tcommits: commits,\n\t\t\t\t\t\t\tsha: log.sha,\n\t\t\t\t\t\t\tcount: commits.size,\n\t\t\t\t\t\t\tlimit: (log.limit ?? 0) + limit,\n\t\t\t\t\t\t\thasMore: moreLog.hasMore,\n\t\t\t\t\t\t\tendingCursor: moreLog.endingCursor,\n\t\t\t\t\t\t\tquery: log.query,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (mergedLog.hasMore) {\n\t\t\t\t\t\t\tmergedLog.more = searchCommitsCore(mergedLog);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn mergedLog;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tlog.more = searchCommitsCore(log);\n\t\t\t}\n\n\t\t\treturn { search: search, log: log };\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn { search: search, log: undefined };\n\t\t}\n\t}\n}\n\n/** Converts a GitHub API file entry to a library GitFileChange */\nfunction toFileChange(repoUri: Uri, repoPath: string, f: NonNullable<GitHubCommit['files']>[0]): GitFileChange {\n\tconst path = f.filename ?? '';\n\treturn new GitFileChange(\n\t\trepoPath,\n\t\tpath,\n\t\tfromCommitFileStatus(f.status) ?? GitFileIndexStatus.Modified,\n\t\tjoinUriPath(repoUri, normalizePath(path)),\n\t\tf.previous_filename,\n\t\tf.previous_filename != null ? joinUriPath(repoUri, normalizePath(f.previous_filename)) : undefined,\n\t\tundefined,\n\t\t{\n\t\t\tadditions: f.additions ?? 0,\n\t\t\tdeletions: f.deletions ?? 0,\n\t\t\tchanges: f.changes ?? 0,\n\t\t},\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgCA,SAAS,SAAS,MAAc,QAAiD;CAChF,OAAQ,UAAU,QAAQ,SAAS,UAAW,KAAA;AAC/C;AAEA,IAAa,wBAAb,MAAoE;CAEjD;CAC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AAuKF,SAAS,aAAa,SAAc,UAAkB,GAAyD;CAC9G,MAAM,OAAO,EAAE,YAAY;CAC3B,OAAO,IAAI,cACV,UACA,MACA,qBAAqB,EAAE,MAAM,KAAK,mBAAmB,UACrD,YAAY,SAAS,cAAc,IAAI,CAAC,GACxC,EAAE,mBACF,EAAE,qBAAqB,OAAO,YAAY,SAAS,cAAc,EAAE,iBAAiB,CAAC,IAAI,KAAA,GACzF,KAAA,GACA;EACC,WAAW,EAAE,aAAa;EAC1B,WAAW,EAAE,aAAa;EAC1B,SAAS,EAAE,WAAW;CACvB,CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"commits.js","names":[],"sources":["../../../../../../plus/git-github/src/providers/github/commits.ts"],"sourcesContent":["import type { Cache } from '@gitlens/git/cache.js';\nimport { GitCommit, GitCommitIdentity } from '@gitlens/git/models/commit.js';\nimport { GitFileChange } from '@gitlens/git/models/fileChange.js';\nimport { GitFileIndexStatus } from '@gitlens/git/models/fileStatus.js';\nimport type { GitLog } from '@gitlens/git/models/log.js';\nimport type { GitRevisionRange } from '@gitlens/git/models/revision.js';\nimport { deletedOrMissing } from '@gitlens/git/models/revision.js';\nimport type { SearchQuery } from '@gitlens/git/models/search.js';\nimport type { GitUser } from '@gitlens/git/models/user.js';\nimport type {\n\tGitCommitsSubProvider,\n\tGitLogForPathOptions,\n\tGitLogOptions,\n\tGitLogShasOptions,\n\tGitRefExclusions,\n\tGitSearchCommitsOptions,\n\tLeftRightCommitCountResult,\n\tSearchCommitsResult,\n} from '@gitlens/git/providers/commits.js';\nimport { createUncommittedChangesCommit } from '@gitlens/git/utils/commit.utils.js';\nimport { createRevisionRange, isUncommitted, stripOrigin } from '@gitlens/git/utils/revision.utils.js';\nimport { parseSearchQueryGitHubCommand } from '@gitlens/git/utils/search.utils.js';\nimport { debug } from '@gitlens/utils/decorators/log.js';\nimport { first, last, map, some } from '@gitlens/utils/iterable.js';\nimport { getScopedLogger } from '@gitlens/utils/logger.scoped.js';\nimport { isFolderGlob, normalizePath, stripFolderGlob } from '@gitlens/utils/path.js';\nimport type { Uri } from '@gitlens/utils/uri.js';\nimport { coerceUri, joinUriPath } from '@gitlens/utils/uri.js';\nimport { toTokenInfo } from '../../api/tokenUtils.js';\nimport type { GitHubCommit } from '../../models.js';\nimport { fromCommitFileStatus } from '../../models.js';\nimport type { GitHubGitProviderInternal } from '../githubProvider.js';\n\nfunction isViewer(name: string, viewer: string | undefined): boolean | undefined {\n\treturn (viewer != null && name === viewer) || undefined;\n}\n\nexport class CommitsGitSubProvider implements GitCommitsSubProvider {\n\tconstructor(\n\t\tprivate readonly cache: Cache,\n\t\tprivate readonly provider: GitHubGitProviderInternal,\n\t) {}\n\n\t@debug()\n\tgetCommit(repoPath: string, rev: string, _cancellation?: AbortSignal): Promise<GitCommit | undefined> {\n\t\tif (repoPath == null) return Promise.resolve(undefined);\n\n\t\t// Don't cache uncommitted-changes synthesis — it's date-sensitive\n\t\tif (isUncommitted(rev, true)) {\n\t\t\treturn (async () => {\n\t\t\t\treturn createUncommittedChangesCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\trev,\n\t\t\t\t\tnew Date(),\n\t\t\t\t\tawait this.provider.config.getCurrentUser(repoPath),\n\t\t\t\t);\n\t\t\t})();\n\t\t}\n\n\t\t// TODO: resolve symbolic refs (HEAD, branch names) to SHA before caching to avoid\n\t\t// short staleness windows. For now we cascade-clear on 'branch'/'branches'.\n\t\treturn this.cache.commit.getOrCreate(repoPath, stripOrigin(rev), async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\ttry {\n\t\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\t\tconst commit = await github.getCommit(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(rev),\n\t\t\t\t);\n\t\t\t\tif (commit == null) return undefined;\n\n\t\t\t\tconst repoUri = coerceUri(repoPath);\n\n\t\t\t\tconst { viewer = session.account.label } = commit;\n\n\t\t\t\treturn new GitCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\tcommit.oid,\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\tcommit.message,\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.files?.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t},\n\t\t\t\t\t[],\n\t\t\t\t);\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tgetCommitCount(\n\t\trepoPath: string,\n\t\trev: string,\n\t\toptions?: { excluding?: GitRefExclusions },\n\t\t_cancellation?: AbortSignal,\n\t): Promise<number | undefined> {\n\t\tif (repoPath == null) return Promise.resolve(undefined);\n\t\t// GitHub can't count against other refs, and a plain count would be the wrong answer\n\t\tif (options?.excluding != null) return Promise.resolve(undefined);\n\n\t\treturn this.cache.commitCount.getOrCreate(repoPath, stripOrigin(rev), async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\ttry {\n\t\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\t\tconst count = await github.getCommitCount(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(rev),\n\t\t\t\t);\n\n\t\t\t\treturn count;\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tasync getCommitFiles(repoPath: string, rev: string, _cancellation?: AbortSignal): Promise<GitFileChange[]> {\n\t\tif (rev === deletedOrMissing || isUncommitted(rev)) return [];\n\n\t\tconst commit = await this.getCommit(repoPath, rev);\n\t\treturn [...(commit?.fileset?.files ?? [])];\n\t}\n\n\t@debug()\n\tasync getCommitForFile(\n\t\trepoPath: string,\n\t\tpathOrUri: string | Uri,\n\t\trev?: string | undefined,\n\t\t_options?: { firstIfNotFound?: boolean },\n\t\t_cancellation?: AbortSignal,\n\t): Promise<GitCommit | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\tconst rootUri = this.provider.getProviderRootUri(this.provider.getAbsoluteUri(pathOrUri, repoPath));\n\t\tconst file = this.provider.getRelativePath(this.provider.getAbsoluteUri(pathOrUri, repoPath), rootUri);\n\n\t\t// Resolve HEAD/empty rev to the metadata revision so the cache key is stable across callers\n\t\tconst resolvedRev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\t\t// Path-scoped variant lives in the same slot as `getCommit` but with a `|file` suffix to\n\t\t// keep it distinct from the unscoped commit entry.\n\t\tconst cacheKey = `${stripOrigin(resolvedRev)}|${file}`;\n\n\t\treturn this.cache.commit.getOrCreate(repoPath, cacheKey, async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\ttry {\n\t\t\t\tconst commit = await github.getCommitForFile(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(resolvedRev),\n\t\t\t\t\tfile,\n\t\t\t\t);\n\t\t\t\tif (commit == null) return undefined;\n\n\t\t\t\tconst repoUri = coerceUri(repoPath);\n\t\t\t\tconst { viewer = session.account.label } = commit;\n\n\t\t\t\treturn new GitCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\tcommit.oid,\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\tcommit.message,\n\t\t\t\t\tcommit.files != null\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tfiles: undefined,\n\t\t\t\t\t\t\t\tfiltered: {\n\t\t\t\t\t\t\t\t\tfiles: commit.files?.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t\t\t\t\tpathspec: file,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t},\n\t\t\t\t\t[],\n\t\t\t\t);\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tgetLeftRightCommitCount(\n\t\trepoPath: string,\n\t\trange: GitRevisionRange,\n\t\t_options?: { authors?: GitUser[]; excludeMerges?: boolean },\n\t\t_cancellation?: AbortSignal,\n\t): Promise<LeftRightCommitCountResult | undefined> {\n\t\tif (repoPath == null) return Promise.resolve(undefined);\n\n\t\treturn this.cache.leftRightCommitCount.getOrCreate(repoPath, stripOrigin(range), async () => {\n\t\t\tconst scope = getScopedLogger();\n\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\ttry {\n\t\t\t\tconst result = await github.getComparison(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstripOrigin(range),\n\t\t\t\t);\n\n\t\t\t\tif (result == null) return undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\tleft: result.behind_by,\n\t\t\t\t\tright: result.ahead_by,\n\t\t\t\t};\n\t\t\t} catch (ex) {\n\t\t\t\tscope?.error(ex);\n\t\t\t\tdebugger;\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t});\n\t}\n\n\t@debug()\n\tasync getLog(\n\t\trepoPath: string,\n\t\trev?: string | undefined,\n\t\toptions?: GitLogOptions,\n\t\t_cancellation?: AbortSignal,\n\t): Promise<GitLog | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tconst scope = getScopedLogger();\n\n\t\tconst limit = this.provider.getPagingLimit(options?.limit);\n\n\t\ttry {\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\trev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\t\t\tconst result = await github.getCommits(\n\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\tmetadata.repo.owner,\n\t\t\t\tmetadata.repo.name,\n\t\t\t\tstripOrigin(rev),\n\t\t\t\t{\n\t\t\t\t\tall: options?.all,\n\t\t\t\t\tauthors: options?.authors,\n\t\t\t\t\tafter: options?.cursor,\n\t\t\t\t\tlimit: limit,\n\t\t\t\t\tsince: options?.since ? new Date(options.since) : undefined,\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tconst commits = new Map<string, GitCommit>();\n\t\t\tconst repoUri = coerceUri(repoPath);\n\n\t\t\tconst { viewer = session.account.label } = result;\n\t\t\tfor (const commit of result.values) {\n\t\t\t\tlet c = commits.get(commit.oid);\n\t\t\t\tif (c == null) {\n\t\t\t\t\tc = new GitCommit(\n\t\t\t\t\t\trepoPath,\n\t\t\t\t\t\tcommit.oid,\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\t\tcommit.message,\n\t\t\t\t\t\tcommit.files != null\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfiles: commit.files.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[],\n\t\t\t\t\t);\n\t\t\t\t\tcommits.set(commit.oid, c);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst log: GitLog = {\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: rev,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: limit,\n\t\t\t\thasMore: result.paging?.more ?? false,\n\t\t\t\tendingCursor: result.paging?.cursor,\n\t\t\t\tquery: (limit: number | undefined) => this.getLog(repoPath, rev, { ...options, limit: limit }),\n\t\t\t};\n\n\t\t\tif (log.hasMore) {\n\t\t\t\tlog.more = this.getLogMoreFn(log, rev, options);\n\t\t\t}\n\n\t\t\treturn log;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate getLogMoreFn(\n\t\tlog: GitLog,\n\t\trev: string | undefined,\n\t\toptions?: GitLogOptions,\n\t): (limit: number | { until: string } | undefined) => Promise<GitLog> {\n\t\treturn async (limit: number | { until: string } | undefined) => {\n\t\t\tconst moreUntil = limit != null && typeof limit === 'object' ? limit.until : undefined;\n\t\t\tlet moreLimit = typeof limit === 'number' ? limit : undefined;\n\n\t\t\tif (moreUntil && some(log.commits.values(), c => c.ref === moreUntil)) {\n\t\t\t\treturn log;\n\t\t\t}\n\n\t\t\tmoreLimit = this.provider.getPagingLimit(moreLimit);\n\n\t\t\tconst moreLog = await this.getLog(log.repoPath, rev, {\n\t\t\t\t...options,\n\t\t\t\tlimit: moreLimit,\n\t\t\t\tcursor: log.endingCursor,\n\t\t\t});\n\t\t\t// If we can't find any more, assume we have everything\n\t\t\tif (moreLog == null) return { ...log, hasMore: false, more: undefined };\n\n\t\t\tconst commits = new Map([...log.commits, ...moreLog.commits]);\n\n\t\t\tconst mergedLog: GitLog = {\n\t\t\t\trepoPath: log.repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: log.sha,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: moreUntil == null ? (log.limit ?? 0) + moreLimit : undefined,\n\t\t\t\thasMore: moreUntil == null ? moreLog.hasMore : true,\n\t\t\t\t// The oldest commit SHA of the previous page — the graph webview compares this\n\t\t\t\t// against its last displayed row to determine the merge point for appending new rows\n\t\t\t\tstartingCursor: last(log.commits)?.[0],\n\t\t\t\tendingCursor: moreLog.endingCursor,\n\t\t\t\tpagedCommits: () => {\n\t\t\t\t\t// Remove any duplicates\n\t\t\t\t\tfor (const sha of log.commits.keys()) {\n\t\t\t\t\t\tmoreLog.commits.delete(sha);\n\t\t\t\t\t}\n\t\t\t\t\treturn moreLog.commits;\n\t\t\t\t},\n\t\t\t\tquery: log.query,\n\t\t\t};\n\t\t\tif (mergedLog.hasMore) {\n\t\t\t\tmergedLog.more = this.getLogMoreFn(mergedLog, rev, options);\n\t\t\t}\n\n\t\t\treturn mergedLog;\n\t\t};\n\t}\n\n\t@debug()\n\tasync getLogForPath(\n\t\trepoPath: string,\n\t\tpathOrUri: string | Uri,\n\t\trev?: string | undefined,\n\t\toptions?: GitLogForPathOptions,\n\t\t_cancellation?: AbortSignal,\n\t): Promise<GitLog | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tlet relativePath = this.provider.getRelativePath(pathOrUri, repoPath);\n\n\t\tif (repoPath != null && repoPath === relativePath) {\n\t\t\tthrow new Error(`Path cannot match the repository path; path=${relativePath}`);\n\t\t}\n\n\t\toptions = {\n\t\t\t...options,\n\t\t\tall: false /* not supported */,\n\t\t\tlimit: this.provider.getPagingLimit(options?.limit),\n\t\t\trenames: false /* not supported */,\n\t\t};\n\n\t\tif (isFolderGlob(relativePath)) {\n\t\t\trelativePath = stripFolderGlob(relativePath);\n\t\t\toptions.isFolder = true;\n\t\t} else if (options.isFolder == null) {\n\t\t\tconst tree = await this.provider.revision.getTreeEntryForRevision(repoPath, relativePath, rev || 'HEAD');\n\t\t\toptions.isFolder = tree?.type === 'tree';\n\t\t}\n\n\t\t// Note: document caching (TrackedGitDocument) is handled by the extension wrapper.\n\t\t// The library implementation always fetches fresh data.\n\t\treturn this.getLogForPathCore(repoPath, relativePath, rev, options);\n\t}\n\n\tprivate async getLogForPathCore(\n\t\trepoPath: string,\n\t\tpath: string,\n\t\trev: string | undefined,\n\t\toptions: GitLogForPathOptions,\n\t): Promise<GitLog | undefined> {\n\t\tif (repoPath == null) return undefined;\n\n\t\tconst limit = this.provider.getPagingLimit(options.limit);\n\n\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\tif (context == null) return undefined;\n\n\t\tconst { metadata, github, session } = context;\n\n\t\tconst uri = this.provider.getAbsoluteUri(path, repoPath);\n\t\tconst relativePath = this.provider.getRelativePath(uri, this.provider.getProviderRootUri(uri));\n\n\t\trev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\t\tconst result = await github.getCommits(\n\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\tmetadata.repo.owner,\n\t\t\tmetadata.repo.name,\n\t\t\tstripOrigin(rev),\n\t\t\t{\n\t\t\t\tall: options.all,\n\t\t\t\tafter: options.cursor,\n\t\t\t\tpath: relativePath,\n\t\t\t\tlimit: limit,\n\t\t\t\tsince: options.since ? new Date(options.since) : undefined,\n\t\t\t},\n\t\t);\n\n\t\tconst repoUri = coerceUri(repoPath);\n\t\tconst commits = new Map<string, GitCommit>();\n\n\t\tconst { viewer = session.account.label } = result;\n\t\tfor (const commit of result.values) {\n\t\t\tlet c = commits.get(commit.oid);\n\t\t\tif (c == null) {\n\t\t\t\tconst files = commit.files?.map(f => toFileChange(repoUri, repoPath, f));\n\n\t\t\t\tif (files != null && !options.isFolder && commit.changedFiles === 1) {\n\t\t\t\t\tconst index = files.findIndex(f => f.path === relativePath);\n\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\tfiles.splice(\n\t\t\t\t\t\t\tindex,\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tnew GitFileChange(\n\t\t\t\t\t\t\t\trepoPath,\n\t\t\t\t\t\t\t\trelativePath,\n\t\t\t\t\t\t\t\tGitFileIndexStatus.Modified,\n\t\t\t\t\t\t\t\tjoinUriPath(repoUri, normalizePath(relativePath)),\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tcommit.changedFiles === 1\n\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t\t\t\t\t\t\tchanges: 0,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tc = new GitCommit(\n\t\t\t\t\trepoPath,\n\t\t\t\t\tcommit.oid,\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t),\n\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\tcommit.message,\n\t\t\t\t\t{ files: undefined, filtered: { files: files, pathspec: relativePath } },\n\t\t\t\t\t{\n\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t},\n\t\t\t\t\t[],\n\t\t\t\t);\n\t\t\t\tcommits.set(commit.oid, c);\n\t\t\t}\n\t\t}\n\n\t\tconst log: GitLog = {\n\t\t\trepoPath: repoPath,\n\t\t\tcommits: commits,\n\t\t\tsha: rev,\n\t\t\tcount: commits.size,\n\t\t\tlimit: limit,\n\t\t\thasMore: result.paging?.more ?? false,\n\t\t\tendingCursor: result.paging?.cursor,\n\t\t\tquery: (limit: number | undefined) => this.getLogForPath(repoPath, path, rev, { ...options, limit: limit }),\n\t\t};\n\t\tif (log.hasMore) {\n\t\t\tlog.more = this.getLogForPathMoreFn(log, path, rev, options);\n\t\t}\n\n\t\treturn log;\n\t}\n\n\tprivate getLogForPathMoreFn(\n\t\tlog: GitLog,\n\t\trelativePath: string,\n\t\trev: string | undefined,\n\t\toptions: GitLogForPathOptions,\n\t): (limit: number | { until: string } | undefined) => Promise<GitLog> {\n\t\treturn async (limit: number | { until: string } | undefined) => {\n\t\t\tconst moreUntil = limit != null && typeof limit === 'object' ? limit.until : undefined;\n\t\t\tlet moreLimit = typeof limit === 'number' ? limit : undefined;\n\n\t\t\tif (moreUntil && some(log.commits.values(), c => c.ref === moreUntil)) {\n\t\t\t\treturn log;\n\t\t\t}\n\n\t\t\tmoreLimit = this.provider.getPagingLimit(moreLimit);\n\n\t\t\tconst moreLog = await this.getLogForPath(log.repoPath, relativePath, rev, {\n\t\t\t\t...options,\n\t\t\t\tlimit: moreUntil == null ? moreLimit : 0,\n\t\t\t\tcursor: log.endingCursor,\n\t\t\t});\n\t\t\t// If we can't find any more, assume we have everything\n\t\t\tif (moreLog == null) return { ...log, hasMore: false, more: undefined };\n\n\t\t\tconst commits = new Map([...log.commits, ...moreLog.commits]);\n\n\t\t\tconst mergedLog: GitLog = {\n\t\t\t\trepoPath: log.repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: log.sha,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: moreUntil == null ? (log.limit ?? 0) + moreLimit : undefined,\n\t\t\t\thasMore: moreUntil == null ? moreLog.hasMore : true,\n\t\t\t\tendingCursor: moreLog.endingCursor,\n\t\t\t\tquery: log.query,\n\t\t\t};\n\n\t\t\tif (mergedLog.hasMore) {\n\t\t\t\tmergedLog.more = this.getLogForPathMoreFn(mergedLog, relativePath, rev, options);\n\t\t\t}\n\n\t\t\treturn mergedLog;\n\t\t};\n\t}\n\n\t@debug()\n\tasync getLogShas(\n\t\trepoPath: string,\n\t\trev?: string | undefined,\n\t\toptions?: GitLogShasOptions,\n\t\tcancellation?: AbortSignal,\n\t): Promise<Iterable<string>> {\n\t\tif (repoPath == null) return [];\n\t\t// GitHub can't evaluate `--not`, and an unfiltered list would be the wrong answer\n\t\tif (options?.excluding != null) return [];\n\n\t\tconst scope = getScopedLogger();\n\n\t\t// `authors` and `all` filters aren't supported by the lightweight SHA-only query;\n\t\t// fall back to the full log path when set.\n\t\tif (options?.authors?.length || options?.all) {\n\t\t\tlet log: GitLog | undefined;\n\t\t\tif (options?.pathOrUri != null) {\n\t\t\t\tlog = await this.getLogForPath(repoPath, options.pathOrUri, rev, options, cancellation);\n\t\t\t} else {\n\t\t\t\tlog = await this.getLog(repoPath, rev, options, cancellation);\n\t\t\t}\n\t\t\tif (log == null) return [];\n\n\t\t\tconst shas = map(log.commits.values(), c => c.ref);\n\t\t\t// Note: reversal only applies to the first page — subsequent pages loaded via pagination are not reversed\n\t\t\treturn options?.reverse ? [...shas].reverse() : shas;\n\t\t}\n\n\t\tconst limit = this.provider.getPagingLimit(options?.limit);\n\n\t\ttry {\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\trev = !rev || rev === 'HEAD' ? (await metadata.getRevision()).revision : rev;\n\n\t\t\tlet path: string | undefined;\n\t\t\tif (options?.pathOrUri != null) {\n\t\t\t\tconst rootUri = this.provider.getProviderRootUri(\n\t\t\t\t\tthis.provider.getAbsoluteUri(options.pathOrUri, repoPath),\n\t\t\t\t);\n\t\t\t\tpath = this.provider.getRelativePath(\n\t\t\t\t\tthis.provider.getAbsoluteUri(options.pathOrUri, repoPath),\n\t\t\t\t\trootUri,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst strippedRev = stripOrigin(rev);\n\t\t\tconst sinceISO = options?.since ? new Date(options.since).toISOString() : '';\n\t\t\tconst cacheKey = `${strippedRev}|${path ?? ''}|${sinceISO}|${limit}|${options?.cursor ?? ''}`;\n\n\t\t\tconst shas = await this.cache.logShas.getOrCreate(repoPath, cacheKey, async () => {\n\t\t\t\tconst result = await github.getCommitShas(\n\t\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\t\tmetadata.repo.owner,\n\t\t\t\t\tmetadata.repo.name,\n\t\t\t\t\tstrippedRev,\n\t\t\t\t\t{\n\t\t\t\t\t\tafter: options?.cursor,\n\t\t\t\t\t\tlimit: limit,\n\t\t\t\t\t\tpath: path,\n\t\t\t\t\t\tsince: options?.since ? new Date(options.since) : undefined,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t\treturn result.values;\n\t\t\t});\n\n\t\t\t// Note: reversal only applies to the first page — subsequent pages loaded via pagination are not reversed\n\t\t\treturn options?.reverse ? shas.toReversed() : shas;\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t@debug()\n\tgetOldestUnpushedShaForPath(\n\t\t_repoPath: string,\n\t\t_pathOrUri: string | Uri,\n\t\t_cancellation?: AbortSignal,\n\t): Promise<string | undefined> {\n\t\t// TODO@eamodio until we have access to the RemoteHub change store there isn't anything we can do here\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\t@debug()\n\thasCommitBeenPushed(_repoPath: string, _rev: string, _cancellation?: AbortSignal): Promise<boolean> {\n\t\t// In this env we can't have unpushed commits\n\t\treturn Promise.resolve(true);\n\t}\n\n\t@debug()\n\tasync isAncestorOf(repoPath: string, rev1: string, rev2: string, _cancellation?: AbortSignal): Promise<boolean> {\n\t\tif (repoPath == null) return false;\n\n\t\tconst scope = getScopedLogger();\n\n\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\ttry {\n\t\t\tconst result = await github.getComparison(\n\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\tmetadata.repo.owner,\n\t\t\t\tmetadata.repo.name,\n\t\t\t\tcreateRevisionRange(stripOrigin(rev1), stripOrigin(rev2), '...'),\n\t\t\t);\n\n\t\t\tswitch (result?.status) {\n\t\t\t\tcase 'ahead':\n\t\t\t\tcase 'diverged':\n\t\t\t\t\treturn false;\n\t\t\t\tcase 'identical':\n\t\t\t\tcase 'behind':\n\t\t\t\t\treturn true;\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t@debug({\n\t\targs: (repoPath, s) => ({\n\t\t\trepoPath: repoPath,\n\t\t\tsearch: `[${s.matchAll ? 'A' : ''}${s.matchCase ? 'C' : ''}${s.matchRegex ? 'R' : ''}${\n\t\t\t\ts.matchWholeWord ? 'W' : ''\n\t\t\t}]: ${s.query.length > 500 ? `${s.query.substring(0, 500)}...` : s.query}`,\n\t\t}),\n\t})\n\tasync searchCommits(\n\t\trepoPath: string,\n\t\tsearch: SearchQuery,\n\t\toptions?: GitSearchCommitsOptions,\n\t\tcancellation?: AbortSignal,\n\t): Promise<SearchCommitsResult> {\n\t\tif (repoPath == null) return { search: search, log: undefined };\n\n\t\tconst scope = getScopedLogger();\n\n\t\tsearch = { matchAll: false, matchCase: false, matchRegex: true, matchWholeWord: false, ...search };\n\t\t// Note: Natural language processing is handled by the extension wrapper.\n\n\t\tconst currentUser = search.query.includes('@me')\n\t\t\t? await this.provider.config.getCurrentUser(repoPath)\n\t\t\t: undefined;\n\t\tif (cancellation?.aborted) return { search: search, log: undefined };\n\n\t\tconst { args: queryArgs, operations } = parseSearchQueryGitHubCommand(search, currentUser);\n\n\t\tconst values = operations.get('commit:');\n\t\tif (values?.size) {\n\t\t\tconst commit = await this.getCommit(repoPath, first(values)!);\n\t\t\tif (commit == null) return { search: search, log: undefined };\n\n\t\t\treturn {\n\t\t\t\tsearch: search,\n\t\t\t\tlog: {\n\t\t\t\t\trepoPath: repoPath,\n\t\t\t\t\tcommits: new Map([[commit.sha, commit]]),\n\t\t\t\t\tsha: commit.sha,\n\t\t\t\t\tcount: 1,\n\t\t\t\t\tlimit: 1,\n\t\t\t\t\thasMore: false,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tif (!queryArgs.length) return { search: search, log: undefined };\n\n\t\tconst limit = this.provider.getPagingLimit(options?.limit);\n\n\t\ttry {\n\t\t\tconst { metadata, github, session } = await this.provider.ensureRepositoryContext(repoPath);\n\n\t\t\tconst query = `repo:${metadata.repo.owner}/${metadata.repo.name}+${queryArgs.join('+').trim()}`;\n\n\t\t\tconst result = await github.searchCommits(\n\t\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\t\tquery,\n\t\t\t\t{\n\t\t\t\t\tcursor: options?.cursor,\n\t\t\t\t\tlimit: limit,\n\t\t\t\t\tsort:\n\t\t\t\t\t\toptions?.ordering === 'date'\n\t\t\t\t\t\t\t? 'committer-date'\n\t\t\t\t\t\t\t: options?.ordering === 'author-date'\n\t\t\t\t\t\t\t\t? 'author-date'\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t},\n\t\t\t);\n\t\t\tif (result == null) return { search: search, log: undefined };\n\n\t\t\tconst commits = new Map<string, GitCommit>();\n\t\t\tconst repoUri = coerceUri(repoPath);\n\n\t\t\tconst viewer = session.account.label;\n\t\t\tfor (const commit of result.values) {\n\t\t\t\tlet c = commits.get(commit.oid);\n\t\t\t\tif (c == null) {\n\t\t\t\t\tc = new GitCommit(\n\t\t\t\t\t\trepoPath,\n\t\t\t\t\t\tcommit.oid,\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.author.name,\n\t\t\t\t\t\t\tcommit.author.email,\n\t\t\t\t\t\t\tnew Date(commit.author.date),\n\t\t\t\t\t\t\tcommit.author.avatarUrl,\n\t\t\t\t\t\t\tisViewer(commit.author.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnew GitCommitIdentity(\n\t\t\t\t\t\t\tcommit.committer.name,\n\t\t\t\t\t\t\tcommit.committer.email,\n\t\t\t\t\t\t\tnew Date(commit.committer.date),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tisViewer(commit.committer.name, viewer),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcommit.message.split('\\n', 1)[0],\n\t\t\t\t\t\tcommit.parents.nodes.map(p => p.oid),\n\t\t\t\t\t\tcommit.message,\n\t\t\t\t\t\tcommit.files != null\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tfiles: commit.files.map(f => toFileChange(repoUri, repoPath, f)),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfiles: commit.changedFiles ?? 0,\n\t\t\t\t\t\t\tadditions: commit.additions ?? 0,\n\t\t\t\t\t\t\tdeletions: commit.deletions ?? 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[],\n\t\t\t\t\t);\n\t\t\t\t\tcommits.set(commit.oid, c);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst log: GitLog = {\n\t\t\t\trepoPath: repoPath,\n\t\t\t\tcommits: commits,\n\t\t\t\tsha: undefined,\n\t\t\t\tcount: commits.size,\n\t\t\t\tlimit: limit,\n\t\t\t\thasMore: result.pageInfo?.hasNextPage ?? false,\n\t\t\t\tendingCursor: result.pageInfo?.endCursor ?? undefined,\n\t\t\t\tquery: (limit: number | undefined) =>\n\t\t\t\t\tthis.searchCommits(repoPath, search, { ...options, limit: limit }).then(r => r.log!),\n\t\t\t};\n\n\t\t\tif (log.hasMore) {\n\t\t\t\tconst searchCommitsCore = (log: GitLog): ((limit: number | undefined) => Promise<GitLog>) => {\n\t\t\t\t\treturn async (limit: number | undefined) => {\n\t\t\t\t\t\tlimit = this.provider.getPagingLimit(limit);\n\n\t\t\t\t\t\tconst moreLog = (\n\t\t\t\t\t\t\tawait this.searchCommits(log.repoPath, search, {\n\t\t\t\t\t\t\t\t...options,\n\t\t\t\t\t\t\t\tlimit: limit,\n\t\t\t\t\t\t\t\tcursor: log.endingCursor,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).log;\n\t\t\t\t\t\t// If we can't find any more, assume we have everything\n\t\t\t\t\t\tif (moreLog == null) return { ...log, hasMore: false, more: undefined };\n\n\t\t\t\t\t\tconst commits = new Map([...log.commits, ...moreLog.commits]);\n\n\t\t\t\t\t\tconst mergedLog: GitLog = {\n\t\t\t\t\t\t\trepoPath: log.repoPath,\n\t\t\t\t\t\t\tcommits: commits,\n\t\t\t\t\t\t\tsha: log.sha,\n\t\t\t\t\t\t\tcount: commits.size,\n\t\t\t\t\t\t\tlimit: (log.limit ?? 0) + limit,\n\t\t\t\t\t\t\thasMore: moreLog.hasMore,\n\t\t\t\t\t\t\tendingCursor: moreLog.endingCursor,\n\t\t\t\t\t\t\tquery: log.query,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tif (mergedLog.hasMore) {\n\t\t\t\t\t\t\tmergedLog.more = searchCommitsCore(mergedLog);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn mergedLog;\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\tlog.more = searchCommitsCore(log);\n\t\t\t}\n\n\t\t\treturn { search: search, log: log };\n\t\t} catch (ex) {\n\t\t\tscope?.error(ex);\n\t\t\tdebugger;\n\t\t\treturn { search: search, log: undefined };\n\t\t}\n\t}\n}\n\n/** Converts a GitHub API file entry to a library GitFileChange */\nfunction toFileChange(repoUri: Uri, repoPath: string, f: NonNullable<GitHubCommit['files']>[0]): GitFileChange {\n\tconst path = f.filename ?? '';\n\treturn new GitFileChange(\n\t\trepoPath,\n\t\tpath,\n\t\tfromCommitFileStatus(f.status) ?? GitFileIndexStatus.Modified,\n\t\tjoinUriPath(repoUri, normalizePath(path)),\n\t\tf.previous_filename,\n\t\tf.previous_filename != null ? joinUriPath(repoUri, normalizePath(f.previous_filename)) : undefined,\n\t\tundefined,\n\t\t{\n\t\t\tadditions: f.additions ?? 0,\n\t\t\tdeletions: f.deletions ?? 0,\n\t\t\tchanges: f.changes ?? 0,\n\t\t},\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiCA,SAAS,SAAS,MAAc,QAAiD;CAChF,OAAQ,UAAU,QAAQ,SAAS,UAAW,KAAA;AAC/C;AAEA,IAAa,wBAAb,MAAoE;CAEjD;CACA;CAFlB,YACC,OACA,UACC;EAFgB,KAAA,QAAA;EACA,KAAA,WAAA;CACf;CAEH,UACU,UAAkB,KAAa,eAA6D;EACrG,IAAI,YAAY,MAAM,OAAO,QAAQ,QAAQ,KAAA,CAAS;EAGtD,IAAI,cAAc,KAAK,IAAI,GAC1B,QAAQ,YAAY;GACnB,OAAO,+BACN,UACA,qBACA,IAAI,KAAK,GACT,MAAM,KAAK,SAAS,OAAO,eAAe,QAAQ,CACnD;EACD,EAAA,CAAG;EAKJ,OAAO,KAAK,MAAM,OAAO,YAAY,UAAU,YAAY,GAAG,GAAG,YAAY;GAC5E,MAAM,QAAQ,gBAAgB;GAE9B,IAAI;IACH,MAAM,EAAE,UAAU,QAAQ,YAAY,MAAM,K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CACvB,CACD;AACD"}
|
|
@@ -6,6 +6,7 @@ import { GitHubGitProviderInternal } from "../githubProvider.js";
|
|
|
6
6
|
export declare class RevisionGitSubProvider implements GitRevisionSubProvider {
|
|
7
7
|
private readonly provider;
|
|
8
8
|
constructor(provider: GitHubGitProviderInternal);
|
|
9
|
+
getEmptyTreeSha(_repoPath: string): Promise<string>;
|
|
9
10
|
getRevisionContent(repoPath: string, path: string, rev: string): Promise<Uint8Array | undefined>;
|
|
10
11
|
getTreeEntryForRevision(repoPath: string, path: string, rev: string): Promise<GitTreeEntry | undefined>;
|
|
11
12
|
getTrackedFiles(repoPath: string): Promise<string[]>;
|
|
@@ -6,11 +6,16 @@ import { FileType } from "../../../../git/context.js";
|
|
|
6
6
|
import { gate } from "../../../../utils/decorators/gate.js";
|
|
7
7
|
import { toTokenInfo } from "../../api/tokenUtils.js";
|
|
8
8
|
//#region ../plus/git-github/src/providers/github/revision.ts
|
|
9
|
+
/** GitHub repositories are always SHA-1 */
|
|
10
|
+
const sha1EmptyTreeSha = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
|
|
9
11
|
var RevisionGitSubProvider = class {
|
|
10
12
|
provider;
|
|
11
13
|
constructor(provider) {
|
|
12
14
|
this.provider = provider;
|
|
13
15
|
}
|
|
16
|
+
getEmptyTreeSha(_repoPath) {
|
|
17
|
+
return Promise.resolve(sha1EmptyTreeSha);
|
|
18
|
+
}
|
|
14
19
|
getRevisionContent(repoPath, path, rev) {
|
|
15
20
|
const uri = rev ? this.provider.createProviderUri(repoPath, rev, path) : this.provider.createVirtualUri(repoPath, rev, path);
|
|
16
21
|
return this.provider.context.fs.readFile(uri);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision.js","names":[],"sources":["../../../../../../plus/git-github/src/providers/github/revision.ts"],"sourcesContent":["import { FileType } from '@gitlens/git/context.js';\nimport { deletedOrMissing } from '@gitlens/git/models/revision.js';\nimport type { GitTreeEntry } from '@gitlens/git/models/tree.js';\nimport type { GitRevisionSubProvider, ResolvedRevision } from '@gitlens/git/providers/revision.js';\nimport {\n\tisRevisionWithSuffix,\n\tisSha,\n\tisUncommitted,\n\tisUncommittedWithParentSuffix,\n\tstripOrigin,\n} from '@gitlens/git/utils/revision.utils.js';\nimport { gate } from '@gitlens/utils/decorators/gate.js';\nimport { debug } from '@gitlens/utils/decorators/log.js';\nimport type { Uri } from '@gitlens/utils/uri.js';\nimport { toTokenInfo } from '../../api/tokenUtils.js';\nimport type { GitHubGitProviderInternal } from '../githubProvider.js';\n\nexport class RevisionGitSubProvider implements GitRevisionSubProvider {\n\tconstructor(private readonly provider: GitHubGitProviderInternal) {}\n\n\t@gate()\n\t@debug()\n\tgetRevisionContent(repoPath: string, path: string, rev: string): Promise<Uint8Array | undefined> {\n\t\tconst uri = rev\n\t\t\t? this.provider.createProviderUri(repoPath, rev, path)\n\t\t\t: this.provider.createVirtualUri(repoPath, rev, path);\n\n\t\treturn this.provider.context.fs.readFile(uri);\n\t}\n\n\t@gate()\n\t@debug()\n\tasync getTreeEntryForRevision(repoPath: string, path: string, rev: string): Promise<GitTreeEntry | undefined> {\n\t\tif (repoPath == null || !path) return undefined;\n\n\t\tif (path) {\n\t\t\tpath = this.provider.getRelativePath(path, repoPath);\n\t\t}\n\n\t\tif (rev === 'HEAD') {\n\t\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\t\tif (context == null) return undefined;\n\n\t\t\tconst revision = await context.metadata.getRevision();\n\t\t\trev = revision?.revision;\n\t\t}\n\n\t\tconst uri = rev\n\t\t\t? this.provider.createProviderUri(repoPath, rev, path)\n\t\t\t: this.provider.createVirtualUri(repoPath, rev, path);\n\n\t\tconst stats = await this.provider.context.fs.stat(uri);\n\t\tif (stats == null) return undefined;\n\n\t\treturn {\n\t\t\tref: rev,\n\t\t\toid: '',\n\t\t\tpath: this.provider.getRelativePath(uri, repoPath),\n\t\t\tsize: stats.size,\n\t\t\ttype: (stats.type & FileType.Directory) !== 0 ? 'tree' : 'blob',\n\t\t};\n\t}\n\n\t@debug()\n\tasync getTrackedFiles(repoPath: string): Promise<string[]> {\n\t\tconst tree = await this.getTreeForRevision(repoPath, 'HEAD');\n\t\treturn tree.filter(f => f.type === 'blob').map(f => f.path);\n\t}\n\n\t@gate()\n\t@debug()\n\tasync getTreeForRevision(repoPath: string, rev: string): Promise<GitTreeEntry[]> {\n\t\tif (repoPath == null) return [];\n\n\t\tif (rev === 'HEAD') {\n\t\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\t\tif (context == null) return [];\n\n\t\t\tconst revision = await context.metadata.getRevision();\n\t\t\trev = revision?.revision;\n\t\t}\n\n\t\tconst baseUri = rev\n\t\t\t? this.provider.createProviderUri(repoPath, rev)\n\t\t\t: this.provider.createVirtualUri(repoPath, rev);\n\n\t\tconst entries = await this.provider.context.fs.readDirectory(baseUri);\n\t\tif (entries == null) return [];\n\n\t\tconst result: GitTreeEntry[] = [];\n\t\tfor (const [path, type] of entries) {\n\t\t\tresult.push({\n\t\t\t\tref: rev,\n\t\t\t\toid: '',\n\t\t\t\tpath: path,\n\t\t\t\tsize: 0,\n\t\t\t\ttype: (type & FileType.Directory) !== 0 ? 'tree' : 'blob',\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@debug()\n\tasync resolveRevision(\n\t\trepoPath: string,\n\t\tref: string,\n\t\tpathOrUri?: string | Uri,\n\t\t// Nothing to force here — every call resolves fresh from the GitHub API; there is no cache to bypass.\n\t\t_options?: { force?: boolean },\n\t): Promise<ResolvedRevision> {\n\t\tif (!ref || ref === deletedOrMissing) return { sha: ref, revision: ref };\n\n\t\tlet relativePath;\n\t\tif (pathOrUri == null) {\n\t\t\tif (isSha(ref)) return { sha: ref, revision: ref };\n\t\t\tif (ref.endsWith('^3')) return { sha: ref, revision: ref };\n\t\t} else {\n\t\t\tif (isUncommittedWithParentSuffix(ref)) {\n\t\t\t\tref = 'HEAD';\n\t\t\t}\n\t\t\tif (isUncommitted(ref)) return { sha: ref, revision: ref };\n\n\t\t\trelativePath = this.provider.getRelativePath(pathOrUri, repoPath);\n\t\t}\n\n\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\tif (context == null) return { sha: ref, revision: ref };\n\n\t\tconst { metadata, github, session } = context;\n\n\t\tconst sha = await github.resolveReference(\n\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\tmetadata.repo.owner,\n\t\t\tmetadata.repo.name,\n\t\t\tstripOrigin(ref),\n\t\t\trelativePath,\n\t\t);\n\n\t\tif (sha == null) {\n\t\t\treturn { sha: relativePath ? deletedOrMissing : ref, revision: ref };\n\t\t}\n\t\t// If it looks like non-sha like then preserve it as the friendly name\n\t\treturn { sha: sha, revision: isRevisionWithSuffix(ref) ? sha : ref };\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"revision.js","names":[],"sources":["../../../../../../plus/git-github/src/providers/github/revision.ts"],"sourcesContent":["import { FileType } from '@gitlens/git/context.js';\nimport { deletedOrMissing } from '@gitlens/git/models/revision.js';\nimport type { GitTreeEntry } from '@gitlens/git/models/tree.js';\nimport type { GitRevisionSubProvider, ResolvedRevision } from '@gitlens/git/providers/revision.js';\nimport {\n\tisRevisionWithSuffix,\n\tisSha,\n\tisUncommitted,\n\tisUncommittedWithParentSuffix,\n\tstripOrigin,\n} from '@gitlens/git/utils/revision.utils.js';\nimport { gate } from '@gitlens/utils/decorators/gate.js';\nimport { debug } from '@gitlens/utils/decorators/log.js';\nimport type { Uri } from '@gitlens/utils/uri.js';\nimport { toTokenInfo } from '../../api/tokenUtils.js';\nimport type { GitHubGitProviderInternal } from '../githubProvider.js';\n\n/** GitHub repositories are always SHA-1 */\nconst sha1EmptyTreeSha = '4b825dc642cb6eb9a060e54bf8d69288fbee4904';\n\nexport class RevisionGitSubProvider implements GitRevisionSubProvider {\n\tconstructor(private readonly provider: GitHubGitProviderInternal) {}\n\n\tgetEmptyTreeSha(_repoPath: string): Promise<string> {\n\t\treturn Promise.resolve(sha1EmptyTreeSha);\n\t}\n\n\t@gate()\n\t@debug()\n\tgetRevisionContent(repoPath: string, path: string, rev: string): Promise<Uint8Array | undefined> {\n\t\tconst uri = rev\n\t\t\t? this.provider.createProviderUri(repoPath, rev, path)\n\t\t\t: this.provider.createVirtualUri(repoPath, rev, path);\n\n\t\treturn this.provider.context.fs.readFile(uri);\n\t}\n\n\t@gate()\n\t@debug()\n\tasync getTreeEntryForRevision(repoPath: string, path: string, rev: string): Promise<GitTreeEntry | undefined> {\n\t\tif (repoPath == null || !path) return undefined;\n\n\t\tif (path) {\n\t\t\tpath = this.provider.getRelativePath(path, repoPath);\n\t\t}\n\n\t\tif (rev === 'HEAD') {\n\t\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\t\tif (context == null) return undefined;\n\n\t\t\tconst revision = await context.metadata.getRevision();\n\t\t\trev = revision?.revision;\n\t\t}\n\n\t\tconst uri = rev\n\t\t\t? this.provider.createProviderUri(repoPath, rev, path)\n\t\t\t: this.provider.createVirtualUri(repoPath, rev, path);\n\n\t\tconst stats = await this.provider.context.fs.stat(uri);\n\t\tif (stats == null) return undefined;\n\n\t\treturn {\n\t\t\tref: rev,\n\t\t\toid: '',\n\t\t\tpath: this.provider.getRelativePath(uri, repoPath),\n\t\t\tsize: stats.size,\n\t\t\ttype: (stats.type & FileType.Directory) !== 0 ? 'tree' : 'blob',\n\t\t};\n\t}\n\n\t@debug()\n\tasync getTrackedFiles(repoPath: string): Promise<string[]> {\n\t\tconst tree = await this.getTreeForRevision(repoPath, 'HEAD');\n\t\treturn tree.filter(f => f.type === 'blob').map(f => f.path);\n\t}\n\n\t@gate()\n\t@debug()\n\tasync getTreeForRevision(repoPath: string, rev: string): Promise<GitTreeEntry[]> {\n\t\tif (repoPath == null) return [];\n\n\t\tif (rev === 'HEAD') {\n\t\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\t\tif (context == null) return [];\n\n\t\t\tconst revision = await context.metadata.getRevision();\n\t\t\trev = revision?.revision;\n\t\t}\n\n\t\tconst baseUri = rev\n\t\t\t? this.provider.createProviderUri(repoPath, rev)\n\t\t\t: this.provider.createVirtualUri(repoPath, rev);\n\n\t\tconst entries = await this.provider.context.fs.readDirectory(baseUri);\n\t\tif (entries == null) return [];\n\n\t\tconst result: GitTreeEntry[] = [];\n\t\tfor (const [path, type] of entries) {\n\t\t\tresult.push({\n\t\t\t\tref: rev,\n\t\t\t\toid: '',\n\t\t\t\tpath: path,\n\t\t\t\tsize: 0,\n\t\t\t\ttype: (type & FileType.Directory) !== 0 ? 'tree' : 'blob',\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@debug()\n\tasync resolveRevision(\n\t\trepoPath: string,\n\t\tref: string,\n\t\tpathOrUri?: string | Uri,\n\t\t// Nothing to force here — every call resolves fresh from the GitHub API; there is no cache to bypass.\n\t\t_options?: { force?: boolean },\n\t): Promise<ResolvedRevision> {\n\t\tif (!ref || ref === deletedOrMissing) return { sha: ref, revision: ref };\n\n\t\tlet relativePath;\n\t\tif (pathOrUri == null) {\n\t\t\tif (isSha(ref)) return { sha: ref, revision: ref };\n\t\t\tif (ref.endsWith('^3')) return { sha: ref, revision: ref };\n\t\t} else {\n\t\t\tif (isUncommittedWithParentSuffix(ref)) {\n\t\t\t\tref = 'HEAD';\n\t\t\t}\n\t\t\tif (isUncommitted(ref)) return { sha: ref, revision: ref };\n\n\t\t\trelativePath = this.provider.getRelativePath(pathOrUri, repoPath);\n\t\t}\n\n\t\tconst context = await this.provider.ensureRepositoryContext(repoPath);\n\t\tif (context == null) return { sha: ref, revision: ref };\n\n\t\tconst { metadata, github, session } = context;\n\n\t\tconst sha = await github.resolveReference(\n\t\t\ttoTokenInfo(this.provider.authenticationProviderId, session),\n\t\t\tmetadata.repo.owner,\n\t\t\tmetadata.repo.name,\n\t\t\tstripOrigin(ref),\n\t\t\trelativePath,\n\t\t);\n\n\t\tif (sha == null) {\n\t\t\treturn { sha: relativePath ? deletedOrMissing : ref, revision: ref };\n\t\t}\n\t\t// If it looks like non-sha like then preserve it as the friendly name\n\t\treturn { sha: sha, revision: isRevisionWithSuffix(ref) ? sha : ref };\n\t}\n}\n"],"mappings":";;;;;;;;;AAkBA,MAAM,mBAAmB;AAEzB,IAAa,yBAAb,MAAsE;CACxC;CAA7B,YAAY,UAAsD;EAArC,KAAA,WAAA;CAAsC;CAEnE,gBAAgB,WAAoC;EACnD,OAAO,QAAQ,QAAQ,gBAAgB;CACxC;CAEA,mBAEmB,UAAkB,MAAc,KAA8C;EAChG,MAAM,MAAM,MACT,KAAK,SAAS,kBAAkB,UAAU,KAAK,IAAI,IACnD,KAAK,SAAS,iBAAiB,UAAU,KAAK,IAAI;EAErD,OAAO,KAAK,SAAS,QAAQ,GAAG,SAAS,GAAG;CAC7C;CAEA,MAEM,wBAAwB,UAAkB,MAAc,KAAgD;EAC7G,IAAI,YAAY,QAAQ,CAAC,MAAM,OAAO,KAAA;EAEtC,IAAI,MACH,OAAO,KAAK,SAAS,gBAAgB,MAAM,QAAQ;EAGpD,IAAI,QAAQ,QAAQ;GACnB,MAAM,UAAU,MAAM,KAAK,SAAS,wBAAwB,QAAQ;GACpE,IAAI,WAAW,MAAM,OAAO,KAAA;GAG5B,OAAM,MADiB,QAAQ,SAAS,YAAY,EAAA,EACpC;EACjB;EAEA,MAAM,MAAM,MACT,KAAK,SAAS,kBAAkB,UAAU,KAAK,IAAI,IACnD,KAAK,SAAS,iBAAiB,UAAU,KAAK,IAAI;EAErD,MAAM,QAAQ,MAAM,KAAK,SAAS,QAAQ,GAAG,KAAK,GAAG;EACrD,IAAI,SAAS,MAAM,OAAO,KAAA;EAE1B,OAAO;GACN,KAAK;GACL,KAAK;GACL,MAAM,KAAK,SAAS,gBAAgB,KAAK,QAAQ;GACjD,MAAM,MAAM;GACZ,OAAO,MAAM,OAAO,SAAS,eAAe,IAAI,SAAS;EAC1D;CACD;CAEA,MACM,gBAAgB,UAAqC;EAE1D,QAAO,MADY,K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S,wBAAwB,QAAQ;EACpE,IAAI,WAAW,MAAM,OAAO;GAAE,KAAK;GAAK,UAAU;EAAI;EAEtD,MAAM,EAAE,UAAU,QAAQ,YAAY;EAEtC,MAAM,MAAM,MAAM,OAAO,iBACxB,YAAY,KAAK,SAAS,0BAA0B,OAAO,GAC3D,SAAS,KAAK,OACd,SAAS,KAAK,MACd,YAAY,GAAG,GACf,YACD;EAEA,IAAI,OAAO,MACV,OAAO;GAAE,KAAK,eAAe,mBAAmB;GAAK,UAAU;EAAI;EAGpE,OAAO;GAAO;GAAK,UAAU,qBAAqB,GAAG,IAAI,MAAM;EAAI;CACpE;AACD;AA7HE,WAAA,CAAA,KAAK,GACL,MAAM,CAAA,GAAA,uBAAA,WAAA,sBAAA,IAAA;AASN,WAAA,CAAA,KAAK,GACL,MAAM,CAAA,GAAA,uBAAA,WAAA,2BAAA,IAAA;AAgCN,WAAA,CAAA,MAAM,CAAA,GAAA,uBAAA,WAAA,mBAAA,IAAA;AAMN,WAAA,CAAA,KAAK,GACL,MAAM,CAAA,GAAA,uBAAA,WAAA,sBAAA,IAAA;AAiCN,WAAA,CAAA,MAAM,CAAA,GAAA,uBAAA,WAAA,mBAAA,IAAA"}
|
|
@@ -14,6 +14,9 @@ no method for, or had one whose contract did not fit. Each such site stayed on `
|
|
|
14
14
|
comment naming the missing API. This document is the list of those APIs, what was added for each, and what was
|
|
15
15
|
deliberately left alone.
|
|
16
16
|
|
|
17
|
+
§1–§9 were the first round. §10–§19 are the second: the commands Kepler still ran raw once the first round
|
|
18
|
+
shipped, each because a typed method lacked one option or one behavior.
|
|
19
|
+
|
|
17
20
|
Verdict legend: **added** (a typed method now exists) · **extended** (an existing method gained the missing
|
|
18
21
|
option) · **deferred** (left on the raw escape hatch on purpose, with the reason).
|
|
19
22
|
|
|
@@ -82,13 +85,17 @@ to 60s. `clearCaches` fixed that read but fired none of the host's hooks, so not
|
|
|
82
85
|
the refs moved.
|
|
83
86
|
|
|
84
87
|
- The provider wraps `onReset` when it is constructed. On every reset it hard-evicts its own caches for those
|
|
85
|
-
types (`Cache.evictCaches`, so a later caller never joins pre-write work), drops
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
types (`Cache.evictCaches`, so a later caller never joins pre-write work), drops the written repository's
|
|
89
|
+
pending commands (its registered worktrees' included, no other repository's), then calls the host's handler.
|
|
90
|
+
Clears driven by a file watcher reach `clearCaches` directly and keep sharing in-flight reads, which is what
|
|
91
|
+
stops a burst of file events from spawning duplicate reads. A host's handler now only has host-side state to
|
|
92
|
+
update; forwarding to `clearCaches` as well is redundant but harmless.
|
|
89
93
|
- `provider.notifyChanged(repoPath, changes: RepositoryChange[], options?: { cache?: CachedGitTypes[] | 'all' })`
|
|
90
|
-
fires the same `cache.onReset`
|
|
91
|
-
|
|
94
|
+
fires the same `cache.onReset` and `repository.onChanged` a typed write would, so a raw mutation gets the
|
|
95
|
+
same treatment, host listeners included. Without `cache` it resets what `changes` map to, the same caches a
|
|
96
|
+
file watcher's change of those kinds clears; an empty `changes`, or one naming `unknown`, resets everything,
|
|
97
|
+
and `cache: 'all'` always does. A consumer naming its own changes must name every kind the write can touch
|
|
98
|
+
(a `commit` that concludes a merge is `pausedOp` too), or those caches keep their pre-write answer.
|
|
92
99
|
|
|
93
100
|
## 3. Worktree administration — added / extended
|
|
94
101
|
|
|
@@ -169,6 +176,108 @@ is the fix when the consumer made the change; `force` is for a read that must be
|
|
|
169
176
|
- `validateReference`'s `relativePath` moved into the options object, and `getBranch` / `getReference` take
|
|
170
177
|
options before `cancellation`, matching `getStatus`.
|
|
171
178
|
|
|
179
|
+
## 10. An inherited git environment — fixed
|
|
180
|
+
|
|
181
|
+
A host launched by git (a hook, a `rebase -x` step, an editor opened as `GIT_EDITOR`) inherits that
|
|
182
|
+
repository's `GIT_DIR`, `GIT_WORK_TREE`, `GIT_INDEX_FILE` and friends, and git lets them override the working
|
|
183
|
+
directory, so every command core ran targeted the launching repository. The base environment now drops
|
|
184
|
+
`GIT_DIR`, `GIT_WORK_TREE`, `GIT_INDEX_FILE`, `GIT_COMMON_DIR`, `GIT_OBJECT_DIRECTORY`,
|
|
185
|
+
`GIT_ALTERNATE_OBJECT_DIRECTORIES` and `GIT_NAMESPACE` from the inherited `process.env`, plus the state git
|
|
186
|
+
hands a child about its own command: `GIT_CONFIG_PARAMETERS` (its `-c` options), `GIT_EXEC_PATH`, `GIT_PREFIX`
|
|
187
|
+
and `GIT_REFLOG_ACTION`. None is worth keeping when set deliberately: a `GIT_DIR` would point every repository
|
|
188
|
+
the host opens at one. `GIT_AUTHOR_*` / `GIT_COMMITTER_*` are different, since a deliberate identity (direnv,
|
|
189
|
+
say) breaks nothing, so they are dropped only when git launched the host, which it always marks by exporting
|
|
190
|
+
`GIT_EXEC_PATH`: an editor opened for `commit --amend` inherits that commit's author and date. `GIT_CONFIG_COUNT` /
|
|
191
|
+
`GIT_CONFIG_KEY_<n>` / `GIT_CONFIG_VALUE_<n>` are kept: git never sets them itself, so inherited ones are the
|
|
192
|
+
user's deliberate configuration. Only the inherited environment is scrubbed; a host's `env`, `getEnvironment()`
|
|
193
|
+
and a per-call `env` can still set any of these, as temporary-index staging does with `GIT_INDEX_FILE`.
|
|
194
|
+
|
|
195
|
+
## 11. Run options on stash and clean — extended
|
|
196
|
+
|
|
197
|
+
`stash.applyStash`, `stash.saveStash` and `staging.clean` take the trailing `runOptions` (`env`,
|
|
198
|
+
`cancellation`, `timeout`) every other long-running operation already did. No typed default changed: see the
|
|
199
|
+
timeout decision below.
|
|
200
|
+
|
|
201
|
+
## 12. A raw run that announces its own change — added
|
|
202
|
+
|
|
203
|
+
`git.run({ notify })` calls the provider's `notifyChanged` once the run settles, succeeded or failed (a
|
|
204
|
+
command that fails partway may still have moved something). An explicit `RepositoryChange[]` announces exactly
|
|
205
|
+
that. `'infer'` classifies the argv: read-only and object-store-only commands announce nothing, a write
|
|
206
|
+
announces its verb's changes for the repository it ran in (the `-C` target when given). Run under `-C`, a
|
|
207
|
+
write also announces to the caller's own tree the kinds every worktree sharing that `.git` sees (`heads`,
|
|
208
|
+
`tags`, `stash`, `remotes`, `worktrees`, `config`), since the target may be a worktree the cache never
|
|
209
|
+
registered; its HEAD, index, paused operation and FETCH_HEAD are the target's alone. A write it can't
|
|
210
|
+
classify resets both trees in full. Unset, nothing is classified and the run takes the same path as before.
|
|
211
|
+
|
|
212
|
+
## 13. Fetch with explicit refspecs, and without FETCH_HEAD — extended
|
|
213
|
+
|
|
214
|
+
- `ops.fetch(repoPath, { remote, refspecs, prune? })` passes the refspecs verbatim after the remote
|
|
215
|
+
(`+refs/heads/x:refs/remotes/o/x`, `upstream:local`). It never adds `-u`, so git keeps refusing to write
|
|
216
|
+
into a checked-out branch, which a caller fast-forwarding a branch checked out nowhere relies on. A refspec
|
|
217
|
+
whose destination is a local branch or tag also announces `heads` or `tags`. The type refuses `refspecs`
|
|
218
|
+
beside `branch`, `all` or `pull`.
|
|
219
|
+
- `preserveFetchHead` passes `--no-write-fetch-head`, on every form of fetch. A checkout has one
|
|
220
|
+
`FETCH_HEAD`, and a user's own `git pull` reads it back right after its fetch, so a background fetch landing
|
|
221
|
+
in between breaks that pull. Git older than 2.29 has no such flag; there the option is ignored rather than
|
|
222
|
+
failing the fetch.
|
|
223
|
+
|
|
224
|
+
## 14. Clone into an exact folder — extended
|
|
225
|
+
|
|
226
|
+
`clone(url, parentPath, { folderName }, runOptions)`, on both core's `GitProvider` and GitLens's
|
|
227
|
+
`GlGitProvider`. `folderName` is used as given, with no numbering past a taken name, so git's own refusal of a
|
|
228
|
+
non-empty folder surfaces. Without it the folder is derived from the URL and numbered as before. `runOptions`
|
|
229
|
+
carries the clone's credentials, cancellation and timeout.
|
|
230
|
+
|
|
231
|
+
## 15. Status without untracked detail or branch state — extended
|
|
232
|
+
|
|
233
|
+
`status.getStatus(repoPath, { untracked: 'no' | 'normal' | 'all', branch: false })`. `untracked` picks git's
|
|
234
|
+
`-u` mode (default `all`, as before). `branch: false` skips `--branch`, whose ahead/behind against the upstream
|
|
235
|
+
is the slow part on a large divergence; the result's `branch`, `sha`, `upstream` and `detached` are then unset
|
|
236
|
+
and mean nothing. A narrower read gets its own dedup key, so a full-status caller never joins it and loses
|
|
237
|
+
files. `GIT_OPTIONAL_LOCKS=0` was already set on every status read, so there is no lock option.
|
|
238
|
+
|
|
239
|
+
## 16. A reflog read filtered by message — added
|
|
240
|
+
|
|
241
|
+
`refs.getReflogEntries(repoPath, ref, { grep? })` returns `{ sha, message }` per entry, newest first, where
|
|
242
|
+
`grep` is git's `--grep-reflog` pattern. It resolves `[]` when nothing matches or the ref has no reflog, and
|
|
243
|
+
rejects when the read fails, so a caller can tell "no answer" from "never read". It runs `reflog show <ref> --`,
|
|
244
|
+
not `reflog <ref>`: a branch named `delete`, `expire` or `exists` would otherwise run that subcommand, and one
|
|
245
|
+
named like a tracked file would fail as ambiguous. Core's own base-branch inference moved onto it, which
|
|
246
|
+
fixed both cases there.
|
|
247
|
+
|
|
248
|
+
## 17. Commit counts that exclude other refs — extended
|
|
249
|
+
|
|
250
|
+
`commits.getCommitCount(repoPath, rev, { excluding: { branches?, remotes?, tags?, refs?, except? } },
|
|
251
|
+
cancellation?)` counts what `rev` has that other refs don't, such as what deleting a branch would orphan.
|
|
252
|
+
`branches` / `remotes` / `tags` exclude a whole namespace, `refs` adds revisions verbatim, and `except` takes
|
|
253
|
+
full ref names back out of an excluded namespace. Core rewrites each `except` entry to the short form and
|
|
254
|
+
places it right before its own `--branches` / `--remotes` / `--tags`, because git matches `--exclude` against
|
|
255
|
+
the short name and applies it only to the next pseudo-ref option. The spelling that reads naturally,
|
|
256
|
+
`--exclude=refs/heads/x --branches`, excludes nothing. The GitHub provider returns `undefined` for an excluding
|
|
257
|
+
count, which its API cannot answer. A count is cached until a branch, remote-tracking branch or tag changes,
|
|
258
|
+
so a `refs` entry outside those namespaces (a tool's own `refs/<tool>/…`) can move without refreshing it;
|
|
259
|
+
pass its SHA instead, which keys a new read.
|
|
260
|
+
|
|
261
|
+
`commits.getLogShas` takes the same `excluding`, listing the SHAs instead of counting them; an omitted `rev` is
|
|
262
|
+
anchored to `HEAD` (a bare `--not` lists nothing), and the GitHub provider returns no SHAs.
|
|
263
|
+
|
|
264
|
+
**Breaking:** `getCommitCount` takes `options` before `cancellation`.
|
|
265
|
+
|
|
266
|
+
## 18. The empty tree in the repository's object format — added / fixed
|
|
267
|
+
|
|
268
|
+
The empty tree's id differs between SHA-1 and SHA-256 repositories, and core hardcoded the SHA-1 one as
|
|
269
|
+
`rootSha`, so every diff against a root commit's missing parent failed in a SHA-256 repository.
|
|
270
|
+
`revision.getEmptyTreeSha(repoPath)` computes it with `hash-object -t tree --stdin` (no `-w`; git knows the
|
|
271
|
+
empty tree without storing it), once per repository and shared across its worktrees. Every `rootSha` use now
|
|
272
|
+
goes through it, and `rootSha` is removed. GitHub repositories are always SHA-1.
|
|
273
|
+
|
|
274
|
+
**Breaking:** `rootSha` is removed from `@gitlens/git/models/revision`.
|
|
275
|
+
|
|
276
|
+
## 19. A link's clone of a large repository — fixed (GitLens)
|
|
277
|
+
|
|
278
|
+
Not a Kepler gap, found alongside §14: GitLens's deep-link clone ran under `gitlens.advanced.git.timeout` and
|
|
279
|
+
died partway through a large repository. It now runs uncapped, from a cancellable progress notification.
|
|
280
|
+
|
|
172
281
|
## Overlaps with existing APIs, and how each was settled
|
|
173
282
|
|
|
174
283
|
- **Refs containing a sha.** `branches.getBranchesWithCommits(repoPath, [sha], undefined, { all, mode })` and
|
|
@@ -184,6 +293,13 @@ is the fix when the consumer made the change; `force` is for a read that must be
|
|
|
184
293
|
compare-and-swap form for any namespace, and shares the branch cleanup with `deleteLocalBranch`.
|
|
185
294
|
- **Clearing caches.** `evictCaches` stays beside `clearCaches`: a write hard-evicts, a watcher clear keeps
|
|
186
295
|
sharing in-flight reads (see the decisions below).
|
|
296
|
+
- **Reflog reads.** `getReflogEntries` stays beside `commits.getIncomingActivity`, which walks `HEAD`'s reflog
|
|
297
|
+
for merges and pulls, pages, and aggregates; a message grep on it would change its paging. Core's private
|
|
298
|
+
reflog greps were folded into `getReflogEntries` rather than kept.
|
|
299
|
+
- **Dirty checks.** `getStatus({ untracked, branch: false })` stays beside `status.hasWorkingChanges`, which
|
|
300
|
+
answers yes/no with early exits; a caller counting files needs the list.
|
|
301
|
+
- **Unpushed commits.** `getCommitCount({ excluding })` stays beside `hasUnpublishedCommits` /
|
|
302
|
+
`filterUnpublishedShas`, which are early-exit probes against remotes alone and count nothing.
|
|
187
303
|
|
|
188
304
|
## Deferred, deliberately
|
|
189
305
|
|
|
@@ -191,10 +307,6 @@ is the fix when the consumer made the change; `force` is for a read that must be
|
|
|
191
307
|
`hash-object -w --stdin`, `cat-file -p`). The libraries drive these through `exec` with a scratch
|
|
192
308
|
`GIT_INDEX_FILE` and parse the results themselves; a typed surface would re-encode the same argv with more
|
|
193
309
|
room to drift. Revisit when a second consumer needs them.
|
|
194
|
-
- **A reflog read filtered by message.** Kepler reads `git reflog <branch> --grep-reflog='branch: Created from'`
|
|
195
|
-
to recover a branch's creation point. `getIncomingActivity` walks `HEAD`'s reflog for a different purpose;
|
|
196
|
-
bolting a grep onto it would change its paging. Worth its own method on `branches` once the base-branch
|
|
197
|
-
inference core already does privately is unified with it.
|
|
198
310
|
- **Generic `for-each-ref` with a caller-supplied format.** The `RefRecord` shape is private on purpose.
|
|
199
311
|
- **A typed `worktree remove` for every consumer.** Kept the raw form where a consumer classifies platform
|
|
200
312
|
failures from stderr; §3's `original` makes the typed form usable for that too.
|
|
@@ -228,12 +340,26 @@ core rejects with:
|
|
|
228
340
|
- A write hard-evicts while a watcher clear keeps sharing in-flight reads, rather than one policy for both. A
|
|
229
341
|
write is a known point after which an older read is wrong; a watcher tick has no such ordering, and sharing
|
|
230
342
|
the in-flight read is what keeps a burst of file events from multiplying git processes.
|
|
231
|
-
- `notifyChanged` on the provider
|
|
232
|
-
hooks
|
|
343
|
+
- `notifyChanged` on the provider, and `git.run({ notify })` bound to it rather than a second invalidation
|
|
344
|
+
path. The executor has no cache and no hooks, so the provider binds itself to its `Git` and a `notify` run
|
|
345
|
+
calls the same `notifyChanged`. `'infer'` classifies the argv (read-only and object-store-only commands
|
|
346
|
+
announce nothing; a `-C` write also announces to the caller's tree what every worktree sees), for a
|
|
347
|
+
consumer whose raw runs are too varied to name the changes by hand.
|
|
348
|
+
- Timeouts stay the caller's. No typed operation's default was lifted to "no timeout" for this round, even
|
|
349
|
+
for fetch or clone: GitLens passes its `gitlens.advanced.git.timeout` setting as core's default, and an
|
|
350
|
+
uncapped background fetch would hang with nothing to stop it. A caller that knows an operation is long
|
|
351
|
+
passes `timeout: 0` with a cancellation, as GitLens's deep-link clone now does.
|
|
352
|
+
- `except` takes full ref names and core converts them, rather than exposing git's short-form `--exclude`. The
|
|
353
|
+
short form is what every caller gets wrong, silently.
|
|
233
354
|
- Staging hooks skip the temporary-index case rather than firing unconditionally. A scratch index is not the
|
|
234
355
|
repository's; announcing an index change for it would invalidate status for nothing.
|
|
235
356
|
|
|
236
357
|
**Kepler-side follow-up**, once a core release carries these: serve sync-tools' `updateRef` op through
|
|
237
358
|
`updateReference` / `deleteReference` (mapping in §1), delete the review ref with `deleteReference`, drop the
|
|
238
|
-
verb classifier in `core-git-port.ts` in favour of `
|
|
239
|
-
|
|
359
|
+
verb classifier in `core-git-port.ts` in favour of `git.run({ notify: 'infer' })`, and drop its interim
|
|
360
|
+
environment scrub (§10). Then move the second round's raw sites onto their typed forms: credential fetches onto
|
|
361
|
+
`fetch({ remote, refspecs, preserveFetchHead: true })` (§13), the clone onto `clone(..., { folderName }, { env,
|
|
362
|
+
timeout: 0 })` (§14), the porcelain count onto `getStatus({ untracked: 'normal', branch: false, force: true })`
|
|
363
|
+
(§15), the creation probe onto `getReflogEntries` (§16), the unpushed count onto `getCommitCount({ excluding })`
|
|
364
|
+
(§17, which also fixes its always-zero `--exclude`), and the object-format probe onto `getEmptyTreeSha` (§18).
|
|
365
|
+
Then retire the remaining `TODO(core-gitlens)` residuals.
|
package/package.json
CHANGED