Skip to content

Commit 8fc418b

Browse files
committed
Adds commit --fixup option to Repositories view context menu
Adds a "Commit (Fixup)..." option to commit nodes in the Repositories view. This allows users to quickly create fixup commits that can be automatically squashed during interactive rebase. Changes: - Add commitFixup method to GitOperationsSubProvider interface - Implement commitFixup in OperationsGitSubProvider - Add commitFixup action to RepoActions - Register gitlens.views.commitFixup command in viewCommands - Add menu contribution for commit context menus Fixes #1031
1 parent 3db4e45 commit 8fc418b

7 files changed

Lines changed: 103 additions & 44 deletions

File tree

contributions.json

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7946,6 +7946,19 @@
79467946
]
79477947
}
79487948
},
7949+
"gitlens.views.commitFixup": {
7950+
"label": "Commit (Fixup)...",
7951+
"enablement": "!operationInProgress",
7952+
"menus": {
7953+
"view/item/context": [
7954+
{
7955+
"when": "viewItem =~ /gitlens:commit\\b(?!.*?\\b\\+rebase\\b)/ && !listMultiSelection && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders",
7956+
"group": "1_gitlens_actions",
7957+
"order": 8
7958+
}
7959+
]
7960+
}
7961+
},
79497962
"gitlens.views.commits.attach": {
79507963
"label": "Group into GitLens View",
79517964
"icon": "$(close)",
@@ -19052,14 +19065,14 @@
1905219065
"order": 2,
1905319066
"welcomeContent": [
1905419067
{
19055-
"contents": "Cloud Patches ᴘʀᴇᴠɪᴇᴡ — privately and securely share code with specific teammates and other developers, accessible from anywhere. Enhance collaboration without adding noise to your repositories."
19068+
"contents": "Cloud Patches ᴘʀᴇᴠɪᴇᴡ — privately and securely share code with specific teammates and other developers, accessible from anywhere. Enhance collaboration without adding noise to your repositories."
1905619069
},
1905719070
{
1905819071
"contents": "[Create Cloud Patch](command:gitlens.views.drafts.create)",
1905919072
"when": "gitlens:plus"
1906019073
},
1906119074
{
19062-
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22cloud-patches%22%7D)\n\nGet 14 days of GitLens Pro for free no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22cloud-patches%22%7D).",
19075+
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22cloud-patches%22%7D)\n\nGet 14 days of GitLens Pro for free — no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22cloud-patches%22%7D).",
1906319076
"when": "!gitlens:plus"
1906419077
},
1906519078
{
@@ -19121,11 +19134,11 @@
1912119134
"order": 1,
1912219135
"welcomeContent": [
1912319136
{
19124-
"contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
19137+
"contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
1912519138
"when": "gitlens:walkthroughSupported"
1912619139
},
1912719140
{
19128-
"contents": "Launchpad organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
19141+
"contents": "Launchpad — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
1912919142
"when": "!gitlens:walkthroughSupported"
1913019143
},
1913119144
{
@@ -19137,7 +19150,7 @@
1913719150
"when": "gitlens:launchpad:connected && gitlens:plus:state == -1"
1913819151
},
1913919152
{
19140-
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nGet 14 days of GitLens Pro for free no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22launchpad-view%22%7D).",
19153+
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nGet 14 days of GitLens Pro for free — no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22launchpad-view%22%7D).",
1914119154
"when": "gitlens:launchpad:connected && gitlens:plus:state == 0"
1914219155
},
1914319156
{
@@ -19157,7 +19170,7 @@
1915719170
"when": "gitlens:launchpad:connected && gitlens:plus:state == 4"
1915819171
},
1915919172
{
19160-
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nReactivate your Pro trial and experience Launchpad and all the new Pro features free for another 14 days!",
19173+
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nReactivate your Pro trial and experience Launchpad and all the new Pro features — free for another 14 days!",
1916119174
"when": "gitlens:launchpad:connected && gitlens:plus:state == 5"
1916219175
}
1916319176
]
@@ -19224,19 +19237,19 @@
1922419237
"when": "gitlens:views:scm:grouped:loading"
1922519238
},
1922619239
{
19227-
"contents": "GitLens groups many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
19240+
"contents": "GitLens groups many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
1922819241
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:welcome && gitlens:install:new && !config.gitlens.advanced.skipOnboarding"
1922919242
},
1923019243
{
19231-
"contents": "GitLens groups many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nPrefer them separate? [Restore views to previous locations](command:gitlens.views.scm.grouped.welcome.restore)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
19244+
"contents": "GitLens groups many related views—Commits, Branches, Stashes, etc—here for easier view management.\n\n[Continue](command:gitlens.views.scm.grouped.welcome.dismiss)\n\nPrefer them separate? [Restore views to previous locations](command:gitlens.views.scm.grouped.welcome.restore)\n\nUse the tabs above to navigate, or detach the views you want to keep separated. You can regroup them anytime using the 'x' in the view header.",
1923219245
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:welcome && !gitlens:install:new && !config.gitlens.advanced.skipOnboarding"
1923319246
},
1923419247
{
19235-
"contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
19248+
"contents": "[Launchpad](command:gitlens.views.launchpad.info \"Learn about Launchpad\") — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
1923619249
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:walkthroughSupported"
1923719250
},
1923819251
{
19239-
"contents": "Launchpad organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
19252+
"contents": "Launchpad — organizes your pull requests into actionable groups to help you focus and keep your team unblocked.",
1924019253
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && !gitlens:walkthroughSupported"
1924119254
},
1924219255
{
@@ -19248,7 +19261,7 @@
1924819261
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:launchpad:connected && gitlens:plus:state == -1"
1924919262
},
1925019263
{
19251-
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nGet 14 days of GitLens Pro for free no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22launchpad-view%22%7D).",
19264+
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nGet 14 days of GitLens Pro for free — no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22launchpad-view%22%7D).",
1925219265
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:launchpad:connected && gitlens:plus:state == 0"
1925319266
},
1925419267
{
@@ -19268,7 +19281,7 @@
1926819281
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:launchpad:connected && gitlens:plus:state == 4"
1926919282
},
1927019283
{
19271-
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nReactivate your Pro trial and experience Launchpad and all the new Pro features free for another 14 days!",
19284+
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22launchpad-view%22%7D)\n\nReactivate your Pro trial and experience Launchpad and all the new Pro features — free for another 14 days!",
1927219285
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == launchpad && gitlens:launchpad:connected && gitlens:plus:state == 5"
1927319286
},
1927419287
{
@@ -19284,7 +19297,7 @@
1928419297
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == searchAndCompare && !gitlens:hasVirtualFolders"
1928519298
},
1928619299
{
19287-
"contents": "[Worktrees](https://help.gitkraken.com/gitlens/side-bar/#worktrees-view-pro) ᴾᴿᴼ — minimize context switching by allowing you to work on multiple branches simultaneously.",
19300+
"contents": "[Worktrees](https://help.gitkraken.com/gitlens/side-bar/#worktrees-view-pro) ᴾᴿᴼ — minimize context switching by allowing you to work on multiple branches simultaneously.",
1928819301
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == worktrees && !gitlens:hasVirtualFolders"
1928919302
},
1929019303
{
@@ -19300,7 +19313,7 @@
1930019313
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == worktrees && gitlens:plus:state == -1"
1930119314
},
1930219315
{
19303-
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D)\n\nGet 14 days of GitLens Pro for free no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D).",
19316+
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D)\n\nGet 14 days of GitLens Pro for free — no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D).",
1930419317
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == worktrees && gitlens:plus:required && gitlens:plus:state == 0"
1930519318
},
1930619319
{
@@ -19320,11 +19333,11 @@
1932019333
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == worktrees && gitlens:plus:required && gitlens:plus:state == 4"
1932119334
},
1932219335
{
19323-
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nReactivate your Pro trial and experience Worktrees and all the new Pro features free for another 14 days!",
19336+
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nReactivate your Pro trial and experience Worktrees and all the new Pro features — free for another 14 days!",
1932419337
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == worktrees && gitlens:plus:required && gitlens:plus:state == 5"
1932519338
},
1932619339
{
19327-
"contents": " Worktrees are not supported by your version of Git. Please upgrade to a more recent version.",
19340+
"contents": "âš  Worktrees are not supported by your version of Git. Please upgrade to a more recent version.",
1932819341
"when": "!gitlens:views:scm:grouped:loading && gitlens:views:scm:grouped:view == worktrees && !gitlens:plus:required && gitlens:feature:unsupported:git:worktrees"
1932919342
}
1933019343
]
@@ -19393,14 +19406,14 @@
1939319406
"order": 3,
1939419407
"welcomeContent": [
1939519408
{
19396-
"contents": "Workspaces ᴘʀᴇᴠɪᴇᴡ — group and manage multiple repositories together, accessible from anywhere, streamlining your workflow.\n\nCreate workspaces just for yourself or share (coming soon in GitLens) them with your team for faster onboarding and better collaboration."
19409+
"contents": "Workspaces ᴘʀᴇᴠɪᴇᴡ — group and manage multiple repositories together, accessible from anywhere, streamlining your workflow.\n\nCreate workspaces just for yourself or share (coming soon in GitLens) them with your team for faster onboarding and better collaboration."
1939719410
},
1939819411
{
1939919412
"contents": "[Create Cloud Workspace](command:gitlens.views.workspaces.create)",
1940019413
"when": "gitlens:plus"
1940119414
},
1940219415
{
19403-
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22workspaces%22%7D)\n\nGet 14 days of GitLens Pro for free no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22workspaces%22%7D).",
19416+
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22workspaces%22%7D)\n\nGet 14 days of GitLens Pro for free — no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22workspaces%22%7D).",
1940419417
"when": "!gitlens:plus"
1940519418
},
1940619419
{
@@ -19419,7 +19432,7 @@
1941919432
"order": 6,
1942019433
"welcomeContent": [
1942119434
{
19422-
"contents": "[Worktrees](https://help.gitkraken.com/gitlens/side-bar/#worktrees-view-pro) ᴾᴿᴼ — minimize context switching by working on multiple branches simultaneously."
19435+
"contents": "[Worktrees](https://help.gitkraken.com/gitlens/side-bar/#worktrees-view-pro) ᴾᴿᴼ — minimize context switching by working on multiple branches simultaneously."
1942319436
},
1942419437
{
1942519438
"contents": "Unlock this feature for privately hosted repos with [GitLens Pro](https://help.gitkraken.com/gitlens/gitlens-community-vs-gitlens-pro/).",
@@ -19434,7 +19447,7 @@
1943419447
"when": "gitlens:plus:state == -1"
1943519448
},
1943619449
{
19437-
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D)\n\nGet 14 days of GitLens Pro for free no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D).",
19450+
"contents": "[Try GitLens Pro](command:gitlens.plus.signUp?%7B%22source%22%3A%22worktrees%22%7D)\n\nGet 14 days of GitLens Pro for free — no credit card required. Or [sign in](command:gitlens.plus.login?%7B%22source%22%3A%22worktrees%22%7D).",
1943819451
"when": "gitlens:plus:required && gitlens:plus:state == 0"
1943919452
},
1944019453
{
@@ -19454,11 +19467,11 @@
1945419467
"when": "gitlens:plus:required && gitlens:plus:state == 4"
1945519468
},
1945619469
{
19457-
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nReactivate your Pro trial and experience Worktrees and all the new Pro features free for another 14 days!",
19470+
"contents": "[Continue](command:gitlens.plus.reactivateProTrial?%7B%22source%22%3A%22worktrees%22%7D)\n\nReactivate your Pro trial and experience Worktrees and all the new Pro features — free for another 14 days!",
1945819471
"when": "gitlens:plus:required && gitlens:plus:state == 5"
1945919472
},
1946019473
{
19461-
"contents": " Worktrees are not supported by your version of Git. Please upgrade to a more recent version.",
19474+
"contents": "âš  Worktrees are not supported by your version of Git. Please upgrade to a more recent version.",
1946219475
"when": "!gitlens:plus:required && gitlens:feature:unsupported:git:worktrees"
1946319476
}
1946419477
]

0 commit comments

Comments
 (0)