Skip to content

Commit 0a95e73

Browse files
committed
Adds stashes into Commit view
1 parent 519faf0 commit 0a95e73

File tree

15 files changed

+314
-44
lines changed

15 files changed

+314
-44
lines changed

package.json

Lines changed: 153 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,13 @@
17431743
"title": "Commits View",
17441744
"order": 110,
17451745
"properties": {
1746+
"gitlens.views.commits.showStashes": {
1747+
"type": "boolean",
1748+
"default": false,
1749+
"markdownDescription": "Specifies whether to show stashes in the _Commits_ view",
1750+
"scope": "window",
1751+
"order": 9
1752+
},
17461753
"gitlens.views.commits.showBranchComparison": {
17471754
"type": [
17481755
"boolean",
@@ -2070,7 +2077,7 @@
20702077
},
20712078
"gitlens.views.repositories.showStashes": {
20722079
"type": "boolean",
2073-
"default": true,
2080+
"default": false,
20742081
"markdownDescription": "Specifies whether to show the stashes for each repository in the _Repositories_ view",
20752082
"scope": "window",
20762083
"order": 33
@@ -2192,6 +2199,13 @@
21922199
"scope": "window",
21932200
"order": 90
21942201
},
2202+
"gitlens.views.repositories.branches.showStashes": {
2203+
"type": "boolean",
2204+
"default": false,
2205+
"markdownDescription": "Specifies whether to show stashes in the _Commits_ and _Branches_ sections of the _Repositories_ view",
2206+
"scope": "window",
2207+
"order": 95
2208+
},
21952209
"gitlens.views.repositories.branches.showBranchComparison": {
21962210
"type": [
21972211
"boolean",
@@ -2355,6 +2369,13 @@
23552369
"title": "Branches View",
23562370
"order": 170,
23572371
"properties": {
2372+
"gitlens.views.branches.showStashes": {
2373+
"type": "boolean",
2374+
"default": false,
2375+
"markdownDescription": "Specifies whether to show stashes in the _Branches_ view",
2376+
"scope": "window",
2377+
"order": 9
2378+
},
23582379
"gitlens.views.branches.showBranchComparison": {
23592380
"type": [
23602381
"boolean",
@@ -2756,6 +2777,13 @@
27562777
"scope": "resource",
27572778
"order": 12
27582779
},
2780+
"gitlens.views.worktrees.showStashes": {
2781+
"type": "boolean",
2782+
"default": false,
2783+
"markdownDescription": "Specifies whether to show stashes in the _Worktrees_ view",
2784+
"scope": "window",
2785+
"order": 19
2786+
},
27592787
"gitlens.views.worktrees.showBranchComparison": {
27602788
"type": [
27612789
"boolean",
@@ -3229,7 +3257,7 @@
32293257
},
32303258
"gitlens.views.workspaces.showStashes": {
32313259
"type": "boolean",
3232-
"default": true,
3260+
"default": false,
32333261
"markdownDescription": "Specifies whether to show the stashes for each repository in the _Cloud Workspaces_ view",
32343262
"scope": "window",
32353263
"order": 33
@@ -3337,6 +3365,13 @@
33373365
"scope": "window",
33383366
"order": 90
33393367
},
3368+
"gitlens.views.workspaces.branches.showStashes": {
3369+
"type": "boolean",
3370+
"default": false,
3371+
"markdownDescription": "Specifies whether to show stashes in the _Commits_ and _Branches_ sections of the _Cloud Workspaces_ view",
3372+
"scope": "window",
3373+
"order": 9
3374+
},
33403375
"gitlens.views.workspaces.branches.showBranchComparison": {
33413376
"type": [
33423377
"boolean",
@@ -7673,6 +7708,14 @@
76737708
"command": "gitlens.views.branches.setShowBranchPullRequestOff",
76747709
"title": "Hide Branch Pull Requests"
76757710
},
7711+
{
7712+
"command": "gitlens.views.branches.setShowStashesOn",
7713+
"title": "Show Stashes"
7714+
},
7715+
{
7716+
"command": "gitlens.views.branches.setShowStashesOff",
7717+
"title": "Hide Stashes"
7718+
},
76767719
{
76777720
"command": "gitlens.views.commitDetails.refresh",
76787721
"title": "Refresh",
@@ -7759,6 +7802,14 @@
77597802
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
77607803
"title": "Hide Current Branch Pull Request"
77617804
},
7805+
{
7806+
"command": "gitlens.views.commits.setShowStashesOn",
7807+
"title": "Show Stashes"
7808+
},
7809+
{
7810+
"command": "gitlens.views.commits.setShowStashesOff",
7811+
"title": "Hide Stashes"
7812+
},
77627813
{
77637814
"command": "gitlens.views.contributors.copy",
77647815
"title": "Copy"
@@ -8804,6 +8855,14 @@
88048855
"command": "gitlens.views.worktrees.setShowBranchPullRequestOff",
88058856
"title": "Hide Branch Pull Requests"
88068857
},
8858+
{
8859+
"command": "gitlens.views.worktrees.setShowStashesOn",
8860+
"title": "Show Stashes"
8861+
},
8862+
{
8863+
"command": "gitlens.views.worktrees.setShowStashesOff",
8864+
"title": "Hide Stashes"
8865+
},
88078866
{
88088867
"command": "gitlens.enableDebugLogging",
88098868
"title": "Enable Debug Logging",
@@ -11224,6 +11283,14 @@
1122411283
"command": "gitlens.views.branches.setShowBranchPullRequestOff",
1122511284
"when": "false"
1122611285
},
11286+
{
11287+
"command": "gitlens.views.branches.setShowStashesOn",
11288+
"when": "false"
11289+
},
11290+
{
11291+
"command": "gitlens.views.branches.setShowStashesOff",
11292+
"when": "false"
11293+
},
1122711294
{
1122811295
"command": "gitlens.views.commitDetails.refresh",
1122911296
"when": "false"
@@ -11300,6 +11367,14 @@
1130011367
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
1130111368
"when": "false"
1130211369
},
11370+
{
11371+
"command": "gitlens.views.commits.setShowStashesOn",
11372+
"when": "false"
11373+
},
11374+
{
11375+
"command": "gitlens.views.commits.setShowStashesOff",
11376+
"when": "false"
11377+
},
1130311378
{
1130411379
"command": "gitlens.views.contributors.copy",
1130511380
"when": "false"
@@ -12196,6 +12271,14 @@
1219612271
"command": "gitlens.views.worktrees.setShowBranchPullRequestOff",
1219712272
"when": "false"
1219812273
},
12274+
{
12275+
"command": "gitlens.views.worktrees.setShowStashesOn",
12276+
"when": "false"
12277+
},
12278+
{
12279+
"command": "gitlens.views.worktrees.setShowStashesOff",
12280+
"when": "false"
12281+
},
1219912282
{
1220012283
"command": "gitlens.graph.switchToEditorLayout",
1220112284
"when": "gitlens:enabled && config.gitlens.graph.layout != editor"
@@ -13229,6 +13312,16 @@
1322913312
"when": "view == gitlens.views.branches && config.gitlens.views.branches.pullRequests.enabled && config.gitlens.views.branches.pullRequests.showForBranches",
1323013313
"group": "5_gitlens@2"
1323113314
},
13315+
{
13316+
"command": "gitlens.views.branches.setShowStashesOn",
13317+
"when": "view == gitlens.views.branches && !config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
13318+
"group": "5_gitlens@11"
13319+
},
13320+
{
13321+
"command": "gitlens.views.branches.setShowStashesOff",
13322+
"when": "view == gitlens.views.branches && config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
13323+
"group": "5_gitlens@11"
13324+
},
1323213325
{
1323313326
"command": "gitlens.pushRepositories",
1323413327
"when": "gitlens:repos:withRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && view == gitlens.views.commits",
@@ -13337,7 +13430,17 @@
1333713430
{
1333813431
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
1333913432
"when": "view == gitlens.views.commits && config.gitlens.views.commits.pullRequests.enabled && config.gitlens.views.commits.pullRequests.showForBranches",
13340-
"group": "5_gitlens@4"
13433+
"group": "5_gitlens@3"
13434+
},
13435+
{
13436+
"command": "gitlens.views.commits.setShowStashesOn",
13437+
"when": "view == gitlens.views.commits && !config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
13438+
"group": "5_gitlens@11"
13439+
},
13440+
{
13441+
"command": "gitlens.views.commits.setShowStashesOff",
13442+
"when": "view == gitlens.views.commits && config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
13443+
"group": "5_gitlens@11"
1334113444
},
1334213445
{
1334313446
"command": "gitlens.showGraph",
@@ -14289,15 +14392,25 @@
1428914392
"when": "view == gitlens.views.worktrees && config.gitlens.views.worktrees.pullRequests.enabled && config.gitlens.views.worktrees.pullRequests.showForBranches",
1429014393
"group": "5_gitlens@2"
1429114394
},
14395+
{
14396+
"command": "gitlens.views.worktrees.setShowStashesOn",
14397+
"when": "view == gitlens.views.worktrees && !config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
14398+
"group": "5_gitlens@11"
14399+
},
14400+
{
14401+
"command": "gitlens.views.worktrees.setShowStashesOff",
14402+
"when": "view == gitlens.views.worktrees && config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
14403+
"group": "5_gitlens@11"
14404+
},
1429214405
{
1429314406
"command": "gitlens.views.setShowRelativeDateMarkersOn",
1429414407
"when": "view =~ /^gitlens\\.views\\.(branches|commits|contributors|fileHistory|lineHistory|remotes|repositories|tags|worktrees)/ && !config.gitlens.views.showRelativeDateMarkers",
14295-
"group": "5_gitlens@3"
14408+
"group": "5_gitlens@10"
1429614409
},
1429714410
{
1429814411
"command": "gitlens.views.setShowRelativeDateMarkersOff",
1429914412
"when": "view =~ /^gitlens\\.views\\.(branches|commits|contributors|fileHistory|lineHistory|remotes|repositories|tags|worktrees)/ && config.gitlens.views.showRelativeDateMarkers",
14300-
"group": "5_gitlens@3"
14413+
"group": "5_gitlens@10"
1430114414
},
1430214415
{
1430314416
"submenu": "gitlens/graph/configuration",
@@ -17421,12 +17534,12 @@
1742117534
},
1742217535
{
1742317536
"command": "gitlens.views.repositories.setShowStashesOn",
17424-
"when": "!config.gitlens.views.repositories.showStashes",
17537+
"when": "!config.gitlens.views.repositories.showStashes && !gitlens:hasVirtualFolders",
1742517538
"group": "2_gitlens@5"
1742617539
},
1742717540
{
1742817541
"command": "gitlens.views.repositories.setShowStashesOff",
17429-
"when": "config.gitlens.views.repositories.showStashes",
17542+
"when": "config.gitlens.views.repositories.showStashes && !gitlens:hasVirtualFolders",
1743017543
"group": "2_gitlens@5"
1743117544
},
1743217545
{
@@ -17756,12 +17869,12 @@
1775617869
{
1775717870
"command": "gitlens.views.setShowRelativeDateMarkersOn",
1775817871
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view =~ /(branches|commits|contributors|remotes|repositories|tags|worktrees)/ && !config.gitlens.views.showRelativeDateMarkers",
17759-
"group": "5_gitlens@3"
17872+
"group": "5_gitlens@10"
1776017873
},
1776117874
{
1776217875
"command": "gitlens.views.setShowRelativeDateMarkersOff",
1776317876
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view =~ /(branches|commits|contributors|remotes|repositories|tags|worktrees)/ && config.gitlens.views.showRelativeDateMarkers",
17764-
"group": "5_gitlens@3"
17877+
"group": "5_gitlens@10"
1776517878
},
1776617879
{
1776717880
"command": "gitlens.views.branches.setLayoutToList",
@@ -17818,6 +17931,16 @@
1781817931
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches && config.gitlens.views.branches.pullRequests.enabled && config.gitlens.views.branches.pullRequests.showForBranches",
1781917932
"group": "5_gitlens@2"
1782017933
},
17934+
{
17935+
"command": "gitlens.views.branches.setShowStashesOn",
17936+
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches && !config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
17937+
"group": "5_gitlens@11"
17938+
},
17939+
{
17940+
"command": "gitlens.views.branches.setShowStashesOff",
17941+
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches && config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
17942+
"group": "5_gitlens@11"
17943+
},
1782117944
{
1782217945
"command": "gitlens.showSettingsPage!branches-view",
1782317946
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches",
@@ -17876,7 +17999,17 @@
1787617999
{
1787718000
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
1787818001
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == commits && config.gitlens.views.commits.pullRequests.enabled && config.gitlens.views.commits.pullRequests.showForBranches",
17879-
"group": "5_gitlens@4"
18002+
"group": "5_gitlens@3"
18003+
},
18004+
{
18005+
"command": "gitlens.views.commits.setShowStashesOn",
18006+
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == commits && !config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
18007+
"group": "5_gitlens@11"
18008+
},
18009+
{
18010+
"command": "gitlens.views.commits.setShowStashesOff",
18011+
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == commits && config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
18012+
"group": "5_gitlens@11"
1788018013
},
1788118014
{
1788218015
"command": "gitlens.showSettingsPage!commits-view",
@@ -18198,6 +18331,16 @@
1819818331
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees && config.gitlens.views.worktrees.pullRequests.enabled && config.gitlens.views.worktrees.pullRequests.showForBranches",
1819918332
"group": "5_gitlens@2"
1820018333
},
18334+
{
18335+
"command": "gitlens.views.worktrees.setShowStashesOn",
18336+
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees && !config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
18337+
"group": "5_gitlens@11"
18338+
},
18339+
{
18340+
"command": "gitlens.views.worktrees.setShowStashesOff",
18341+
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees && config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
18342+
"group": "5_gitlens@11"
18343+
},
1820118344
{
1820218345
"command": "gitlens.showSettingsPage!worktrees-view",
1820318346
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees",

src/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ export interface BranchesViewConfig {
700700
};
701701
readonly reveal: boolean;
702702
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
703+
readonly showStashes: boolean;
703704
}
704705

705706
export interface CommitsViewConfig {
@@ -713,6 +714,7 @@ export interface CommitsViewConfig {
713714
};
714715
readonly reveal: boolean;
715716
readonly showBranchComparison: false | ViewShowBranchComparison;
717+
readonly showStashes: boolean;
716718
}
717719

718720
export interface CommitDetailsViewConfig {
@@ -806,6 +808,7 @@ export interface RepositoriesViewConfig {
806808
readonly branches: {
807809
readonly layout: ViewBranchesLayout;
808810
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
811+
readonly showStashes: boolean;
809812
};
810813
readonly compact: boolean;
811814
readonly files: ViewsFilesConfig;
@@ -860,13 +863,15 @@ export interface WorktreesViewConfig {
860863
};
861864
readonly reveal: boolean;
862865
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
866+
readonly showStashes: boolean;
863867
}
864868

865869
export interface WorkspacesViewConfig {
866870
readonly avatars: boolean;
867871
readonly branches: {
868872
readonly layout: ViewBranchesLayout;
869873
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
874+
readonly showStashes: boolean;
870875
};
871876
readonly compact: boolean;
872877
readonly files: ViewsFilesConfig;

src/constants.commands.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ export type TreeViewCommands = `gitlens.views.${
337337
| `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
338338
| `setShowAvatars${'On' | 'Off'}`
339339
| `setShowBranchComparison${'On' | 'Off'}`
340-
| `setShowBranchPullRequest${'On' | 'Off'}`}`
340+
| `setShowBranchPullRequest${'On' | 'Off'}`
341+
| `setShowStashes${'On' | 'Off'}`}`
341342
| `commits.${
342343
| 'copy'
343344
| 'refresh'
@@ -346,7 +347,8 @@ export type TreeViewCommands = `gitlens.views.${
346347
| `setShowAvatars${'On' | 'Off'}`
347348
| `setShowBranchComparison${'On' | 'Off'}`
348349
| `setShowBranchPullRequest${'On' | 'Off'}`
349-
| `setShowMergeCommits${'On' | 'Off'}`}`
350+
| `setShowMergeCommits${'On' | 'Off'}`
351+
| `setShowStashes${'On' | 'Off'}`}`
350352
| `contributors.${
351353
| 'copy'
352354
| 'refresh'
@@ -451,7 +453,8 @@ export type TreeViewCommands = `gitlens.views.${
451453
| `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
452454
| `setShowAvatars${'On' | 'Off'}`
453455
| `setShowBranchComparison${'On' | 'Off'}`
454-
| `setShowBranchPullRequest${'On' | 'Off'}`}`}`;
456+
| `setShowBranchPullRequest${'On' | 'Off'}`
457+
| `setShowStashes${'On' | 'Off'}`}`}`;
455458

456459
type ExtractSuffix<Prefix extends string, U> = U extends `${Prefix}${infer V}` ? V : never;
457460
type FilterCommands<Prefix extends string, U> = U extends `${Prefix}${infer V}` ? `${Prefix}${V}` : never;

0 commit comments

Comments
 (0)