From e44a48bb99b53522dd596b8a3fddffc9299c388b Mon Sep 17 00:00:00 2001 From: Michael Hutchison Date: Fri, 2 Apr 2021 13:42:37 +1100 Subject: [PATCH] Release 1.30.0 package & documentation changes. --- CHANGELOG.md | 13 +++++++++++++ README.md | 2 +- package.json | 4 ++-- src/commands.ts | 2 +- tests/commands.test.ts | 1 + tests/diffDocProvider.test.ts | 13 +------------ tests/utils.test.ts | 2 +- web/main.ts | 14 ++++++++++---- 8 files changed, 30 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a121b48..96d7015b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 1.30.0 - 2021-04-05 +* #395 Added a "Force Fetch" option onto the "Fetch into Local Branch" Dialog, allowing any local branch (that's not checked out) to be reset to the remote branch. This dialog is accessed via the Remote Branch Context Menu. +* #457 New "View Diff with Working File" action on the File Context Menu in the Commit Details View. +* #466 New "Copy Relative File Path to Clipboard" action on the File Context Menu in the Commit Details View. +* #471 Spaces can be automatically substituted with hyphens or underscores in reference inputs on dialogs (e.g. Create Branch, Add Tag, etc.), by configuring the new extension setting `git-graph.dialog.general.referenceInputSpaceSubstitution`. +* #476 "Open File" action is now available in the Visual Studio Code Diff View Title Menu, when the Diff View is opened from the Git Graph View. (Requires Visual Studio Code >= 1.42.0) +* #479 New Repository Dropdown Order option "Workspace Full Path", that sorts repositories according to the Visual Studio Code Workspace Folder order, then alphabetically by the full path of the repository. This is the new default order for the `git-graph.repositoryDropdownOrder` extension setting. +* #480 When loading the Working File for a file from a historical commit, and the file has since been renamed, Git is now used to detect renames and enable the Working File to be opened. For example: from the "Open File" & "View Diff with Working File" actions on the File Context Menu in the Commit Details View. +* #482 New "Mark as Reviewed" & "Mark as Not Reviewed" actions on the File Context Menu in the Commit Details View, when a Code Review is in progress. Thanks [Dan Arad (@dan1994)](https://github.com/dan1994) for implementing this! +* #486 All Git Graph View Keyboard Shortcut extension settings can now alternatively be set to "UNASSIGNED", if you don't want to have a keybinding for a specific Keyboard Shortcut. +* #491 Standardise the cross-platform rendering of Markdown inline code blocks, to ensure they don't affect the height of each commit. +* Various code improvements. + ## 1.29.0 - 2021-02-28 * #390 When creating a branch or adding a tag, the name is now checked against all existing branches and tags in the repository. If a branch / tag already exists with the same name, a new dialog is displayed that allows you to: replace the existing branch / tag, or to choose another name. * #402 New mode for the Find Widget, which will additionally open the Commit Details View as you navigate through each of the matched commits. This mode is enabled / disabled via a new button on the Find Widget. diff --git a/README.md b/README.md index d7bad428..022a5c4f 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ A summary of the Git Graph extension settings are: * **Format**: Specifies the date format to be used in the "Date" column on the Git Graph View. * **Type**: Specifies the date type to be displayed in the "Date" column on the Git Graph View, either the author or commit date. * **Default Column Visibility**: An object specifying the default visibility of the Date, Author & Commit columns. Example: `{"Date": true, "Author": true, "Commit": true}` -* **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 +* **Dialog > \***: Set the default options on the following dialogs: Add Tag, Apply Stash, Cherry Pick, Create Branch, Delete Branch, Fetch into Local Branch, Fetch Remote, Merge, Pop Stash, Pull Branch, Rebase, Reset, and Stash Uncommitted Changes * **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. * **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). * **Graph**: diff --git a/package.json b/package.json index de0cc39d..24abc04b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "git-graph", "displayName": "Git Graph", - "version": "1.29.0", + "version": "1.30.0", "publisher": "mhutchie", "author": { "name": "Michael Hutchison", @@ -1078,7 +1078,7 @@ "enumDescriptions": [ "Sort repositories alphabetically by the full path of the repository.", "Sort repositories alphabetically by the name of the repository.", - "Sort repositories according to the workspace folder order, then alphabetically by the full path of the repository." + "Sort repositories according to the Visual Studio Code Workspace Folder order, then alphabetically by the full path of the repository." ], "default": "Workspace Full Path", "description": "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)." diff --git a/src/commands.ts b/src/commands.ts index 87c8def4..7a0f414c 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -321,7 +321,7 @@ export class CommandManager extends Disposable { */ private openFile(arg?: vscode.Uri) { const uri = arg || vscode.window.activeTextEditor?.document.uri; - if (typeof uri === 'object' && uri.scheme === DiffDocProvider.scheme) { + if (typeof uri === 'object' && uri && uri.scheme === DiffDocProvider.scheme) { // A Git Graph URI has been provided const request = decodeDiffDocUri(uri); return openFile(request.repo, request.filePath, request.commit, this.dataSource, vscode.ViewColumn.Active).then((errorInfo) => { diff --git a/tests/commands.test.ts b/tests/commands.test.ts index 6873ba03..bb9820e6 100644 --- a/tests/commands.test.ts +++ b/tests/commands.test.ts @@ -102,6 +102,7 @@ describe('CommandManager', () => { it('Should set git-graph:codiconsSupported to TRUE when vscode.version >= 1.42.0', () => { // Setup commandManager.dispose(); + vscode.mockVscodeVersion('1.42.0'); const spyOnExecuteCommand = jest.spyOn(vscode.commands, 'executeCommand'); const spyOnLog = jest.spyOn(logger, 'log'); vscode.commands.executeCommand.mockResolvedValueOnce(null); diff --git a/tests/diffDocProvider.test.ts b/tests/diffDocProvider.test.ts index f04f90cc..e08454cc 100644 --- a/tests/diffDocProvider.test.ts +++ b/tests/diffDocProvider.test.ts @@ -191,18 +191,7 @@ describe('encodeDiffDocUri', () => { }); describe('decodeDiffDocUri', () => { - it('Should return an null if requested on an empty file URI', () => { - // Run - const value = decodeDiffDocUri(vscode.Uri.file('file').with({ - scheme: 'git-graph', - query: 'bnVsbA==' - })); - - // Assert - expect(value).toBe(null); - }); - - it('Should return the parse DiffDocUriData if requested on a git-graph URI', () => { + it('Should return the parsed DiffDocUriData from the URI', () => { // Run const value = decodeDiffDocUri(vscode.Uri.file('file.txt').with({ scheme: 'git-graph', diff --git a/tests/utils.test.ts b/tests/utils.test.ts index 0c1cd2ed..ab2d31c3 100644 --- a/tests/utils.test.ts +++ b/tests/utils.test.ts @@ -322,7 +322,7 @@ describe('doesFileExist', () => { expect(mockedFileSystemModule.access).toHaveBeenNthCalledWith(1, 'file.txt', fs.constants.R_OK, expect.anything()); }); - it('Should return FILE when the file doesn\'t exist', async () => { + it('Should return FALSE when the file doesn\'t exist', async () => { // Setup mockedFileSystemModule.access.mockImplementationOnce((_1: fs.PathLike, _2: number | undefined, callback: (err: NodeJS.ErrnoException | null) => void) => callback(new Error())); diff --git a/web/main.ts b/web/main.ts index 07c73adb..f23b6633 100644 --- a/web/main.ts +++ b/web/main.ts @@ -991,8 +991,9 @@ class GitGraphView { if (remotesWithBranch.length > 0) { inputs.push({ type: DialogInputType.Checkbox, - name: 'Delete this branch on the remote' + (this.gitRemotes.length > 1 ? 's' : '') + '' + SVG_ICONS.info + '', - value: false + name: 'Delete this branch on the remote' + (this.gitRemotes.length > 1 ? 's' : ''), + value: false, + info: 'This branch is on the remote' + (remotesWithBranch.length > 1 ? 's: ' : ' ') + formatCommaSeparatedList(remotesWithBranch.map((remote) => '"' + remote + '"')) }); } dialog.showForm('Are you sure you want to delete the branch ' + escapeHtml(refName) + '?', inputs, 'Yes, delete', (values) => { @@ -1254,8 +1255,13 @@ class GitGraphView { title: 'Fetch into local branch' + ELLIPSIS, visible: visibility.fetch && remote !== '' && this.gitBranches.includes(branchName) && this.gitBranchHead !== branchName, onClick: () => { - dialog.showCheckbox('Are you sure you want to fetch the remote branch ' + escapeHtml(refName) + ' into the local branch ' + escapeHtml(branchName) + '?', 'Force Fetch' + SVG_ICONS.info + '', this.config.dialogDefaults.fetchIntoLocalBranch.forceFetch, 'Yes, fetch', (force) => { - runAction({ command: 'fetchIntoLocalBranch', repo: this.currentRepo, remote: remote, remoteBranch: branchName, localBranch: branchName, force: force }, 'Fetching Branch'); + dialog.showForm('Are you sure you want to fetch the remote branch ' + escapeHtml(refName) + ' into the local branch ' + escapeHtml(branchName) + '?', [{ + type: DialogInputType.Checkbox, + name: 'Force Fetch', + value: this.config.dialogDefaults.fetchIntoLocalBranch.forceFetch, + info: 'Force the local branch to be reset to this remote branch.' + }], 'Yes, fetch', (values) => { + runAction({ command: 'fetchIntoLocalBranch', repo: this.currentRepo, remote: remote, remoteBranch: branchName, localBranch: branchName, force: values[0] }, 'Fetching Branch'); }, target); } }, {