-
Notifications
You must be signed in to change notification settings - Fork 394
Expand file tree
/
Copy pathtypes.ts
More file actions
1359 lines (1214 loc) · 37.6 KB
/
types.ts
File metadata and controls
1359 lines (1214 loc) · 37.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Git Interfaces / Types */
export interface GitCommit {
readonly hash: string;
readonly parents: ReadonlyArray<string>;
readonly author: string;
readonly email: string;
readonly date: number;
readonly message: string;
readonly heads: ReadonlyArray<string>;
readonly tags: ReadonlyArray<GitCommitTag>;
readonly remotes: ReadonlyArray<GitCommitRemote>;
readonly stash: GitCommitStash | null; // null => not a stash, otherwise => stash info
}
export interface GitCommitTag {
readonly name: string;
readonly annotated: boolean;
}
export interface GitCommitRemote {
readonly name: string;
readonly remote: string | null; // null => remote not found, otherwise => remote name
}
export interface GitCommitStash {
readonly selector: string;
readonly baseHash: string;
readonly untrackedFilesHash: string | null;
}
export interface GitCommitDetails {
readonly hash: string;
readonly parents: ReadonlyArray<string>;
readonly author: string;
readonly authorEmail: string;
readonly authorDate: number;
readonly committer: string;
readonly committerEmail: string;
readonly committerDate: number;
readonly signature: GitCommitSignature | null;
readonly body: string;
readonly fileChanges: ReadonlyArray<GitFileChange>;
}
export const enum GitSignatureStatus {
GoodAndValid = 'G',
GoodWithUnknownValidity = 'U',
GoodButExpired = 'X',
GoodButMadeByExpiredKey = 'Y',
GoodButMadeByRevokedKey = 'R',
CannotBeChecked = 'E',
Bad = 'B'
}
export interface GitCommitSignature {
readonly key: string;
readonly signer: string;
readonly status: GitSignatureStatus;
}
export const enum GitConfigLocation {
Local = 'local',
Global = 'global',
System = 'system'
}
export interface GitFileChange {
readonly oldFilePath: string;
readonly newFilePath: string;
readonly type: GitFileStatus;
readonly additions: number | null;
readonly deletions: number | null;
}
export const enum GitFileStatus {
Added = 'A',
Modified = 'M',
Deleted = 'D',
Renamed = 'R',
Untracked = 'U'
}
export const enum GitPushBranchMode {
Normal = '',
Force = 'force',
ForceWithLease = 'force-with-lease'
}
export interface GitRepoConfig {
readonly branches: GitRepoConfigBranches;
readonly diffTool: string | null;
readonly guiDiffTool: string | null;
readonly pushDefault: string | null;
readonly remotes: ReadonlyArray<GitRepoSettingsRemote>;
readonly user: {
readonly name: {
readonly local: string | null,
readonly global: string | null
},
readonly email: {
readonly local: string | null,
readonly global: string | null
}
};
}
export type GitRepoConfigBranches = { [branchName: string]: GitRepoConfigBranch };
export interface GitRepoConfigBranch {
readonly pushRemote: string | null;
readonly remote: string | null;
}
export interface GitRepoSettingsRemote {
readonly name: string;
readonly url: string | null;
readonly pushUrl: string | null;
}
export const enum GitResetMode {
Soft = 'soft',
Mixed = 'mixed',
Hard = 'hard'
}
export interface GitStash {
readonly hash: string;
readonly baseHash: string;
readonly untrackedFilesHash: string | null;
readonly selector: string;
readonly author: string;
readonly email: string;
readonly date: number;
readonly message: string;
}
/* Git Repo State */
export interface CodeReview {
id: string;
lastActive: number;
lastViewedFile: string | null;
remainingFiles: string[];
}
export type ColumnWidth = number;
export type GitRepoSet = { [repo: string]: GitRepoState };
export interface IssueLinkingConfig {
readonly issue: string;
readonly url: string;
}
export interface PullRequestConfigBase {
readonly hostRootUrl: string;
readonly sourceRemote: string;
readonly sourceOwner: string;
readonly sourceRepo: string;
readonly destRemote: string | null;
readonly destOwner: string;
readonly destRepo: string;
readonly destProjectId: string; // Only used by GitLab
readonly destBranch: string;
}
export const enum PullRequestProvider {
Bitbucket,
Custom,
GitHub,
GitLab
}
interface PullRequestConfigBuiltIn extends PullRequestConfigBase {
readonly provider: Exclude<PullRequestProvider, PullRequestProvider.Custom>;
readonly custom: null;
}
interface PullRequestConfigCustom extends PullRequestConfigBase {
readonly provider: PullRequestProvider.Custom;
readonly custom: {
readonly name: string,
readonly templateUrl: string
};
}
export type PullRequestConfig = PullRequestConfigBuiltIn | PullRequestConfigCustom;
export interface GitRepoState {
cdvDivider: number;
cdvHeight: number;
columnWidths: ColumnWidth[] | null;
commitOrdering: RepoCommitOrdering;
fileViewType: FileViewType;
hideRemotes: string[];
includeCommitsMentionedByReflogs: BooleanOverride;
issueLinkingConfig: IssueLinkingConfig | null;
lastImportAt: number;
name: string | null;
onlyFollowFirstParent: BooleanOverride;
onRepoLoadShowCheckedOutBranch: BooleanOverride;
onRepoLoadShowSpecificBranches: string[] | null;
pullRequestConfig: PullRequestConfig | null;
showRemoteBranches: boolean;
showRemoteBranchesV2: BooleanOverride;
showStashes: BooleanOverride;
showTags: BooleanOverride;
workspaceFolderIndex: number | null;
}
/* Git Graph View Types */
export interface GitGraphViewInitialState {
readonly config: GitGraphViewConfig;
readonly lastActiveRepo: string | null;
readonly loadViewTo: LoadGitGraphViewTo;
readonly repos: GitRepoSet;
readonly loadRepoInfoRefreshId: number;
readonly loadCommitsRefreshId: number;
}
export interface GitGraphViewConfig {
readonly commitDetailsView: CommitDetailsViewConfig;
readonly commitOrdering: CommitOrdering;
readonly contextMenuActionsVisibility: ContextMenuActionsVisibility;
readonly customBranchGlobPatterns: ReadonlyArray<CustomBranchGlobPattern>;
readonly customEmojiShortcodeMappings: ReadonlyArray<CustomEmojiShortcodeMapping>;
readonly customPullRequestProviders: ReadonlyArray<CustomPullRequestProvider>;
readonly dateFormat: DateFormat;
readonly defaultColumnVisibility: DefaultColumnVisibility;
readonly dialogDefaults: DialogDefaults;
readonly enhancedAccessibility: boolean;
readonly fetchAndPrune: boolean;
readonly fetchAndPruneTags: boolean;
readonly fetchAvatars: boolean;
readonly graph: GraphConfig;
readonly includeCommitsMentionedByReflogs: boolean;
readonly initialLoadCommits: number;
readonly keybindings: KeybindingConfig
readonly loadMoreCommits: number;
readonly loadMoreCommitsAutomatically: boolean;
readonly markdown: boolean;
readonly mute: MuteCommitsConfig;
readonly onlyFollowFirstParent: boolean;
readonly onRepoLoad: OnRepoLoadConfig;
readonly referenceLabels: ReferenceLabelsConfig;
readonly repoDropdownOrder: RepoDropdownOrder;
readonly showRemoteBranches: boolean;
readonly showStashes: boolean;
readonly showTags: boolean;
}
export interface GitGraphViewGlobalState {
alwaysAcceptCheckoutCommit: boolean;
issueLinkingConfig: IssueLinkingConfig | null;
}
export interface GitGraphViewWorkspaceState {
findIsCaseSensitive: boolean;
findIsRegex: boolean;
findOpenCommitDetailsView: boolean;
}
export interface CommitDetailsViewConfig {
readonly autoCenter: boolean;
readonly fileTreeCompactFolders: boolean;
readonly fileViewType: FileViewType;
readonly location: CommitDetailsViewLocation;
}
export interface GraphConfig {
readonly colours: ReadonlyArray<string>;
readonly style: GraphStyle;
readonly grid: { x: number, y: number, offsetX: number, offsetY: number, expandY: number };
readonly uncommittedChanges: GraphUncommittedChangesStyle;
}
export interface KeybindingConfig {
readonly find: string | null;
readonly refresh: string | null;
readonly scrollToHead: string | null;
readonly scrollToStash: string | null;
}
export type LoadGitGraphViewTo = {
readonly repo: string,
readonly commitDetails?: {
readonly commitHash: string,
readonly compareWithHash: string | null
},
readonly runCommandOnLoad?: 'fetch'
} | null;
export interface MuteCommitsConfig {
readonly commitsNotAncestorsOfHead: boolean;
readonly mergeCommits: boolean;
}
export interface OnRepoLoadConfig {
readonly scrollToHead: boolean;
readonly showCheckedOutBranch: boolean;
readonly showSpecificBranches: ReadonlyArray<string>;
}
export interface ReferenceLabelsConfig {
readonly branchLabelsAlignedToGraph: boolean;
readonly combineLocalAndRemoteBranchLabels: boolean;
readonly tagLabelsOnRight: boolean;
}
/* Extension Settings Types */
export const enum BooleanOverride {
Default,
Enabled,
Disabled
}
export const enum CommitDetailsViewLocation {
Inline,
DockedToBottom
}
export const enum CommitOrdering {
Date = 'date',
AuthorDate = 'author-date',
Topological = 'topo'
}
export interface ContextMenuActionsVisibility {
readonly branch: {
readonly checkout: boolean;
readonly rename: boolean;
readonly delete: boolean;
readonly merge: boolean;
readonly rebase: boolean;
readonly push: boolean;
readonly createPullRequest: boolean;
readonly createArchive: boolean;
readonly selectInBranchesDropdown: boolean;
readonly unselectInBranchesDropdown: boolean;
readonly copyName: boolean;
};
readonly commit: {
readonly addTag: boolean;
readonly createBranch: boolean;
readonly checkout: boolean;
readonly cherrypick: boolean;
readonly revert: boolean;
readonly drop: boolean;
readonly merge: boolean;
readonly rebase: boolean;
readonly reset: boolean;
readonly copyHash: boolean;
readonly copySubject: boolean;
};
readonly remoteBranch: {
readonly checkout: boolean;
readonly delete: boolean;
readonly fetch: boolean;
readonly merge: boolean;
readonly pull: boolean;
readonly createPullRequest: boolean;
readonly createArchive: boolean;
readonly selectInBranchesDropdown: boolean;
readonly unselectInBranchesDropdown: boolean;
readonly copyName: boolean;
};
readonly stash: {
readonly apply: boolean;
readonly createBranch: boolean;
readonly pop: boolean;
readonly drop: boolean;
readonly copyName: boolean;
readonly copyHash: boolean;
};
readonly tag: {
readonly viewDetails: boolean;
readonly delete: boolean;
readonly push: boolean;
readonly createArchive: boolean;
readonly copyName: boolean;
};
readonly uncommittedChanges: {
readonly stash: boolean;
readonly reset: boolean;
readonly clean: boolean;
readonly openSourceControlView: boolean;
};
}
export interface CustomBranchGlobPattern {
readonly name: string;
readonly glob: string;
}
export interface CustomEmojiShortcodeMapping {
readonly shortcode: string;
readonly emoji: string;
}
export interface CustomPullRequestProvider {
readonly name: string;
readonly templateUrl: string;
}
export interface DateFormat {
readonly type: DateFormatType;
readonly iso: boolean;
}
export const enum DateFormatType {
DateAndTime,
DateOnly,
Relative
}
export const enum DateType {
Author,
Commit
}
export interface DefaultColumnVisibility {
readonly date: boolean;
readonly author: boolean;
readonly commit: boolean;
}
export interface DialogDefaults {
readonly addTag: {
readonly pushToRemote: boolean,
readonly type: TagType
};
readonly applyStash: {
readonly reinstateIndex: boolean
};
readonly cherryPick: {
readonly noCommit: boolean,
readonly recordOrigin: boolean
};
readonly createBranch: {
readonly checkout: boolean
};
readonly deleteBranch: {
readonly forceDelete: boolean
};
readonly fetchIntoLocalBranch: {
readonly forceFetch: boolean
};
readonly fetchRemote: {
readonly prune: boolean,
readonly pruneTags: boolean
};
readonly general: {
readonly referenceInputSpaceSubstitution: string | null
};
readonly merge: {
readonly noCommit: boolean,
readonly noFastForward: boolean,
readonly squash: boolean
};
readonly popStash: {
readonly reinstateIndex: boolean
};
readonly pullBranch: {
readonly noFastForward: boolean,
readonly squash: boolean
};
readonly rebase: {
readonly ignoreDate: boolean,
readonly interactive: boolean
};
readonly resetCommit: {
readonly mode: GitResetMode
};
readonly resetUncommitted: {
readonly mode: Exclude<GitResetMode, GitResetMode.Soft>
};
readonly stashUncommittedChanges: {
readonly includeUntracked: boolean
};
}
export const enum FileViewType {
Default,
Tree,
List
}
export const enum GraphStyle {
Rounded,
Angular
}
export const enum GraphUncommittedChangesStyle {
OpenCircleAtTheUncommittedChanges,
OpenCircleAtTheCheckedOutCommit
}
export const enum RefLabelAlignment {
Normal,
BranchesOnLeftAndTagsOnRight,
BranchesAlignedToGraphAndTagsOnRight
}
export const enum RepoCommitOrdering {
Default = 'default',
Date = 'date',
AuthorDate = 'author-date',
Topological = 'topo'
}
export const enum RepoDropdownOrder {
FullPath,
Name,
WorkspaceFullPath
}
export const enum SquashMessageFormat {
Default,
GitSquashMsg
}
export const enum TabIconColourTheme {
Colour,
Grey
}
export const enum TagType {
Annotated,
Lightweight
}
/* Base Interfaces for Request / Response Messages */
export interface BaseMessage {
readonly command: string;
}
export interface RepoRequest extends BaseMessage {
readonly repo: string;
}
export interface ResponseWithErrorInfo extends BaseMessage {
readonly error: ErrorInfo;
}
export interface ResponseWithMultiErrorInfo extends BaseMessage {
readonly errors: ErrorInfo[];
}
export type ErrorInfo = string | null; // null => no error, otherwise => error message
/* Request / Response Messages */
export interface RequestAddRemote extends RepoRequest {
readonly command: 'addRemote';
readonly name: string;
readonly url: string;
readonly pushUrl: string | null;
readonly fetch: boolean;
}
export interface ResponseAddRemote extends ResponseWithErrorInfo {
readonly command: 'addRemote';
}
export interface RequestAddTag extends RepoRequest {
readonly command: 'addTag';
readonly commitHash: string;
readonly tagName: string;
readonly type: TagType;
readonly message: string;
readonly pushToRemote: string | null; // string => name of the remote to push the tag to, null => don't push to a remote
readonly force: boolean;
}
export interface ResponseAddTag extends ResponseWithMultiErrorInfo {
readonly command: 'addTag';
}
export interface RequestApplyStash extends RepoRequest {
readonly command: 'applyStash';
readonly selector: string;
readonly reinstateIndex: boolean;
}
export interface ResponseApplyStash extends ResponseWithErrorInfo {
readonly command: 'applyStash';
}
export interface RequestBranchFromStash extends RepoRequest {
readonly command: 'branchFromStash';
readonly selector: string;
readonly branchName: string;
}
export interface ResponseBranchFromStash extends ResponseWithErrorInfo {
readonly command: 'branchFromStash';
}
export interface RequestCheckoutBranch extends RepoRequest {
readonly command: 'checkoutBranch';
readonly branchName: string;
readonly remoteBranch: string | null;
readonly pullAfterwards: {
readonly branchName: string;
readonly remote: string;
readonly createNewCommit: boolean;
readonly squash: boolean;
} | null; // NULL => Don't pull after checking out
}
export interface ResponseCheckoutBranch extends ResponseWithMultiErrorInfo {
readonly command: 'checkoutBranch';
readonly pullAfterwards: {
readonly branchName: string;
readonly remote: string;
} | null; // NULL => Don't pull after checking out
}
export interface RequestCheckoutCommit extends RepoRequest {
readonly command: 'checkoutCommit';
readonly commitHash: string;
}
export interface ResponseCheckoutCommit extends ResponseWithErrorInfo {
readonly command: 'checkoutCommit';
}
export interface RequestCherrypickCommit extends RepoRequest {
readonly command: 'cherrypickCommit';
readonly commitHash: string;
readonly parentIndex: number;
readonly recordOrigin: boolean;
readonly noCommit: boolean;
}
export interface ResponseCherrypickCommit extends ResponseWithMultiErrorInfo {
readonly command: 'cherrypickCommit';
}
export interface RequestCleanUntrackedFiles extends RepoRequest {
readonly command: 'cleanUntrackedFiles';
readonly directories: boolean;
}
export interface ResponseCleanUntrackedFiles extends ResponseWithErrorInfo {
readonly command: 'cleanUntrackedFiles';
}
export interface RequestCommitDetails extends RepoRequest {
readonly command: 'commitDetails';
readonly commitHash: string;
readonly hasParents: boolean;
readonly parentIndex: number;
readonly stash: GitCommitStash | null; // null => request is for a commit, otherwise => request is for a stash
readonly avatarEmail: string | null; // string => fetch avatar with the given email, null => don't fetch avatar
readonly refresh: boolean;
}
export interface ResponseCommitDetails extends ResponseWithErrorInfo {
readonly command: 'commitDetails';
readonly commitDetails: GitCommitDetails | null;
readonly parentIndex: number;
readonly avatar: string | null;
readonly codeReview: CodeReview | null;
readonly refresh: boolean;
}
export interface RequestCompareCommits extends RepoRequest {
readonly command: 'compareCommits';
readonly commitHash: string;
readonly compareWithHash: string;
readonly fromHash: string;
readonly toHash: string;
readonly refresh: boolean;
}
export interface ResponseCompareCommits extends ResponseWithErrorInfo {
readonly command: 'compareCommits';
readonly commitHash: string;
readonly compareWithHash: string;
readonly fileChanges: ReadonlyArray<GitFileChange>;
readonly codeReview: CodeReview | null;
readonly refresh: boolean;
}
export interface RequestCopyFilePath extends RepoRequest {
readonly command: 'copyFilePath';
readonly filePath: string;
readonly absolute: boolean;
}
export interface ResponseCopyFilePath extends ResponseWithErrorInfo {
readonly command: 'copyFilePath';
}
export interface RequestCopyToClipboard extends BaseMessage {
readonly command: 'copyToClipboard';
readonly type: string;
readonly data: string;
}
export interface ResponseCopyToClipboard extends ResponseWithErrorInfo {
readonly command: 'copyToClipboard';
readonly type: string;
}
export interface RequestCreateArchive extends RepoRequest {
readonly command: 'createArchive';
readonly ref: string;
}
export interface ResponseCreateArchive extends ResponseWithErrorInfo {
readonly command: 'createArchive';
}
export interface RequestCreateBranch extends RepoRequest {
readonly command: 'createBranch';
readonly commitHash: string;
readonly branchName: string;
readonly checkout: boolean;
readonly force: boolean;
}
export interface ResponseCreateBranch extends ResponseWithMultiErrorInfo {
readonly command: 'createBranch';
}
export interface RequestCreatePullRequest extends RepoRequest {
readonly command: 'createPullRequest';
readonly config: PullRequestConfig;
readonly sourceRemote: string;
readonly sourceOwner: string;
readonly sourceRepo: string;
readonly sourceBranch: string;
readonly push: boolean;
}
export interface ResponseCreatePullRequest extends ResponseWithMultiErrorInfo {
readonly command: 'createPullRequest';
readonly push: boolean;
}
export interface RequestDeleteBranch extends RepoRequest {
readonly command: 'deleteBranch';
readonly branchName: string;
readonly forceDelete: boolean;
readonly deleteOnRemotes: ReadonlyArray<string>;
}
export interface ResponseDeleteBranch extends ResponseWithMultiErrorInfo {
readonly command: 'deleteBranch';
readonly repo: string;
readonly branchName: string;
readonly deleteOnRemotes: ReadonlyArray<string>;
}
export interface RequestDeleteRemote extends RepoRequest {
readonly command: 'deleteRemote';
readonly name: string;
}
export interface ResponseDeleteRemote extends ResponseWithErrorInfo {
readonly command: 'deleteRemote';
}
export interface RequestDeleteRemoteBranch extends RepoRequest {
readonly command: 'deleteRemoteBranch';
readonly branchName: string;
readonly remote: string;
}
export interface ResponseDeleteRemoteBranch extends ResponseWithErrorInfo {
readonly command: 'deleteRemoteBranch';
}
export interface RequestDeleteTag extends RepoRequest {
readonly command: 'deleteTag';
readonly tagName: string;
readonly deleteOnRemote: string | null; // null => don't delete on remote, otherwise => remote to delete on
}
export interface ResponseDeleteTag extends ResponseWithErrorInfo {
readonly command: 'deleteTag';
}
export interface RequestDeleteUserDetails extends RepoRequest {
readonly command: 'deleteUserDetails';
readonly name: boolean; // TRUE => Delete Name, FALSE => Don't Delete Name
readonly email: boolean; // TRUE => Delete Email, FALSE => Don't Delete Email
readonly location: GitConfigLocation.Global | GitConfigLocation.Local;
}
export interface ResponseDeleteUserDetails extends ResponseWithMultiErrorInfo {
readonly command: 'deleteUserDetails';
}
export interface RequestDropCommit extends RepoRequest {
readonly command: 'dropCommit';
readonly commitHash: string;
}
export interface ResponseDropCommit extends ResponseWithErrorInfo {
readonly command: 'dropCommit';
}
export interface RequestDropStash extends RepoRequest {
readonly command: 'dropStash';
readonly selector: string;
}
export interface ResponseDropStash extends ResponseWithErrorInfo {
readonly command: 'dropStash';
}
export interface RequestEditRemote extends RepoRequest {
readonly command: 'editRemote';
readonly nameOld: string;
readonly nameNew: string;
readonly urlOld: string | null;
readonly urlNew: string | null;
readonly pushUrlOld: string | null;
readonly pushUrlNew: string | null;
}
export interface ResponseEditRemote extends ResponseWithErrorInfo {
readonly command: 'editRemote';
}
export interface RequestEditUserDetails extends RepoRequest {
readonly command: 'editUserDetails';
readonly name: string;
readonly email: string;
readonly location: GitConfigLocation.Global | GitConfigLocation.Local;
readonly deleteLocalName: boolean; // TRUE => Delete Local Name, FALSE => Don't Delete Local Name
readonly deleteLocalEmail: boolean; // TRUE => Delete Local Email, FALSE => Don't Delete Local Email
}
export interface ResponseEditUserDetails extends ResponseWithMultiErrorInfo {
readonly command: 'editUserDetails';
}
export interface RequestEndCodeReview extends RepoRequest {
readonly command: 'endCodeReview';
readonly id: string;
}
export interface RequestExportRepoConfig extends RepoRequest {
readonly command: 'exportRepoConfig';
}
export interface ResponseExportRepoConfig extends ResponseWithErrorInfo {
readonly command: 'exportRepoConfig';
}
export interface RequestFetch extends RepoRequest {
readonly command: 'fetch';
readonly name: string | null; // null => Fetch all remotes
readonly prune: boolean;
readonly pruneTags: boolean;
}
export interface ResponseFetch extends ResponseWithErrorInfo {
readonly command: 'fetch';
}
export interface RequestFetchAvatar extends RepoRequest {
readonly command: 'fetchAvatar';
readonly remote: string | null;
readonly email: string;
readonly commits: string[];
}
export interface ResponseFetchAvatar extends BaseMessage {
readonly command: 'fetchAvatar';
readonly email: string;
readonly image: string;
}
export interface RequestFetchIntoLocalBranch extends RepoRequest {
readonly command: 'fetchIntoLocalBranch';
readonly remote: string;
readonly remoteBranch: string;
readonly localBranch: string;
readonly force: boolean;
}
export interface ResponseFetchIntoLocalBranch extends ResponseWithErrorInfo {
readonly command: 'fetchIntoLocalBranch';
}
export interface RequestLoadCommits extends RepoRequest {
readonly command: 'loadCommits';
readonly refreshId: number;
readonly branches: ReadonlyArray<string> | null; // null => Show All
readonly maxCommits: number;
readonly showTags: boolean;
readonly showRemoteBranches: boolean;
readonly includeCommitsMentionedByReflogs: boolean;
readonly onlyFollowFirstParent: boolean;
readonly commitOrdering: CommitOrdering;
readonly remotes: ReadonlyArray<string>;
readonly hideRemotes: ReadonlyArray<string>;
readonly stashes: ReadonlyArray<GitStash>;
}
export interface ResponseLoadCommits extends ResponseWithErrorInfo {
readonly command: 'loadCommits';
readonly refreshId: number;
readonly commits: GitCommit[];
readonly head: string | null;
readonly tags: string[];
readonly moreCommitsAvailable: boolean;
readonly onlyFollowFirstParent: boolean;
}
export interface RequestLoadConfig extends RepoRequest {
readonly command: 'loadConfig';
readonly remotes: ReadonlyArray<string>;
}
export interface ResponseLoadConfig extends ResponseWithErrorInfo {
readonly command: 'loadConfig';
readonly repo: string;
readonly config: GitRepoConfig | null;
}
export interface RequestLoadRepoInfo extends RepoRequest {
readonly command: 'loadRepoInfo';
readonly refreshId: number;
readonly showRemoteBranches: boolean;
readonly showStashes: boolean;
readonly hideRemotes: ReadonlyArray<string>;
}
export interface ResponseLoadRepoInfo extends ResponseWithErrorInfo {
readonly command: 'loadRepoInfo';
readonly refreshId: number;
readonly branches: ReadonlyArray<string>;
readonly head: string | null;
readonly remotes: ReadonlyArray<string>;
readonly stashes: ReadonlyArray<GitStash>;
readonly isRepo: boolean;
}
export interface RequestLoadRepos extends BaseMessage {
readonly command: 'loadRepos';
readonly check: boolean;
}
export interface ResponseLoadRepos extends BaseMessage {
readonly command: 'loadRepos';
readonly repos: GitRepoSet;
readonly lastActiveRepo: string | null;
readonly loadViewTo: LoadGitGraphViewTo;
}
export const enum MergeActionOn {
Branch = 'Branch',
RemoteTrackingBranch = 'Remote-tracking Branch',
Commit = 'Commit'
}
export interface RequestMerge extends RepoRequest {
readonly command: 'merge';
readonly obj: string;
readonly actionOn: MergeActionOn;
readonly createNewCommit: boolean;
readonly squash: boolean;
readonly noCommit: boolean;
}
export interface ResponseMerge extends ResponseWithErrorInfo {
readonly command: 'merge';
readonly actionOn: MergeActionOn;
}
export interface RequestOpenExtensionSettings extends BaseMessage {
readonly command: 'openExtensionSettings';
}
export interface ResponseOpenExtensionSettings extends ResponseWithErrorInfo {
readonly command: 'openExtensionSettings';
}
export interface RequestOpenExternalDirDiff extends RepoRequest {
readonly command: 'openExternalDirDiff';
readonly fromHash: string;
readonly toHash: string;
readonly isGui: boolean;
}
export interface ResponseOpenExternalDirDiff extends ResponseWithErrorInfo {
readonly command: 'openExternalDirDiff';
}
export interface RequestOpenExternalUrl extends BaseMessage {
readonly command: 'openExternalUrl';
readonly url: string;
}
export interface ResponseOpenExternalUrl extends ResponseWithErrorInfo {
readonly command: 'openExternalUrl';
}
export interface RequestOpenFile extends RepoRequest {
readonly command: 'openFile';
readonly hash: string;
readonly filePath: string;
}
export interface ResponseOpenFile extends ResponseWithErrorInfo {
readonly command: 'openFile';
}
export interface RequestOpenTerminal extends RepoRequest {
readonly command: 'openTerminal';
readonly name: string;
}
export interface ResponseOpenTerminal extends ResponseWithErrorInfo {
readonly command: 'openTerminal';
}
export interface RequestPopStash extends RepoRequest {
readonly command: 'popStash';
readonly selector: string;
readonly reinstateIndex: boolean;
}
export interface ResponsePopStash extends ResponseWithErrorInfo {
readonly command: 'popStash';