Skip to content

Commit

Permalink
Adds stashes into Commit view
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Dec 5, 2024
1 parent 519faf0 commit 5008179
Show file tree
Hide file tree
Showing 15 changed files with 314 additions and 44 deletions.
163 changes: 153 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,13 @@
"title": "Commits View",
"order": 110,
"properties": {
"gitlens.views.commits.showStashes": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show stashes in the _Commits_ view",
"scope": "window",
"order": 9
},
"gitlens.views.commits.showBranchComparison": {
"type": [
"boolean",
Expand Down Expand Up @@ -2070,7 +2077,7 @@
},
"gitlens.views.repositories.showStashes": {
"type": "boolean",
"default": true,
"default": false,
"markdownDescription": "Specifies whether to show the stashes for each repository in the _Repositories_ view",
"scope": "window",
"order": 33
Expand Down Expand Up @@ -2192,6 +2199,13 @@
"scope": "window",
"order": 90
},
"gitlens.views.repositories.branches.showStashes": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show stashes in the _Commits_ and _Branches_ sections of the _Repositories_ view",
"scope": "window",
"order": 95
},
"gitlens.views.repositories.branches.showBranchComparison": {
"type": [
"boolean",
Expand Down Expand Up @@ -2355,6 +2369,13 @@
"title": "Branches View",
"order": 170,
"properties": {
"gitlens.views.branches.showStashes": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show stashes in the _Branches_ view",
"scope": "window",
"order": 9
},
"gitlens.views.branches.showBranchComparison": {
"type": [
"boolean",
Expand Down Expand Up @@ -2756,6 +2777,13 @@
"scope": "resource",
"order": 12
},
"gitlens.views.worktrees.showStashes": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show stashes in the _Worktrees_ view",
"scope": "window",
"order": 19
},
"gitlens.views.worktrees.showBranchComparison": {
"type": [
"boolean",
Expand Down Expand Up @@ -3229,7 +3257,7 @@
},
"gitlens.views.workspaces.showStashes": {
"type": "boolean",
"default": true,
"default": false,
"markdownDescription": "Specifies whether to show the stashes for each repository in the _Cloud Workspaces_ view",
"scope": "window",
"order": 33
Expand Down Expand Up @@ -3337,6 +3365,13 @@
"scope": "window",
"order": 90
},
"gitlens.views.workspaces.branches.showStashes": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show stashes in the _Commits_ and _Branches_ sections of the _Cloud Workspaces_ view",
"scope": "window",
"order": 9
},
"gitlens.views.workspaces.branches.showBranchComparison": {
"type": [
"boolean",
Expand Down Expand Up @@ -7673,6 +7708,14 @@
"command": "gitlens.views.branches.setShowBranchPullRequestOff",
"title": "Hide Branch Pull Requests"
},
{
"command": "gitlens.views.branches.setShowStashesOn",
"title": "Show Stashes"
},
{
"command": "gitlens.views.branches.setShowStashesOff",
"title": "Hide Stashes"
},
{
"command": "gitlens.views.commitDetails.refresh",
"title": "Refresh",
Expand Down Expand Up @@ -7759,6 +7802,14 @@
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
"title": "Hide Current Branch Pull Request"
},
{
"command": "gitlens.views.commits.setShowStashesOn",
"title": "Show Stashes"
},
{
"command": "gitlens.views.commits.setShowStashesOff",
"title": "Hide Stashes"
},
{
"command": "gitlens.views.contributors.copy",
"title": "Copy"
Expand Down Expand Up @@ -8804,6 +8855,14 @@
"command": "gitlens.views.worktrees.setShowBranchPullRequestOff",
"title": "Hide Branch Pull Requests"
},
{
"command": "gitlens.views.worktrees.setShowStashesOn",
"title": "Show Stashes"
},
{
"command": "gitlens.views.worktrees.setShowStashesOff",
"title": "Hide Stashes"
},
{
"command": "gitlens.enableDebugLogging",
"title": "Enable Debug Logging",
Expand Down Expand Up @@ -11224,6 +11283,14 @@
"command": "gitlens.views.branches.setShowBranchPullRequestOff",
"when": "false"
},
{
"command": "gitlens.views.branches.setShowStashesOn",
"when": "false"
},
{
"command": "gitlens.views.branches.setShowStashesOff",
"when": "false"
},
{
"command": "gitlens.views.commitDetails.refresh",
"when": "false"
Expand Down Expand Up @@ -11300,6 +11367,14 @@
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
"when": "false"
},
{
"command": "gitlens.views.commits.setShowStashesOn",
"when": "false"
},
{
"command": "gitlens.views.commits.setShowStashesOff",
"when": "false"
},
{
"command": "gitlens.views.contributors.copy",
"when": "false"
Expand Down Expand Up @@ -12196,6 +12271,14 @@
"command": "gitlens.views.worktrees.setShowBranchPullRequestOff",
"when": "false"
},
{
"command": "gitlens.views.worktrees.setShowStashesOn",
"when": "false"
},
{
"command": "gitlens.views.worktrees.setShowStashesOff",
"when": "false"
},
{
"command": "gitlens.graph.switchToEditorLayout",
"when": "gitlens:enabled && config.gitlens.graph.layout != editor"
Expand Down Expand Up @@ -13229,6 +13312,16 @@
"when": "view == gitlens.views.branches && config.gitlens.views.branches.pullRequests.enabled && config.gitlens.views.branches.pullRequests.showForBranches",
"group": "5_gitlens@2"
},
{
"command": "gitlens.views.branches.setShowStashesOn",
"when": "view == gitlens.views.branches && !config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.branches.setShowStashesOff",
"when": "view == gitlens.views.branches && config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.pushRepositories",
"when": "gitlens:repos:withRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && view == gitlens.views.commits",
Expand Down Expand Up @@ -13337,7 +13430,17 @@
{
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
"when": "view == gitlens.views.commits && config.gitlens.views.commits.pullRequests.enabled && config.gitlens.views.commits.pullRequests.showForBranches",
"group": "5_gitlens@4"
"group": "5_gitlens@3"
},
{
"command": "gitlens.views.commits.setShowStashesOn",
"when": "view == gitlens.views.commits && !config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.commits.setShowStashesOff",
"when": "view == gitlens.views.commits && config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.showGraph",
Expand Down Expand Up @@ -14289,15 +14392,25 @@
"when": "view == gitlens.views.worktrees && config.gitlens.views.worktrees.pullRequests.enabled && config.gitlens.views.worktrees.pullRequests.showForBranches",
"group": "5_gitlens@2"
},
{
"command": "gitlens.views.worktrees.setShowStashesOn",
"when": "view == gitlens.views.worktrees && !config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.worktrees.setShowStashesOff",
"when": "view == gitlens.views.worktrees && config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.setShowRelativeDateMarkersOn",
"when": "view =~ /^gitlens\\.views\\.(branches|commits|contributors|fileHistory|lineHistory|remotes|repositories|tags|worktrees)/ && !config.gitlens.views.showRelativeDateMarkers",
"group": "5_gitlens@3"
"group": "5_gitlens@10"
},
{
"command": "gitlens.views.setShowRelativeDateMarkersOff",
"when": "view =~ /^gitlens\\.views\\.(branches|commits|contributors|fileHistory|lineHistory|remotes|repositories|tags|worktrees)/ && config.gitlens.views.showRelativeDateMarkers",
"group": "5_gitlens@3"
"group": "5_gitlens@10"
},
{
"submenu": "gitlens/graph/configuration",
Expand Down Expand Up @@ -17421,12 +17534,12 @@
},
{
"command": "gitlens.views.repositories.setShowStashesOn",
"when": "!config.gitlens.views.repositories.showStashes",
"when": "!config.gitlens.views.repositories.showStashes && !gitlens:hasVirtualFolders",
"group": "2_gitlens@5"
},
{
"command": "gitlens.views.repositories.setShowStashesOff",
"when": "config.gitlens.views.repositories.showStashes",
"when": "config.gitlens.views.repositories.showStashes && !gitlens:hasVirtualFolders",
"group": "2_gitlens@5"
},
{
Expand Down Expand Up @@ -17756,12 +17869,12 @@
{
"command": "gitlens.views.setShowRelativeDateMarkersOn",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view =~ /(branches|commits|contributors|remotes|repositories|tags|worktrees)/ && !config.gitlens.views.showRelativeDateMarkers",
"group": "5_gitlens@3"
"group": "5_gitlens@10"
},
{
"command": "gitlens.views.setShowRelativeDateMarkersOff",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view =~ /(branches|commits|contributors|remotes|repositories|tags|worktrees)/ && config.gitlens.views.showRelativeDateMarkers",
"group": "5_gitlens@3"
"group": "5_gitlens@10"
},
{
"command": "gitlens.views.branches.setLayoutToList",
Expand Down Expand Up @@ -17818,6 +17931,16 @@
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches && config.gitlens.views.branches.pullRequests.enabled && config.gitlens.views.branches.pullRequests.showForBranches",
"group": "5_gitlens@2"
},
{
"command": "gitlens.views.branches.setShowStashesOn",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches && !config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.branches.setShowStashesOff",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches && config.gitlens.views.branches.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.showSettingsPage!branches-view",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == branches",
Expand Down Expand Up @@ -17876,7 +17999,17 @@
{
"command": "gitlens.views.commits.setShowBranchPullRequestOff",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == commits && config.gitlens.views.commits.pullRequests.enabled && config.gitlens.views.commits.pullRequests.showForBranches",
"group": "5_gitlens@4"
"group": "5_gitlens@3"
},
{
"command": "gitlens.views.commits.setShowStashesOn",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == commits && !config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.commits.setShowStashesOff",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == commits && config.gitlens.views.commits.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.showSettingsPage!commits-view",
Expand Down Expand Up @@ -18198,6 +18331,16 @@
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees && config.gitlens.views.worktrees.pullRequests.enabled && config.gitlens.views.worktrees.pullRequests.showForBranches",
"group": "5_gitlens@2"
},
{
"command": "gitlens.views.worktrees.setShowStashesOn",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees && !config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.views.worktrees.setShowStashesOff",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees && config.gitlens.views.worktrees.showStashes && !gitlens:hasVirtualFolders",
"group": "5_gitlens@11"
},
{
"command": "gitlens.showSettingsPage!worktrees-view",
"when": "view == gitlens.views.scm.grouped && gitlens:views:scm:grouped:view == worktrees",
Expand Down
5 changes: 5 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ export interface BranchesViewConfig {
};
readonly reveal: boolean;
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
readonly showStashes: boolean;
}

export interface CommitsViewConfig {
Expand All @@ -713,6 +714,7 @@ export interface CommitsViewConfig {
};
readonly reveal: boolean;
readonly showBranchComparison: false | ViewShowBranchComparison;
readonly showStashes: boolean;
}

export interface CommitDetailsViewConfig {
Expand Down Expand Up @@ -806,6 +808,7 @@ export interface RepositoriesViewConfig {
readonly branches: {
readonly layout: ViewBranchesLayout;
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
readonly showStashes: boolean;
};
readonly compact: boolean;
readonly files: ViewsFilesConfig;
Expand Down Expand Up @@ -860,13 +863,15 @@ export interface WorktreesViewConfig {
};
readonly reveal: boolean;
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
readonly showStashes: boolean;
}

export interface WorkspacesViewConfig {
readonly avatars: boolean;
readonly branches: {
readonly layout: ViewBranchesLayout;
readonly showBranchComparison: false | Extract<ViewShowBranchComparison, 'branch'>;
readonly showStashes: boolean;
};
readonly compact: boolean;
readonly files: ViewsFilesConfig;
Expand Down
9 changes: 6 additions & 3 deletions src/constants.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ export type TreeViewCommands = `gitlens.views.${
| `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
| `setShowAvatars${'On' | 'Off'}`
| `setShowBranchComparison${'On' | 'Off'}`
| `setShowBranchPullRequest${'On' | 'Off'}`}`
| `setShowBranchPullRequest${'On' | 'Off'}`
| `setShowStashes${'On' | 'Off'}`}`
| `commits.${
| 'copy'
| 'refresh'
Expand All @@ -346,7 +347,8 @@ export type TreeViewCommands = `gitlens.views.${
| `setShowAvatars${'On' | 'Off'}`
| `setShowBranchComparison${'On' | 'Off'}`
| `setShowBranchPullRequest${'On' | 'Off'}`
| `setShowMergeCommits${'On' | 'Off'}`}`
| `setShowMergeCommits${'On' | 'Off'}`
| `setShowStashes${'On' | 'Off'}`}`
| `contributors.${
| 'copy'
| 'refresh'
Expand Down Expand Up @@ -451,7 +453,8 @@ export type TreeViewCommands = `gitlens.views.${
| `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
| `setShowAvatars${'On' | 'Off'}`
| `setShowBranchComparison${'On' | 'Off'}`
| `setShowBranchPullRequest${'On' | 'Off'}`}`}`;
| `setShowBranchPullRequest${'On' | 'Off'}`
| `setShowStashes${'On' | 'Off'}`}`}`;

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

0 comments on commit 5008179

Please sign in to comment.