Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions contributions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4717,6 +4717,19 @@
"label": "Toggle Zen Mode",
"commandPalette": "gitlens:enabled"
},
"gitlens.views.abortPausedOperation": {
"label": "Abort",
"icon": "$(circle-slash)",
"menus": {
"view/item/context": [
{
"when": "viewItem =~ /gitlens:paused-operation\\b/ && !listMultiSelection",
"group": "inline",
"order": 3
}
]
}
},
"gitlens.views.addAuthor": {
"label": "Add as Co-author",
"icon": "$(person-add)",
Expand Down Expand Up @@ -5846,6 +5859,19 @@
]
}
},
"gitlens.views.continuePausedOperation": {
"label": "Continue",
"icon": "$(debug-continue)",
"menus": {
"view/item/context": [
{
"when": "viewItem =~ /gitlens:paused-operation:(cherry-pick|merge|rebase)\\b/ && !listMultiSelection",
"group": "inline",
"order": 1
}
]
}
},
"gitlens.views.contributors.copy": {
"label": "Copy",
"keybindings": [
Expand Down Expand Up @@ -7638,6 +7664,19 @@
]
}
},
"gitlens.views.openPausedOperationInRebaseEditor": {
"label": "Open in Rebase Editor",
"icon": "$(edit)",
"menus": {
"view/item/context": [
{
"when": "viewItem =~ /gitlens:paused-operation:rebase\\b/ && !listMultiSelection",
"group": "inline",
"order": 4
}
]
}
},
"gitlens.views.openPreviousChangesWithWorking": {
"label": "Open Previous Changes with Working File",
"menus": {
Expand Down Expand Up @@ -10391,6 +10430,19 @@
]
}
},
"gitlens.views.skipPausedOperation": {
"label": "Skip",
"icon": "$(debug-step-over)",
"menus": {
"view/item/context": [
{
"when": "viewItem =~ /gitlens:paused-operation:(cherry-pick|rebase|revert)\\b/ && !listMultiSelection",
"group": "inline",
"order": 2
}
]
}
},
"gitlens.views.stageDirectory": {
"label": "Stage All Changes",
"icon": "$(add)",
Expand Down
11 changes: 11 additions & 0 deletions docs/telemetry-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,17 @@ or
}
```

### home/command

> Sent when a Home command is executed
```typescript
{
'command': string,
'webview': string
}
```

### home/createBranch

> Sent when the user chooses to create a branch from the home view
Expand Down
56 changes: 56 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7581,6 +7581,11 @@
"title": "Toggle Zen Mode",
"category": "GitLens"
},
{
"command": "gitlens.views.abortPausedOperation",
"title": "Abort",
"icon": "$(circle-slash)"
},
{
"command": "gitlens.views.addAuthor",
"title": "Add as Co-author",
Expand Down Expand Up @@ -7857,6 +7862,11 @@
"title": "Compare Working Tree to Here",
"icon": "$(gitlens-compare-ref-working)"
},
{
"command": "gitlens.views.continuePausedOperation",
"title": "Continue",
"icon": "$(debug-continue)"
},
{
"command": "gitlens.views.contributors.copy",
"title": "Copy"
Expand Down Expand Up @@ -8389,6 +8399,11 @@
"command": "gitlens.views.openOnlyChangedFiles",
"title": "Open Changed & Close Unchanged Files"
},
{
"command": "gitlens.views.openPausedOperationInRebaseEditor",
"title": "Open in Rebase Editor",
"icon": "$(edit)"
},
{
"command": "gitlens.views.openPreviousChangesWithWorking",
"title": "Open Previous Changes with Working File"
Expand Down Expand Up @@ -9116,6 +9131,11 @@
"command": "gitlens.views.setShowRelativeDateMarkersOn",
"title": "Show Date Markers"
},
{
"command": "gitlens.views.skipPausedOperation",
"title": "Skip",
"icon": "$(debug-step-over)"
},
{
"command": "gitlens.views.stageDirectory",
"title": "Stage All Changes",
Expand Down Expand Up @@ -11265,6 +11285,10 @@
"command": "gitlens.toggleZenMode",
"when": "gitlens:enabled"
},
{
"command": "gitlens.views.abortPausedOperation",
"when": "false"
},
{
"command": "gitlens.views.addAuthor",
"when": "false"
Expand Down Expand Up @@ -11509,6 +11533,10 @@
"command": "gitlens.views.compareWithWorking",
"when": "false"
},
{
"command": "gitlens.views.continuePausedOperation",
"when": "false"
},
{
"command": "gitlens.views.contributors.copy",
"when": "false"
Expand Down Expand Up @@ -11957,6 +11985,10 @@
"command": "gitlens.views.openOnlyChangedFiles",
"when": "false"
},
{
"command": "gitlens.views.openPausedOperationInRebaseEditor",
"when": "false"
},
{
"command": "gitlens.views.openPreviousChangesWithWorking",
"when": "false"
Expand Down Expand Up @@ -12569,6 +12601,10 @@
"command": "gitlens.views.setShowRelativeDateMarkersOn",
"when": "false"
},
{
"command": "gitlens.views.skipPausedOperation",
"when": "false"
},
{
"command": "gitlens.views.stageDirectory",
"when": "false"
Expand Down Expand Up @@ -16198,6 +16234,26 @@
"when": "viewItem =~ /gitlens:pager\\b/ && !listMultiSelection",
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.views.abortPausedOperation",
"when": "viewItem =~ /gitlens:paused-operation\\b/ && !listMultiSelection",
"group": "inline@3"
},
{
"command": "gitlens.views.continuePausedOperation",
"when": "viewItem =~ /gitlens:paused-operation:(cherry-pick|merge|rebase)\\b/ && !listMultiSelection",
"group": "inline@1"
},
{
"command": "gitlens.views.skipPausedOperation",
"when": "viewItem =~ /gitlens:paused-operation:(cherry-pick|rebase|revert)\\b/ && !listMultiSelection",
"group": "inline@2"
},
{
"command": "gitlens.views.openPausedOperationInRebaseEditor",
"when": "viewItem =~ /gitlens:paused-operation:rebase\\b/ && !listMultiSelection",
"group": "inline@4"
},
{
"command": "gitlens.views.openPullRequest",
"when": "viewItem =~ /gitlens:pullrequest\\b/ && gitlens:action:openPullRequest > 1",
Expand Down
18 changes: 15 additions & 3 deletions src/constants.commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,11 @@ export type TreeViewCommands = `gitlens.views.${
| 'setResultsCommitsFilterAuthors'
| 'setResultsCommitsFilterOff'
| 'setContributorsStatisticsOff'
| 'setContributorsStatisticsOn'}`;
| 'setContributorsStatisticsOn'
| 'abortPausedOperation'
| 'continuePausedOperation'
| 'skipPausedOperation'
| 'openPausedOperationInRebaseEditor'}`;

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 Expand Up @@ -694,7 +698,11 @@ type HomeWebviewCommands = `home.${
| 'mergeIntoCurrent'
| 'rebaseCurrentOnto'
| 'startWork'
| 'createCloudPatch'}`;
| 'createCloudPatch'
| 'skipPausedOperation'
| 'continuePausedOperation'
| 'abortPausedOperation'
| 'openRebaseEditor'}`;

type GraphWebviewCommands = `graph.${
| 'switchToEditorLayout'
Expand Down Expand Up @@ -807,7 +815,11 @@ type GraphWebviewCommands = `graph.${
| 'openWorktreeInNewWindow'
| 'copyWorkingChangesToWorktree'
| 'generateCommitMessage'
| 'compareSelectedCommits.multi'}`;
| 'compareSelectedCommits.multi'
| 'skipPausedOperation'
| 'continuePausedOperation'
| 'abortPausedOperation'
| 'openRebaseEditor'}`;

type TimelineWebviewCommands = `timeline.${'refresh' | 'split'}`;

Expand Down
2 changes: 2 additions & 0 deletions src/constants.telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ export interface TelemetryEvents extends WebviewShowAbortedEvents, WebviewShownE
/** Sent when the user changes the selected tab (mode) on the Graph Details view */
'graphDetails/mode/changed': GraphDetailsModeChangedEvent;

/** Sent when a Home command is executed */
'home/command': CommandEventData;
/** Sent when the new Home view preview is toggled on/off */
'home/preview/toggled': HomePreviewToggledEvent;
/** Sent when the user chooses to create a branch from the home view */
Expand Down
11 changes: 11 additions & 0 deletions src/system/vscode/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export function registerCommand(command: Commands, callback: CommandCallback, th
'context.mode': context?.mode,
'context.submode': context?.submode,
});
} else if (command.startsWith('gitlens.home.')) {
Container.instance.telemetry.sendEvent('home/command', {
command: command,
'context.mode': context?.mode,
'context.submode': context?.submode,
});
}

void Container.instance.usage.track(`command:${command}:executed`).catch();
Expand Down Expand Up @@ -75,6 +81,11 @@ export function registerWebviewCommand(command: Commands, callback: CommandCallb
command: command,
webview: webview ?? '<missing>',
});
} else if (webview === 'gitlens.views.home' || command.startsWith('gitlens.home.')) {
Container.instance.telemetry.sendEvent('home/command', {
command: command,
webview: webview ?? '<missing>',
});
}

void Container.instance.usage.track(`command:${command}:executed`).catch();
Expand Down
12 changes: 1 addition & 11 deletions src/views/nodes/pausedOperationStatusNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode';
import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import type { Colors } from '../../constants.colors';
import { GitUri } from '../../git/gitUri';
import type { GitBranch } from '../../git/models/branch';
Expand All @@ -7,7 +7,6 @@ import { getReferenceLabel } from '../../git/models/reference.utils';
import type { GitStatus } from '../../git/models/status';
import { pausedOperationStatusStringsByType } from '../../git/utils/pausedOperationStatus.utils';
import { pluralize } from '../../system/string';
import { executeCoreCommand } from '../../system/vscode/command';
import type { ViewsWithCommits } from '../viewBase';
import { createViewDecorationUri } from '../viewDecorationProvider';
import { ContextValues, getViewNodeId, ViewNode } from './abstract/viewNode';
Expand Down Expand Up @@ -172,13 +171,4 @@ export class PausedOperationStatusNode extends ViewNode<'paused-operation-status
markdown.isTrusted = true;
return markdown;
}

async openRebaseEditor() {
if (this.pausedOpStatus.type !== 'rebase') return;

const rebaseTodoUri = Uri.joinPath(this.uri, '.git', 'rebase-merge', 'git-rebase-todo');
await executeCoreCommand('vscode.openWith', rebaseTodoUri, 'gitlens.rebase', {
preview: false,
});
}
}
Loading
Loading