Skip to content

Commit bd06827

Browse files
committed
feat(git-graph): revamp history browsing and rendering
1 parent 836d239 commit bd06827

47 files changed

Lines changed: 7764 additions & 1714 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NOTICE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
14+
15+
This product includes modified SVG edge-rendering geometry derived from Git
16+
Graph for Visual Studio Code v1.4.6
17+
(commit e56379d616f8b0b8ee075497948131c31639f6b1):
18+
https://github.com/mhutchie/vscode-git-graph/blob/e56379d616f8b0b8ee075497948131c31639f6b1/web/graph.ts
19+
20+
Copyright (c) 2019-present, mhutchie.
21+
Licensed under the MIT License. The full license text is distributed at
22+
licenses/vscode-git-graph-MIT.txt.

electron-builder.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ icon: build/icon
44
files:
55
- out/**
66
- package.json
7+
extraResources:
8+
- from: LICENSE
9+
to: LICENSE
10+
- from: NOTICE
11+
to: NOTICE
12+
- from: licenses
13+
to: licenses
714
directories:
815
output: release
916
asar: true

electron/host-service.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
fetchScmBranch,
3636
fetchGitHubPrStatus,
3737
fetchRepoMergeSettings,
38+
getScmCommitDetails,
3839
getScmCommitDiff,
3940
getScmCommitFiles,
4041
getScmGraph,
@@ -1427,6 +1428,9 @@ async function handleRequest(request: AnyHostServiceRequestEnvelope) {
14271428
case "scm.graph":
14281429
await respond(request.id, await getScmGraph(request.params));
14291430
return;
1431+
case "scm.commit-details":
1432+
await respond(request.id, await getScmCommitDetails(request.params));
1433+
return;
14301434
case "scm.commit-files":
14311435
await respond(request.id, await getScmCommitFiles(request.params));
14321436
return;
@@ -1449,7 +1453,10 @@ async function handleRequest(request: AnyHostServiceRequestEnvelope) {
14491453
await respond(request.id, await checkoutScmBranch(request.params));
14501454
return;
14511455
case "scm.checkout-default-branch-detached":
1452-
await respond(request.id, await checkoutDefaultBranchDetached(request.params));
1456+
await respond(
1457+
request.id,
1458+
await checkoutDefaultBranchDetached(request.params),
1459+
);
14531460
return;
14541461
case "scm.pull-branch":
14551462
await respond(request.id, await pullScmBranch(request.params));

electron/host-service/protocol.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,23 @@ import type {
5050
PrePrReviewFinding,
5151
PrePrReviewProviderId,
5252
} from "../../src/lib/source-control-review";
53-
import type { CommandResult, DetachedCheckoutResult, SourceControlStatusItem } from "../main/types";
53+
import type {
54+
CommandResult,
55+
DetachedCheckoutResult,
56+
SourceControlStatusItem,
57+
} from "../main/types";
5458
import type { WorkspaceInformationState } from "../../src/lib/workspace-information";
5559
import type {
5660
SecondaryProviderCancelRequest,
5761
SecondaryProviderExecutionRequest,
5862
SecondaryProviderExecutionResult,
5963
} from "../../src/lib/runs/secondary-run";
6064
import type { LocalMcpTaskTurnUpdate } from "../../src/lib/local-mcp/task-turn-update";
65+
import type {
66+
GraphCommitDetailsResult,
67+
GraphFileChange,
68+
GraphResult,
69+
} from "../../src/lib/git-graph/types";
6170

6271
export interface HostWorkspaceScriptRunEntryArgs {
6372
workspaceId: string;
@@ -350,13 +359,8 @@ export interface HostScmHistoryResult {
350359
stderr: string;
351360
}
352361

353-
export interface HostScmGraphResult {
354-
ok: boolean;
355-
commits: import("../../src/lib/git-graph/types").GraphCommit[];
356-
head: string | null;
357-
hasMore: boolean;
358-
stderr: string;
359-
}
362+
export type HostScmGraphResult = GraphResult;
363+
export type HostScmCommitDetailsResult = GraphCommitDetailsResult;
360364

361365
export interface HostScmListBranchesResult {
362366
ok: boolean;
@@ -718,6 +722,12 @@ export interface HostServiceRequestMap {
718722
limit?: number;
719723
skip?: number;
720724
scope?: "current" | "all" | string;
725+
refs?: string[];
726+
includeRepositoryState?: boolean;
727+
};
728+
"scm.commit-details": {
729+
hash: string;
730+
cwd?: string;
721731
};
722732
"scm.commit-files": {
723733
hash: string;
@@ -937,9 +947,10 @@ export interface HostServiceResponseMap {
937947
"scm.discard-file": CommandResult;
938948
"scm.diff": HostScmDiffResult;
939949
"scm.graph": HostScmGraphResult;
950+
"scm.commit-details": HostScmCommitDetailsResult;
940951
"scm.commit-files": {
941952
ok: boolean;
942-
files: Array<{ path: string; status: string }>;
953+
files: GraphFileChange[];
943954
stderr: string;
944955
};
945956
"scm.commit-diff": {

0 commit comments

Comments
 (0)