@gitkraken/core-gitlens 0.35.0 → 0.37.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 +30 -1
- package/dist/git/models/branch.d.ts +9 -0
- package/dist/git/models/branch.js.map +1 -1
- package/dist/git/providers/branches.d.ts +11 -1
- package/dist/git/providers/revision.d.ts +6 -0
- package/dist/git/utils/branch.utils.d.ts +14 -0
- package/dist/git/utils/branch.utils.js +37 -1
- package/dist/git/utils/branch.utils.js.map +1 -1
- package/dist/git/utils/branchLanded.utils.d.ts +43 -0
- package/dist/git/utils/branchLanded.utils.js +56 -0
- package/dist/git/utils/branchLanded.utils.js.map +1 -0
- package/dist/git-cli/exec/git.js +2 -2
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +6 -1
- package/dist/git-cli/providers/branches.js +58 -0
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/revision.d.ts +1 -0
- package/dist/git-cli/providers/revision.js +9 -0
- package/dist/git-cli/providers/revision.js.map +1 -1
- package/dist/plus/ai/models/model.js +58 -4
- package/dist/plus/ai/models/model.js.map +1 -1
- package/dist/plus/ai/providers/anthropicProvider.js +58 -223
- package/dist/plus/ai/providers/anthropicProvider.js.map +1 -1
- package/dist/plus/ai/providers/deepSeekProvider.js +32 -18
- package/dist/plus/ai/providers/deepSeekProvider.js.map +1 -1
- package/dist/plus/ai/providers/geminiProvider.js +25 -189
- package/dist/plus/ai/providers/geminiProvider.js.map +1 -1
- package/dist/plus/ai/providers/mistralProvider.js +31 -73
- package/dist/plus/ai/providers/mistralProvider.js.map +1 -1
- package/dist/plus/ai/providers/xaiProvider.js +9 -11
- package/dist/plus/ai/providers/xaiProvider.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +14 -3
- package/dist/plus/git-github/api/github.js +47 -14
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +5 -1
- package/dist/plus/integrations/integrationService.js +4 -2
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +24 -5
- package/dist/plus/integrations/models/integration.d.ts +12 -0
- package/dist/plus/integrations/models/integration.js +15 -1
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +2 -1
- package/dist/plus/integrations/models/issuesIntegration.js +6 -3
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +21 -6
- package/dist/plus/integrations/providers/azureDevOps.js +24 -12
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +49 -3
- package/dist/plus/integrations/providers/azureDevOpsServer.js +151 -23
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +3 -2
- package/dist/plus/integrations/providers/linear.js +7 -5
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/reads/autolinks.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +2 -0
- package/dist/plus/integrations/reads/searchPullRequests.js +18 -9
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/docs/integrations.md +27 -6
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PagedResult, PagingOptions } from "../../utils/paging.js";
|
|
2
2
|
import { GitBranchReference } from "../../git/models/reference.js";
|
|
3
|
-
import { BranchDisposition, GitBranch } from "../../git/models/branch.js";
|
|
3
|
+
import { BranchDisposition, GitBranch, GitCurrentHead } from "../../git/models/branch.js";
|
|
4
4
|
import { ConflictDetectionResult } from "../../git/models/mergeConflicts.js";
|
|
5
5
|
import { GitServiceContext } from "../../git/context.js";
|
|
6
6
|
import { GitCommandPriority } from "../../git/run.types.js";
|
|
@@ -122,6 +122,11 @@ export declare class BranchesGitSubProvider implements GitBranchesSubProvider {
|
|
|
122
122
|
}, cancellation?: AbortSignal): Promise<string[]>;
|
|
123
123
|
private branchesContainingCore;
|
|
124
124
|
getCurrentBranchReference(repoPath: string, cancellation?: AbortSignal): Promise<GitBranchReference | undefined>;
|
|
125
|
+
getCurrentHead(repoPath: string, options?: {
|
|
126
|
+
sha?: boolean;
|
|
127
|
+
}, cancellation?: AbortSignal): Promise<GitCurrentHead>;
|
|
128
|
+
/** The branch `repoPath`'s HEAD is on, or the one a paused rebase is rebasing, read fresh for {@link getCurrentHead} */
|
|
129
|
+
private readCurrentHeadBranch;
|
|
125
130
|
private getCurrentBranchReferenceCore;
|
|
126
131
|
private readCurrentBranchReference;
|
|
127
132
|
getDefaultBranchName(repoPath: string | undefined, remote?: string, options?: {
|
|
@@ -612,6 +612,63 @@ var BranchesGitSubProvider = class {
|
|
|
612
612
|
});
|
|
613
613
|
return ref;
|
|
614
614
|
}
|
|
615
|
+
async getCurrentHead(repoPath, options, cancellation) {
|
|
616
|
+
const [headResult, shaResult] = await Promise.allSettled([this.readCurrentHeadBranch(repoPath, cancellation), options?.sha ? this.git.run({
|
|
617
|
+
cwd: repoPath,
|
|
618
|
+
cancellation,
|
|
619
|
+
errors: "throw",
|
|
620
|
+
expectedExitCodes: [1]
|
|
621
|
+
}, "rev-parse", "--verify", "-q", "HEAD^{commit}") : void 0]);
|
|
622
|
+
if (cancellation?.aborted) throw new CancellationError();
|
|
623
|
+
if (headResult.status === "rejected") throw headResult.reason;
|
|
624
|
+
if (shaResult.status === "rejected") throw shaResult.reason;
|
|
625
|
+
const sha = shaResult.value?.stdout.trim();
|
|
626
|
+
return {
|
|
627
|
+
branch: headResult.value.branch,
|
|
628
|
+
sha: sha || void 0,
|
|
629
|
+
rebasing: headResult.value.rebasing
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
/** The branch `repoPath`'s HEAD is on, or the one a paused rebase is rebasing, read fresh for {@link getCurrentHead} */
|
|
633
|
+
async readCurrentHeadBranch(repoPath, cancellation) {
|
|
634
|
+
const state = await readHeadState(repoPath, this.context.fs, this.cache);
|
|
635
|
+
if (state == null) {
|
|
636
|
+
const ref = (await this.git.run({
|
|
637
|
+
cwd: repoPath,
|
|
638
|
+
cancellation,
|
|
639
|
+
errors: "throw",
|
|
640
|
+
expectedExitCodes: [1]
|
|
641
|
+
}, "symbolic-ref", "-q", "HEAD")).stdout.trim();
|
|
642
|
+
if (ref.startsWith("refs/heads/")) return {
|
|
643
|
+
branch: ref.substring(11),
|
|
644
|
+
rebasing: false
|
|
645
|
+
};
|
|
646
|
+
} else if (state !== "detached") return {
|
|
647
|
+
branch: state.branch.substring(11),
|
|
648
|
+
rebasing: false
|
|
649
|
+
};
|
|
650
|
+
const gitDir = await this.provider.config.getGitDir(repoPath).catch(() => void 0);
|
|
651
|
+
if (gitDir == null) return {
|
|
652
|
+
branch: void 0,
|
|
653
|
+
rebasing: false
|
|
654
|
+
};
|
|
655
|
+
for (const dir of ["rebase-apply", "rebase-merge"]) {
|
|
656
|
+
let name;
|
|
657
|
+
try {
|
|
658
|
+
name = new TextDecoder().decode(await this.context.fs.readFile(joinUriPath(gitDir.uri, dir, "head-name"))).trim();
|
|
659
|
+
} catch {
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
return {
|
|
663
|
+
branch: name.startsWith("refs/heads/") ? name.substring(11) : void 0,
|
|
664
|
+
rebasing: true
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
return {
|
|
668
|
+
branch: void 0,
|
|
669
|
+
rebasing: false
|
|
670
|
+
};
|
|
671
|
+
}
|
|
615
672
|
getCurrentBranchReferenceCore(repoPath, ordering, cancellation) {
|
|
616
673
|
const validation = this.cache.validateBeforeRead(repoPath);
|
|
617
674
|
return validation != null ? validation.then(() => this.readCurrentBranchReference(repoPath, ordering, cancellation)) : this.readCurrentBranchReference(repoPath, ordering, cancellation);
|
|
@@ -3164,6 +3221,7 @@ __decorate([debug({
|
|
|
3164
3221
|
__decorate([debug({ quiet: true })], BranchesGitSubProvider.prototype, "getBranchContributionsOverview", null);
|
|
3165
3222
|
__decorate([debug({ quiet: true })], BranchesGitSubProvider.prototype, "getBranchesWithCommits", null);
|
|
3166
3223
|
__decorate([debug({ quiet: true })], BranchesGitSubProvider.prototype, "getCurrentBranchReference", null);
|
|
3224
|
+
__decorate([debug({ quiet: true })], BranchesGitSubProvider.prototype, "getCurrentHead", null);
|
|
3167
3225
|
__decorate([debug({
|
|
3168
3226
|
quiet: true,
|
|
3169
3227
|
exit: true
|