Skip to content

Commit 5003103

Browse files
committed
Release 1.28.0 package & documentation changes.
1 parent 67695ba commit 5003103

File tree

12 files changed

+60
-21
lines changed

12 files changed

+60
-21
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## 1.28.0 - 2020-12-01
4+
* #399 Sign Commits and Tags created by actions in the Git Graph View, by enabling the new extension settings `git-graph.repository.sign.commits` and `git-graph.repository.sign.tags` respectively. This is an alternative to the existing method using Git config (`commit.gpgSign` and `tag.gpgSign`).
5+
* #406 The keybindings for all Git Graph View keyboard shortcuts can now be configured using new extension settings `git-graph.keyboardShortcut.*`.
6+
* #407 Control whether Remote Head Symbolic References (e.g. origin/HEAD) are displayed in Git Graph via the new extension setting `git-graph.repository.showRemoteHeads`. Thanks [Maciej Wilk (@wilkmaciej)](https://github.com/wilkmaciej) for helping with this!
7+
* #409 Include built-in support for new emoji shortcodes recently added to [gitmoji](https://gitmoji.carloscuesta.me/).
8+
* #412 New "Git Graph: Fetch from Remote(s)" command contributed to Visual Studio Code, that opens the Git Graph View and immediately runs "Fetch from Remote(s)".
9+
* #414 Your Git Graph Repository Configuration can now be exported to a file that can be committed in the repository. It allows others working in the same repository to automatically use the same Git Graph configuration. To export your configuration, click the "Export Repository Configuration" button at the bottom of the Repository Settings Widget (on the Git Graph View).
10+
* #416 The existing file encoding extension setting `git-graph.fileEncoding` can now also be configured at a Workspace Folder Scope.
11+
* #419 On dialogs that refer to the "current branch" (Merge, Pull, Rebase, and Reset), the current branch is now explicitly mentioned.
12+
* #420 Fixed an issue that prevented files that overflow horizontally in the Commit Details View Files View from being left-clicked (i.e. those shortened with an ellipsis). _(issue introduced via #381)_
13+
* Significant code improvements.
14+
315
## 1.27.0 - 2020-11-01
416
* #281 For the Repository Settings Widget, read values defined in additional Git config files when they're included via [include directives](https://git-scm.com/docs/git-config#_includes) in local or global Git config files.
517
* #364 Parse and render a frequently used subset of inline Markdown formatting rules in commit messages and tag details (bold, italics, bold & italics, and inline code blocks). Markdown parsing can be disabled using the extension setting `git-graph.markdown`.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ View a Git Graph of your repository, and easily perform Git actions from the gra
4848
* Configure "Pull Request Creation" - Automates the opening and pre-filling of a Pull Request form, directly from a branches context menu.
4949
* Support for the publicly hosted Bitbucket, GitHub and GitLab Pull Request providers is built-in.
5050
* Custom Pull Request providers can be configured using the Extension Setting `git-graph.customPullRequestProviders` (e.g. for use with privately hosted Pull Request providers). Information on how to configure custom providers is available [here](https://github.com/mhutchie/vscode-git-graph/wiki/Configuring-a-custom-Pull-Request-Provider).
51+
* Export your Git Graph Repository Configuration to a file that can be committed in the repository. It allows others working in the same repository to automatically use the same Git Graph configuration.
5152
* Keyboard Shortcuts (available in the Git Graph View):
5253
* `CTRL/CMD + F`: Open the Find Widget.
5354
* `CTRL/CMD + H`: Scrolls the Git Graph View to be centered on the commit referenced by HEAD.
@@ -86,14 +87,15 @@ A summary of the Git Graph extension settings are:
8687
* **Format**: Specifies the date format to be used in the "Date" column on the Git Graph View.
8788
* **Type**: Specifies the date type to be displayed in the "Date" column on the Git Graph View, either the author or commit date.
8889
* **Default Column Visibility**: An object specifying the default visibility of the Date, Author & Commit columns. Example: `{"Date": true, "Author": true, "Commit": true}`
89-
* **Dialog.\***: Set the default options on the following dialogs: Add Tag, Apply Stash, Cherry Pick, Create Branch, Delete Branch, Fetch Remote, Merge, Pop Stash, Pull Branch, Rebase, Reset, and Stash Uncommitted Changes
90+
* **Dialog > \***: Set the default options on the following dialogs: Add Tag, Apply Stash, Cherry Pick, Create Branch, Delete Branch, Fetch Remote, Merge, Pop Stash, Pull Branch, Rebase, Reset, and Stash Uncommitted Changes
9091
* **Enhanced Accessibility**: Visual file change A|M|D|R|U indicators in the Commit Details View for users with colour blindness. In the future, this setting will enable any additional accessibility related features of Git Graph that aren't enabled by default.
9192
* **File Encoding**: The character set encoding used when retrieving a specific version of repository files (e.g. in the Diff View). A list of all supported encodings can be found [here](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).
9293
* **Graph**:
9394
* **Colours**: Specifies the colours used on the graph.
9495
* **Style**: Specifies the style of the graph.
9596
* **Uncommitted Changes**: Specifies how the Uncommitted Changes are displayed on the graph.
9697
* **Integrated Terminal Shell**: Specifies the path and filename of the Shell executable to be used by the Visual Studio Code Integrated Terminal, when it is opened by Git Graph.
98+
* **Keyboard Shortcut > \***: Configures the keybindings used for all keyboard shortcuts in the Git Graph View.
9799
* **Markdown**: Parse and render a frequently used subset of inline Markdown formatting rules in commit messages and tag details (bold, italics, bold & italics, and inline code blocks).
98100
* **Max Depth Of Repo Search**: Specifies the maximum depth of subfolders to search when discovering repositories in the workspace.
99101
* **Open New Tab Editor Group**: Specifies the Editor Group where Git Graph should open new tabs, when performing the following actions from the Git Graph View: Viewing the Visual Studio Code Diff View, Opening a File, Viewing a File at a Specific Revision.
@@ -122,9 +124,13 @@ A summary of the Git Graph extension settings are:
122124
* **Only Follow First Parent**: Only follow the first parent of commits when discovering the commits to load in the Git Graph View. See [--first-parent](https://git-scm.com/docs/git-log#Documentation/git-log.txt---first-parent) to find out more about this setting.
123125
* **Show Commits Only Referenced By Tags**: Show Commits that are only referenced by tags in Git Graph.
124126
* **Show Remote Branches**: Show Remote Branches in Git Graph by default.
127+
* **Show Remote Heads**: Show Remote HEAD Symbolic References in Git Graph.
125128
* **Show Tags**: Show Tags in Git Graph by default.
126129
* **Show Uncommitted Changes**: Show uncommitted changes. If you work on large repositories, disabling this setting can reduce the load time of the Git Graph View.
127130
* **Show Untracked Files**: Show untracked files when viewing the uncommitted changes. If you work on large repositories, disabling this setting can reduce the load time of the Git Graph View.
131+
* **Sign**:
132+
* **Commits**: Enables commit signing with GPG or X.509.
133+
* **Tags**: Enables tag signing with GPG or X.509.
128134
* **Use Mailmap**: Respect [.mailmap](https://git-scm.com/docs/git-check-mailmap#_mapping_authors) files when displaying author & committer names and email addresses.
129135
* **Repository Dropdown Order**: Specifies the order that repositories are sorted in the repository dropdown on the Git Graph View (only visible when more than one repository exists in the current Visual Studio Code Workspace).
130136
* **Retain Context When Hidden**: Specifies if the Git Graph view Visual Studio Code context is kept when the panel is no longer visible (e.g. moved to background tab). Enabling this setting will make Git Graph load significantly faster when switching back to the Git Graph tab, however has a higher memory overhead.
@@ -145,6 +151,7 @@ This extension contributes the following commands:
145151
* `git-graph.clearAvatarCache`: Git Graph: Clear Avatar Cache
146152
* `git-graph.endAllWorkspaceCodeReviews`: Git Graph: End All Code Reviews in Workspace
147153
* `git-graph.endSpecificWorkspaceCodeReview`: Git Graph: End a specific Code Review in Workspace... _(used to end a specific Code Review without having to first open it in the Git Graph View)_
154+
* `git-graph.fetch`: Git Graph: Fetch from Remote(s) _(used to open the Git Graph View and immediately run "Fetch from Remote(s)")_
148155
* `git-graph.removeGitRepository`: Git Graph: Remove Git Repository... _(used to remove repositories from Git Graph)_
149156
* `git-graph.resumeWorkspaceCodeReview`: Git Graph: Resume a specific Code Review in Workspace... _(used to open the Git Graph View to a Code Review that is already in progress)_
150157
* `git-graph.version`: Git Graph: Get Version Information

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "git-graph",
33
"displayName": "Git Graph",
4-
"version": "1.27.0",
4+
"version": "1.28.0",
55
"publisher": "mhutchie",
66
"author": {
77
"name": "Michael Hutchison",

src/avatarManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,18 +361,18 @@ export class AvatarManager extends Disposable {
361361
* Download and save an avatar image.
362362
* @param email The email address identifying the avatar.
363363
* @param imageUrl The URL the avatar can be downloaded from.
364-
* @returns The image name of the avatar on disk, or NULL if downloading failed.
364+
* @returns A promise that resolves to the image name of the avatar on disk, or NULL if downloading failed.
365365
*/
366366
private downloadAvatarImage(email: string, imageUrl: string) {
367367
return (new Promise<string | null>((resolve) => {
368368
const hash = crypto.createHash('md5').update(email).digest('hex');
369369
const imgUrl = url.parse(imageUrl);
370370

371371
let completed = false;
372-
const complete = (data: string | null = null) => {
372+
const complete = (fileName: string | null = null) => {
373373
if (!completed) {
374374
completed = true;
375-
resolve(data);
375+
resolve(fileName);
376376
}
377377
};
378378

@@ -478,7 +478,7 @@ class AvatarRequestQueue {
478478
const existingRequest = this.queue.find((request) => request.email === email && request.repo === repo);
479479
if (existingRequest) {
480480
commits.forEach((commit) => {
481-
if (existingRequest.commits.indexOf(commit) === -1) {
481+
if (!existingRequest.commits.includes(commit)) {
482482
existingRequest.commits.push(commit);
483483
}
484484
});

src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class CommandManager extends Disposable {
169169
const repoPaths = Object.keys(repos);
170170

171171
if (repoPaths.length > 1) {
172-
const items: vscode.QuickPickItem[] = Object.keys(repos).map((path) => ({
172+
const items: vscode.QuickPickItem[] = repoPaths.map((path) => ({
173173
label: repos[path].name || getRepoName(path),
174174
description: path
175175
}));

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ class Config {
282282
}
283283

284284
/**
285-
* Get the keybinding configuration from the `git-graph.keybinding.*` Extension Settings.
285+
* Get the keybinding configuration from the `git-graph.keyboardShortcut.*` Extension Settings.
286286
*/
287287
get keybindings(): KeybindingConfig {
288288
return {
@@ -586,7 +586,7 @@ class Config {
586586

587587
/**
588588
* Get a Config instance for retrieving the users configuration of Git Graph Extension Settings.
589-
* @param repo An option path of a repository (to be used for Workspace Folder Scoped Configuration Values).
589+
* @param repo An optional path of a repository (to be used for Workspace Folder Scoped Configuration Values).
590590
* @returns A Config instance.
591591
*/
592592
export function getConfig(repo?: string) {

src/dataSource.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,10 @@ export class DataSource extends Disposable {
635635
*/
636636
public addTag(repo: string, tagName: string, commitHash: string, lightweight: boolean, message: string) {
637637
const args = ['tag'];
638-
if (getConfig().signTags) {
639-
args.push('-s', tagName, '-m', message);
640-
} else if (lightweight) {
638+
if (lightweight) {
641639
args.push(tagName);
642640
} else {
643-
args.push('-a', tagName, '-m', message);
641+
args.push(getConfig().signTags ? '-s' : '-a', tagName, '-m', message);
644642
}
645643
args.push(commitHash);
646644
return this.runGitCommand(args, repo);

src/gitGraphView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class GitGraphView extends Disposable {
134134
}
135135
}),
136136

137-
// Subscribe to events trigged when an avatar is available
137+
// Subscribe to events triggered when an avatar is available
138138
avatarManager.onAvatar((event) => {
139139
this.sendMessage({
140140
command: 'fetchAvatar',

src/repoManager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ function doesPathExist(path: string) {
689689
export namespace ExternalRepoConfig {
690690

691691
export const enum FileViewType {
692-
Default = 'default',
693692
Tree = 'tree',
694693
List = 'list'
695694
}
@@ -751,7 +750,8 @@ function readExternalConfigFile(repo: string) {
751750
resolve(null);
752751
} else {
753752
try {
754-
resolve(JSON.parse(data.toString()));
753+
const contents = JSON.parse(data.toString());
754+
resolve(typeof contents === 'object' ? contents : null);
755755
} catch (_) {
756756
resolve(null);
757757
}
@@ -980,10 +980,10 @@ function applyExternalConfigFile(file: Readonly<ExternalRepoConfig.File>, state:
980980
}
981981
state.pullRequestConfig = <PullRequestConfig>{
982982
provider: provider,
983-
custom: file.pullRequestConfig.custom !== null
983+
custom: provider === PullRequestProvider.Custom
984984
? {
985-
name: file.pullRequestConfig.custom.name,
986-
templateUrl: file.pullRequestConfig.custom.templateUrl
985+
name: file.pullRequestConfig.custom!.name,
986+
templateUrl: file.pullRequestConfig.custom!.templateUrl
987987
}
988988
: null,
989989
hostRootUrl: file.pullRequestConfig.hostRootUrl,

tests/dataSource.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4167,7 +4167,6 @@ describe('DataSource', () => {
41674167
it('Should add a lightweight tag to a commit', async () => {
41684168
// Setup
41694169
mockGitSuccessOnce();
4170-
vscode.mockExtensionSettingReturnValue('repository.sign.tags', false);
41714170

41724171
// Run
41734172
const result = await dataSource.addTag('/path/to/repo', 'tag-name', '1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b', true, '');

0 commit comments

Comments
 (0)