From fd233a51958357c90e14db9153707217977a6665 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 10 May 2023 01:09:28 -0400 Subject: [PATCH] Refines commit/file context menus - Moves _Copy Remote \* URL_ from _Copy As_ to _Share_ - Moves _Copy SHA_, _Copy Message_, _Copy Relative Path_ from _Copy As_ to root --- CHANGELOG.md | 7 +++-- package.json | 95 +++++++++++++++++++++--------------------------------------- 2 files changed, 38 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d0c13..6818433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,9 +26,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### Changed - Refines and reorders many of the GitLens context menus and additions to VS Code context menus + - Moves _Copy Remote \* URL_ commands from the _Copy As_ submenu into the _Share_ submenu in GitLens views - Adds a _Share_ submenu to Source Control items - - Consolidates existing file history commands into a _File History_ submenu - - Consolidates existing "Open on Remote" commands into _Open on Remote (Web)_ submenu + - Moves _Copy SHA_ and _Copy Message_ commands on commits from the _Copy As_ submenu into the root of the context menu + - Moves _Copy Relative Path_ command on files from the _Copy As_ submenu into the root of the context menu + - Moves file history commands into a _File History_ submenu + - Moves _Open \* on Remote_ commands into _Open on Remote (Web)_ submenu - Renames the _Commit Changes_ submenu to _Open Changes_ - Renames _Show Commit_ command to _Quick Show Commit_ and _Show Line Commit_ command to _Quick Show Line Commit_ for better clarity as it opens a quick pick menu - Renames _Delete Stash..._ command to _Drop Stash..._ in the _Stashes_ view diff --git a/package.json b/package.json index b92b0b5..83883fa 100644 --- a/package.json +++ b/package.json @@ -10893,9 +10893,24 @@ "group": "7_gitlens_a_share@1" }, { + "command": "gitlens.copyRelativePathToClipboard", + "when": "viewItem =~ /gitlens:file\\b/", + "group": "7_gitlens_cutcopypaste@2" + }, + { + "command": "gitlens.copyShaToClipboard", + "when": "(viewItem =~ /gitlens:commit\\b/) || (viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/ && view =~ /gitlens\\.views\\.(file|line)History/)", + "group": "7_gitlens_cutcopypaste@3" + }, + { + "command": "gitlens.copyMessageToClipboard", + "when": "(viewItem =~ /gitlens:(commit|stash)\\b/) || (viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/ && view =~ /gitlens\\.views\\.(file|line)History/)", + "group": "7_gitlens_cutcopypaste@4" + }, + { "submenu": "gitlens/commit/copy", "when": "viewItem =~ /gitlens:(branch|commit|remote|repo-folder|repository|stash|tag|file\\b(?=.*?\\b\\+committed\\b))\\b/", - "group": "7_gitlens_cutcopypaste@2" + "group": "7_gitlens_cutcopypaste@10" }, { "command": "gitlens.views.openFile", @@ -11008,13 +11023,13 @@ "alt": "gitlens.copyRemoteFileUrlWithoutRange" }, { - "submenu": "gitlens/commit/file/history", - "when": "viewItem =~ /gitlens:file\\b/", + "submenu": "gitlens/commit/file/commit", + "when": "view =~ /^gitlens\\.views\\.(fileHistory|lineHistory)/ && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/", "group": "3_gitlens_explore@1" }, { - "submenu": "gitlens/commit/file/commit", - "when": "view =~ /^gitlens\\.views\\.(fileHistory|lineHistory)/ && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)/", + "submenu": "gitlens/commit/file/history", + "when": "viewItem =~ /gitlens:file\\b/", "group": "3_gitlens_explore@2" }, { @@ -11983,11 +11998,16 @@ "group": "7_gitlens_a_share@1" }, { - "submenu": "gitlens/commit/copy", - "when": "webviewItem =~ /gitlens:(branch|commit|stash|tag)\\b/", + "command": "gitlens.graph.copySha", + "when": "webviewItem =~ /gitlens:(branch|commit|tag)\\b/", "group": "7_gitlens_cutcopypaste@2" }, { + "command": "gitlens.graph.copyMessage", + "when": "webviewItem =~ /gitlens:(branch|commit|stash|tag)\\b/", + "group": "7_gitlens_cutcopypaste@3" + }, + { "command": "gitlens.graph.applyStash", "when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem == gitlens:stash", "group": "1_gitlens_actions@1" @@ -12178,59 +12198,14 @@ ], "gitlens/commit/copy": [ { - "command": "gitlens.copyRelativePathToClipboard", - "when": "viewItem =~ /gitlens:file\\b/", - "group": "1_gitlens@1" - }, - { - "command": "gitlens.copyRemoteFileUrlWithoutRange", - "when": "gitlens:hasRemotes && viewItem =~ /gitlens:(file\\b(?=.*?\\b\\+committed\\b)|history:(file|line)|status:file)\\b/", - "group": "2_gitlens@1" - }, - { "command": "gitlens.copyShaToClipboard", - "when": "viewItem =~ /gitlens:(?!(remote|repo-folder|repository|stash)\\b)/", - "group": "1_gitlens@2" - }, - { - "command": "gitlens.graph.copySha", - "when": "webviewItem =~ /gitlens:(?!stash\\b)/", + "when": "viewItem =~ /gitlens:(?!(commit|file|remote|repo-folder|repository|stash)\\b)/", "group": "1_gitlens@2" }, { "command": "gitlens.copyMessageToClipboard", - "when": "viewItem =~ /gitlens:(?!(remote|repo-folder|repository)\\b)/", - "group": "1_gitlens@3" - }, - { - "command": "gitlens.graph.copyMessage", - "when": "webviewItem", + "when": "viewItem =~ /gitlens:(?!(commit|file|remote|repo-folder|repository|stash)\\b)/", "group": "1_gitlens@3" - }, - { - "command": "gitlens.copyRemoteCommitUrl", - "when": "gitlens:hasRemotes && viewItem =~ /gitlens:(commit|file\\b(?=.*?\\b\\+committed\\b))/", - "group": "2_gitlens@25" - }, - { - "command": "gitlens.graph.copyRemoteCommitUrl", - "when": "gitlens:hasRemotes && webviewItem =~ /gitlens:commit\\b/", - "group": "2_gitlens@25" - }, - { - "command": "gitlens.copyRemoteBranchUrl", - "when": "gitlens:hasRemotes && viewItem =~ /gitlens:branch\\b/", - "group": "2_gitlens@50" - }, - { - "command": "gitlens.graph.copyRemoteBranchUrl", - "when": "gitlens:hasRemotes && webviewItem =~ /gitlens:branch\\b/", - "group": "2_gitlens@50" - }, - { - "command": "gitlens.copyRemoteRepositoryUrl", - "when": "gitlens:hasRemotes && viewItem =~ /gitlens:(remote|repo-folder|repository)\\b/", - "group": "2_gitlens@99" } ], "gitlens/share": [ @@ -12323,23 +12298,19 @@ "gitlens/commit/changes": [ { "command": "gitlens.views.openChangedFileDiffs", - "when": "viewItem =~ /gitlens:(commit|stash|results:files)\\b/", - "group": "2_gitlens_quickopen@1" + "group": "1_gitlens@1" }, { "command": "gitlens.views.openChangedFileDiffsWithWorking", - "when": "viewItem =~ /gitlens:(commit|stash|results:files)\\b/", - "group": "2_gitlens_quickopen@2" + "group": "1_gitlens@2" }, { "command": "gitlens.views.openChangedFiles", - "when": "viewItem =~ /gitlens:(commit|stash|results:files)\\b/", - "group": "2_gitlens_quickopen_1@1" + "group": "2_gitlens@1" }, { "command": "gitlens.views.openChangedFileRevisions", - "when": "viewItem =~ /gitlens:(commit|stash|results:files)\\b/", - "group": "2_gitlens_quickopen_1@2" + "group": "2_gitlens@2" } ], "gitlens/graph/commit/changes": [