Skip to content

Commit

Permalink
Release 1.30.0 package & documentation changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutchie committed Apr 5, 2021
1 parent 4db26be commit e44a48b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 21 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "git-graph",
"displayName": "Git Graph",
"version": "1.29.0",
"version": "1.30.0",
"publisher": "mhutchie",
"author": {
"name": "Michael Hutchison",
Expand Down Expand Up @@ -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)."
Expand Down
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions tests/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 1 addition & 12 deletions tests/diffDocProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()));

Expand Down
14 changes: 10 additions & 4 deletions web/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' : '') + '<span class="dialogInfo" title="This branch is on the remote' + (remotesWithBranch.length > 1 ? 's: ' : ' ') + formatCommaSeparatedList(remotesWithBranch.map(remote => escapeHtml('"' + remote + '"'))) + '">' + SVG_ICONS.info + '</span>',
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 <b><i>' + escapeHtml(refName) + '</i></b>?', inputs, 'Yes, delete', (values) => {
Expand Down Expand Up @@ -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 <b><i>' + escapeHtml(refName) + '</i></b> into the local branch <b><i>' + escapeHtml(branchName) + '</i></b>?', 'Force Fetch<span class="dialogInfo" title="Force the local branch to be reset to this remote branch.">' + SVG_ICONS.info + '</span>', 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 <b><i>' + escapeHtml(refName) + '</i></b> into the local branch <b><i>' + escapeHtml(branchName) + '</i></b>?', [{
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: <boolean>values[0] }, 'Fetching Branch');
}, target);
}
}, {
Expand Down

0 comments on commit e44a48b

Please sign in to comment.