Skip to content

Commit 68a34f0

Browse files
committed
Merge branch 'hansu-develop'
2 parents 881a9e6 + 6199187 commit 68a34f0

38 files changed

+6029
-795
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
coverage
22
media
33
node_modules
4+
node_modules_
45
out
56
*.vsix

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Git Graph extension for Visual Studio Code
22

3-
View a Git Graph of your repository, and easily perform Git actions from the graph. Configurable to look the way you want!
3+
Extended version of mhutchies Git Graph.
4+
Following features were added:
45

5-
![Recording of Git Graph](https://github.com/mhutchie/vscode-git-graph/raw/master/resources/demo.gif)
6+
* Added sticky header option (mhutchie#394)
7+
* Added author filter (hansu#1)
8+
* Resize column width without header (hansu#4)
9+
* Added collapse/expand buttons to commit diff view (hansu#6)
10+
11+
![Additions](https://github.com/hansu/vscode-git-graph/raw/hansu-mod/resources/demo.gif)
612

713
## Features
814

package.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@
169169
"type": "boolean",
170170
"title": "Push Branch..."
171171
},
172+
"viewIssue": {
173+
"type": "boolean",
174+
"title": "View Issue"
175+
},
172176
"createPullRequest": {
173177
"type": "boolean",
174178
"title": "Create Pull Request..."
@@ -240,6 +244,47 @@
240244
}
241245
}
242246
},
247+
"commitDetailsViewFile": {
248+
"type": "object",
249+
"properties": {
250+
"viewDiff": {
251+
"type": "boolean",
252+
"title": "View Diff"
253+
},
254+
"viewFileAtThisRevision": {
255+
"type": "boolean",
256+
"title": "View File at this Revision"
257+
},
258+
"viewDiffWithWorkingFile": {
259+
"type": "boolean",
260+
"title": "View Diff with Working File"
261+
},
262+
"openFile": {
263+
"type": "boolean",
264+
"title": "Open File"
265+
},
266+
"markAsReviewed": {
267+
"type": "boolean",
268+
"title": "Mark as Reviewed"
269+
},
270+
"markAsNotReviewed": {
271+
"type": "boolean",
272+
"title": "Mark as Not Reviewed"
273+
},
274+
"resetFileToThisRevision": {
275+
"type": "boolean",
276+
"title": "Reset File to this Revision..."
277+
},
278+
"copyAbsoluteFilePath": {
279+
"type": "boolean",
280+
"title": "Copy Absolute File Path to Clipboard"
281+
},
282+
"copyRelativeFilePath": {
283+
"type": "boolean",
284+
"title": "Copy Relative File Path to Clipboard"
285+
}
286+
}
287+
},
243288
"remoteBranch": {
244289
"type": "object",
245290
"properties": {
@@ -263,6 +308,10 @@
263308
"type": "boolean",
264309
"title": "Pull into current branch..."
265310
},
311+
"viewIssue": {
312+
"type": "boolean",
313+
"title": "View Issue"
314+
},
266315
"createPullRequest": {
267316
"type": "boolean",
268317
"title": "Create Pull Request"
@@ -493,6 +542,11 @@
493542
},
494543
"description": "An object specifying the default visibility of the Date, Author & Commit columns. Example: {\"Date\": true, \"Author\": true, \"Commit\": true}"
495544
},
545+
"git-graph.stickyHeader": {
546+
"type": "boolean",
547+
"default": true,
548+
"description": "Keeps the header visible when the view is scrolled"
549+
},
496550
"git-graph.dialog.addTag.pushToRemote": {
497551
"type": "boolean",
498552
"default": false,

resources/demo.gif

273 KB
Loading

src/avatarManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ export class AvatarManager extends Disposable {
134134

135135
/**
136136
* Remove all avatars from the cache.
137+
* @returns A Thenable resolving to the ErrorInfo that resulted from executing this method.
137138
*/
138139
public clearCache() {
139140
this.avatars = {};
140-
this.extensionState.clearAvatarCache();
141+
return this.extensionState.clearAvatarCache();
141142
}
142143

143144
/**

src/commands.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CodeReviewData, CodeReviews, ExtensionState } from './extensionState';
88
import { GitGraphView } from './gitGraphView';
99
import { Logger } from './logger';
1010
import { RepoManager } from './repoManager';
11-
import { GitExecutable, UNABLE_TO_FIND_GIT_MSG, abbrevCommit, abbrevText, copyToClipboard, doesVersionMeetRequirement, getExtensionVersion, getPathFromUri, getRelativeTimeDiff, getRepoName, getSortedRepositoryPaths, isPathInWorkspace, openFile, resolveToSymbolicPath, showErrorMessage, showInformationMessage } from './utils';
11+
import { GitExecutable, UNABLE_TO_FIND_GIT_MSG, VsCodeVersionRequirement, abbrevCommit, abbrevText, copyToClipboard, doesVersionMeetRequirement, getExtensionVersion, getPathFromUri, getRelativeTimeDiff, getRepoName, getSortedRepositoryPaths, isPathInWorkspace, openFile, resolveToSymbolicPath, showErrorMessage, showInformationMessage } from './utils';
1212
import { Disposable } from './utils/disposable';
1313
import { Event } from './utils/event';
1414

@@ -65,7 +65,7 @@ export class CommandManager extends Disposable {
6565

6666
// Register Extension Contexts
6767
try {
68-
this.registerContext('git-graph:codiconsSupported', doesVersionMeetRequirement(vscode.version, '1.42.0'));
68+
this.registerContext('git-graph:codiconsSupported', doesVersionMeetRequirement(vscode.version, VsCodeVersionRequirement.Codicons));
6969
} catch (_) {
7070
this.logger.logError('Unable to set Visual Studio Code Context "git-graph:codiconsSupported"');
7171
}
@@ -78,7 +78,10 @@ export class CommandManager extends Disposable {
7878
*/
7979
private registerCommand(command: string, callback: (...args: any[]) => any) {
8080
this.registerDisposable(
81-
vscode.commands.registerCommand(command, callback)
81+
vscode.commands.registerCommand(command, (...args: any[]) => {
82+
this.logger.log('Command Invoked: ' + command);
83+
callback(...args);
84+
})
8285
);
8386
}
8487

@@ -180,7 +183,15 @@ export class CommandManager extends Disposable {
180183
* The method run when the `git-graph.clearAvatarCache` command is invoked.
181184
*/
182185
private clearAvatarCache() {
183-
this.avatarManager.clearCache();
186+
this.avatarManager.clearCache().then((errorInfo) => {
187+
if (errorInfo === null) {
188+
showInformationMessage('The Avatar Cache was successfully cleared.');
189+
} else {
190+
showErrorMessage(errorInfo);
191+
}
192+
}, () => {
193+
showErrorMessage('An unexpected error occurred while running the command "Clear Avatar Cache".');
194+
});
184195
}
185196

186197
/**

src/config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ class Config {
8181
get contextMenuActionsVisibility(): ContextMenuActionsVisibility {
8282
const userConfig = this.config.get('contextMenuActionsVisibility', {});
8383
const config: ContextMenuActionsVisibility = {
84-
branch: { checkout: true, rename: true, delete: true, merge: true, rebase: true, push: true, createPullRequest: true, createArchive: true, selectInBranchesDropdown: true, unselectInBranchesDropdown: true, copyName: true },
84+
branch: { checkout: true, rename: true, delete: true, merge: true, rebase: true, push: true, viewIssue: true, createPullRequest: true, createArchive: true, selectInBranchesDropdown: true, unselectInBranchesDropdown: true, copyName: true },
8585
commit: { addTag: true, createBranch: true, checkout: true, cherrypick: true, revert: true, drop: true, merge: true, rebase: true, reset: true, copyHash: true, copySubject: true },
86-
remoteBranch: { checkout: true, delete: true, fetch: true, merge: true, pull: true, createPullRequest: true, createArchive: true, selectInBranchesDropdown: true, unselectInBranchesDropdown: true, copyName: true },
86+
commitDetailsViewFile: { viewDiff: true, viewFileAtThisRevision: true, viewDiffWithWorkingFile: true, openFile: true, markAsReviewed: true, markAsNotReviewed: true, resetFileToThisRevision: true, copyAbsoluteFilePath: true, copyRelativeFilePath: true },
87+
remoteBranch: { checkout: true, delete: true, fetch: true, merge: true, pull: true, viewIssue: true, createPullRequest: true, createArchive: true, selectInBranchesDropdown: true, unselectInBranchesDropdown: true, copyName: true },
8788
stash: { apply: true, createBranch: true, pop: true, drop: true, copyName: true, copyHash: true },
8889
tag: { viewDetails: true, delete: true, push: true, createArchive: true, copyName: true },
8990
uncommittedChanges: { stash: true, reset: true, clean: true, openSourceControlView: true }
@@ -545,6 +546,13 @@ class Config {
545546
return !!this.config.get('showStatusBarItem', true);
546547
}
547548

549+
/**
550+
* Get the value of the `git-graph.stickyHeader` Extension Setting.
551+
*/
552+
get stickyHeader() {
553+
return !!this.config.get('stickyHeader', true);
554+
}
555+
548556
/**
549557
* Get the value of the `git-graph.tabIconColourTheme` Extension Setting.
550558
*/

0 commit comments

Comments
 (0)