Git - add "Stashes" node to the repositories view (#279400)

* WIP - Initial implementation

* Get author and committer date for a stash

* Add drop stash command

* More cleanup
This commit is contained in:
Ladislau Szomoru
2025-11-25 17:13:48 +00:00
committed by GitHub
parent 0432ed536c
commit f297f37463
9 changed files with 279 additions and 59 deletions

View File

@@ -1089,6 +1089,34 @@
"title": "%command.createFrom%",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.stashView",
"title": "%command.stashView2%",
"icon": "$(diff-multiple)",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.stashApply",
"title": "%command.stashApplyEditor%",
"icon": "$(git-stash-apply)",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.stashPop",
"title": "%command.stashPopEditor%",
"icon": "$(git-stash-pop)",
"category": "Git",
"enablement": "!operationInProgress"
},
{
"command": "git.repositories.stashDrop",
"title": "%command.stashDropEditor%",
"icon": "$(trash)",
"category": "Git",
"enablement": "!operationInProgress"
}
],
"continueEditSession": [
@@ -1752,6 +1780,22 @@
{
"command": "git.repositories.createFrom",
"when": "false"
},
{
"command": "git.repositories.stashView",
"when": "false"
},
{
"command": "git.repositories.stashApply",
"when": "false"
},
{
"command": "git.repositories.stashPop",
"when": "false"
},
{
"command": "git.repositories.stashDrop",
"when": "false"
}
],
"scm/title": [
@@ -1952,23 +1996,59 @@
"command": "git.repositories.createTag",
"group": "inline@1",
"when": "scmProvider == git && scmArtifactGroup == tags"
},
{
"submenu": "git.repositories.stash",
"group": "inline@1",
"when": "scmProvider == git && scmArtifactGroup == stashes"
}
],
"scm/artifact/context": [
{
"command": "git.repositories.checkout",
"group": "inline@1",
"when": "scmProvider == git"
"when": "scmProvider == git && (scmArtifactGroupId == branches || scmArtifactGroupId == tags)"
},
{
"command": "git.repositories.stashApply",
"alt": "git.repositories.stashPop",
"group": "inline@1",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.stashView",
"group": "inline@2",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.stashView",
"group": "1_view@1",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.stashApply",
"group": "2_apply@1",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.stashPop",
"group": "2_apply@2",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.stashDrop",
"group": "3_drop@3",
"when": "scmProvider == git && scmArtifactGroupId == stashes"
},
{
"command": "git.repositories.checkout",
"group": "1_checkout@1",
"when": "scmProvider == git"
"when": "scmProvider == git && (scmArtifactGroupId == branches || scmArtifactGroupId == tags)"
},
{
"command": "git.repositories.checkoutDetached",
"group": "1_checkout@2",
"when": "scmProvider == git"
"when": "scmProvider == git && (scmArtifactGroupId == branches || scmArtifactGroupId == tags)"
},
{
"command": "git.repositories.merge",
@@ -1998,7 +2078,7 @@
{
"command": "git.repositories.compareRef",
"group": "4_compare@1",
"when": "scmProvider == git"
"when": "scmProvider == git && (scmArtifactGroupId == branches || scmArtifactGroupId == tags)"
}
],
"scm/resourceGroup/context": [
@@ -2922,6 +3002,21 @@
"group": "5_preview@1"
}
],
"git.repositories.stash": [
{
"command": "git.stash",
"group": "1_stash@1"
},
{
"command": "git.stashStaged",
"when": "gitVersion2.35",
"group": "2_stash@1"
},
{
"command": "git.stashIncludeUntracked",
"group": "2_stash@2"
}
],
"git.tags": [
{
"command": "git.createTag",
@@ -2991,6 +3086,11 @@
{
"id": "git.worktrees",
"label": "%submenu.worktrees%"
},
{
"id": "git.repositories.stash",
"label": "%submenu.stash%",
"icon": "$(plus)"
}
],
"configuration": {