Skip to content

Commit 67b1f39

Browse files
committed
Release 1.29.0 package & documentation changes.
1 parent e513fc7 commit 67b1f39

File tree

11 files changed

+56
-43
lines changed

11 files changed

+56
-43
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.29.0 - 2021-02-28
4+
* #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.
5+
* #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.
6+
* #404 New context menu on all link elements (e.g. Issue Links, URL's in commit messages, author email addresses), enabling the URL to be copied to the clipboard.
7+
* #417 New context menu actions for branches, to select / unselect the branch in the Branches Dropdown.
8+
* #424 Consume Git configuration variables (`remote.pushDefault`, `branch.<name>.remote` & `branch.<name>.pushRemote`) to set the default remote to push branches and tags to (when multiple remotes are configured for a repository).
9+
* #426 If a diff tool is configured in Git (`diff.tool` or `diff.guitool`), you can now open a directory diff in the configured tool from the Commit Details View Control Bar. Note: `diff.tool` is opened via a Visual Studio Code Terminal, whereas `diff.guitool` is opened via a background process.
10+
* #427 When deleting a branch that is not fully merged, and "Force Delete" is not set on the "Delete Branch" dialog, a new dialog is subsequently shown to allow one-click force deletion, instead of displaying the error message returned by Git.
11+
* #429 Stashes can be hidden on the Git Graph View by disabling the new extension setting `git-graph.repository.showStashes`. It can be overridden per repository in the Git Graph View's Repository Settings Widget.
12+
* #452 Explicitly override the Git configuration variable `log.showSignature` to ensure consistent parsing of commits.
13+
* Significant code and UI improvements.
14+
315
## 1.28.0 - 2020-12-01
416
* #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`).
517
* #406 The keybindings for all Git Graph View keyboard shortcuts can now be configured using new extension settings `git-graph.keyboardShortcut.*`.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ A summary of the Git Graph extension settings are:
125125
* **Show Commits Only Referenced By Tags**: Show Commits that are only referenced by tags in Git Graph.
126126
* **Show Remote Branches**: Show Remote Branches in Git Graph by default.
127127
* **Show Remote Heads**: Show Remote HEAD Symbolic References in Git Graph.
128+
* **Show Stashes**: Show Stashes in Git Graph by default.
128129
* **Show Tags**: Show Tags in Git Graph by default.
129130
* **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.
130131
* **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.

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.28.0",
4+
"version": "1.29.0",
55
"publisher": "mhutchie",
66
"author": {
77
"name": "Michael Hutchison",

src/dataSource.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export class DataSource extends Disposable {
307307
branches: branches,
308308
diffTool: getConfigValue(consolidatedConfigs, GIT_CONFIG.DIFF.TOOL),
309309
guiDiffTool: getConfigValue(consolidatedConfigs, GIT_CONFIG.DIFF.GUI_TOOL),
310-
pushDefault: getConfigValue(localConfigs, GIT_CONFIG.REMOTE.PUSH_DEFAULT),
310+
pushDefault: getConfigValue(consolidatedConfigs, GIT_CONFIG.REMOTE.PUSH_DEFAULT),
311311
remotes: remotes.map((remote) => ({
312312
name: remote,
313313
url: getConfigValue(localConfigs, 'remote.' + remote + '.url'),
@@ -1344,7 +1344,7 @@ export class DataSource extends Disposable {
13441344
* Get the configuration list of a repository.
13451345
* @param repo The path of the repository.
13461346
* @param location The location of the configuration to be listed.
1347-
* @returns A set key-value pairs of Git configuration records.
1347+
* @returns A set of key-value pairs of Git configuration records.
13481348
*/
13491349
private getConfigList(repo: string, location?: GitConfigLocation): Promise<GitConfigSet> {
13501350
const args = ['--no-pager', 'config', '--list', '-z', '--includes'];
@@ -1800,6 +1800,11 @@ function removeTrailingBlankLines(lines: string[]) {
18001800
return lines;
18011801
}
18021802

1803+
/**
1804+
* Get all the unique strings from an array of strings.
1805+
* @param items The array of strings with duplicates.
1806+
* @returns An array of unique strings.
1807+
*/
18031808
function unique(items: ReadonlyArray<string>) {
18041809
const uniqueItems: { [item: string]: true } = {};
18051810
items.forEach((item) => uniqueItems[item] = true);

tests/dataSource.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,8 @@ describe('DataSource', () => {
23582358
mockGitSuccessOnce(
23592359
'user.name\nLocal Name\0' +
23602360
'diff.tool\nabc\0' +
2361-
'diff.guitool\ndef\0'
2361+
'diff.guitool\ndef\0' +
2362+
'remote.pushdefault\norigin\0'
23622363
);
23632364
mockGitSuccessOnce(
23642365
'user.name\nLocal Name\0' +
@@ -2406,7 +2407,7 @@ describe('DataSource', () => {
24062407
},
24072408
diffTool: 'abc',
24082409
guiDiffTool: 'def',
2409-
pushDefault: null,
2410+
pushDefault: 'origin',
24102411
remotes: [
24112412
{
24122413
name: 'origin',

tests/repoManager.test.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,81 +1702,81 @@ describe('RepoManager', () => {
17021702
});
17031703

17041704
describe('fileViewType', () => {
1705-
it('Should export FileViewType.Tree correctly', testApplyField('fileViewType', FileViewType.Tree, 'fileViewType', ExternalRepoConfig.FileViewType.Tree));
1706-
it('Should export FileViewType.List correctly', testApplyField('fileViewType', FileViewType.List, 'fileViewType', ExternalRepoConfig.FileViewType.List));
1705+
it('Should import FileViewType.Tree correctly', testApplyField('fileViewType', FileViewType.Tree, 'fileViewType', ExternalRepoConfig.FileViewType.Tree));
1706+
it('Should import FileViewType.List correctly', testApplyField('fileViewType', FileViewType.List, 'fileViewType', ExternalRepoConfig.FileViewType.List));
17071707
});
17081708

17091709
describe('hideRemotes', () => {
1710-
it('Should export hideRemotes correctly', testApplyField('hideRemotes', ['origin'], 'hideRemotes', ['origin']));
1710+
it('Should import hideRemotes correctly', testApplyField('hideRemotes', ['origin'], 'hideRemotes', ['origin']));
17111711
});
17121712

17131713
describe('includeCommitsMentionedByReflogs', () => {
1714-
it('Should export BooleanOverride.Enabled correctly', testApplyField('includeCommitsMentionedByReflogs', BooleanOverride.Enabled, 'includeCommitsMentionedByReflogs', true));
1715-
it('Should export BooleanOverride.Disabled correctly', testApplyField('includeCommitsMentionedByReflogs', BooleanOverride.Disabled, 'includeCommitsMentionedByReflogs', false));
1714+
it('Should import BooleanOverride.Enabled correctly', testApplyField('includeCommitsMentionedByReflogs', BooleanOverride.Enabled, 'includeCommitsMentionedByReflogs', true));
1715+
it('Should import BooleanOverride.Disabled correctly', testApplyField('includeCommitsMentionedByReflogs', BooleanOverride.Disabled, 'includeCommitsMentionedByReflogs', false));
17161716
});
17171717

17181718
describe('issueLinkingConfig', () => {
1719-
it('Should export issueLinkingConfig correctly', testApplyField('issueLinkingConfig', { issue: 'x', url: 'y' }, 'issueLinkingConfig', { issue: 'x', url: 'y' }));
1719+
it('Should import issueLinkingConfig correctly', testApplyField('issueLinkingConfig', { issue: 'x', url: 'y' }, 'issueLinkingConfig', { issue: 'x', url: 'y' }));
17201720
});
17211721

17221722
describe('name', () => {
1723-
it('Should export name correctly', testApplyField('name', 'Name', 'name', 'Name'));
1723+
it('Should import name correctly', testApplyField('name', 'Name', 'name', 'Name'));
17241724
});
17251725

17261726
describe('onlyFollowFirstParent', () => {
1727-
it('Should export BooleanOverride.Enabled correctly', testApplyField('onlyFollowFirstParent', BooleanOverride.Enabled, 'onlyFollowFirstParent', true));
1728-
it('Should export BooleanOverride.Disabled correctly', testApplyField('onlyFollowFirstParent', BooleanOverride.Disabled, 'onlyFollowFirstParent', false));
1727+
it('Should import BooleanOverride.Enabled correctly', testApplyField('onlyFollowFirstParent', BooleanOverride.Enabled, 'onlyFollowFirstParent', true));
1728+
it('Should import BooleanOverride.Disabled correctly', testApplyField('onlyFollowFirstParent', BooleanOverride.Disabled, 'onlyFollowFirstParent', false));
17291729
});
17301730

17311731
describe('onRepoLoadShowCheckedOutBranch', () => {
1732-
it('Should export BooleanOverride.Enabled correctly', testApplyField('onRepoLoadShowCheckedOutBranch', BooleanOverride.Enabled, 'onRepoLoadShowCheckedOutBranch', true));
1733-
it('Should export BooleanOverride.Disabled correctly', testApplyField('onRepoLoadShowCheckedOutBranch', BooleanOverride.Disabled, 'onRepoLoadShowCheckedOutBranch', false));
1732+
it('Should import BooleanOverride.Enabled correctly', testApplyField('onRepoLoadShowCheckedOutBranch', BooleanOverride.Enabled, 'onRepoLoadShowCheckedOutBranch', true));
1733+
it('Should import BooleanOverride.Disabled correctly', testApplyField('onRepoLoadShowCheckedOutBranch', BooleanOverride.Disabled, 'onRepoLoadShowCheckedOutBranch', false));
17341734
});
17351735

17361736
describe('onRepoLoadShowSpecificBranches', () => {
1737-
it('Should export onRepoLoadShowSpecificBranches correctly', testApplyField('onRepoLoadShowSpecificBranches', ['master'], 'onRepoLoadShowSpecificBranches', ['master']));
1737+
it('Should import onRepoLoadShowSpecificBranches correctly', testApplyField('onRepoLoadShowSpecificBranches', ['master'], 'onRepoLoadShowSpecificBranches', ['master']));
17381738
});
17391739

17401740
describe('pullRequestConfig', () => {
1741-
it('Should export a Bitbucket config correctly', testApplyField(
1741+
it('Should import a Bitbucket config correctly', testApplyField(
17421742
'pullRequestConfig', { provider: PullRequestProvider.Bitbucket, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' },
17431743
'pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.Bitbucket, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' }
17441744
));
17451745

1746-
it('Should export a Custom config correctly', testApplyField(
1746+
it('Should import a Custom config correctly', testApplyField(
17471747
'pullRequestConfig', { provider: PullRequestProvider.Custom, custom: { name: 'Name', templateUrl: '$1/$2/$3/$4/$5/$6/$8' }, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' },
17481748
'pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.Custom, custom: { name: 'Name', templateUrl: '$1/$2/$3/$4/$5/$6/$8' }, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' }
17491749
));
17501750

1751-
it('Should export a GitHub config correctly', testApplyField(
1751+
it('Should import a GitHub config correctly', testApplyField(
17521752
'pullRequestConfig', { provider: PullRequestProvider.GitHub, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' },
17531753
'pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.GitHub, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' }
17541754
));
17551755

1756-
it('Should export a GitLab config correctly', testApplyField(
1756+
it('Should import a GitLab config correctly', testApplyField(
17571757
'pullRequestConfig', { provider: PullRequestProvider.GitLab, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' },
17581758
'pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.GitLab, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: 'e', destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' }
17591759
));
17601760

1761-
it('Should export a GitHub config with no destination remote correctly', testApplyField(
1761+
it('Should import a GitHub config with no destination remote correctly', testApplyField(
17621762
'pullRequestConfig', { provider: PullRequestProvider.GitHub, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: null, destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' },
17631763
'pullRequestConfig', { provider: ExternalRepoConfig.PullRequestProvider.GitHub, custom: null, hostRootUrl: 'a', sourceRemote: 'b', sourceOwner: 'c', sourceRepo: 'd', destRemote: null, destOwner: 'f', destRepo: 'g', destProjectId: 'h', destBranch: 'i' }
17641764
));
17651765
});
17661766

17671767
describe('showRemoteBranches', () => {
1768-
it('Should export BooleanOverride.Enabled correctly', testApplyField('showRemoteBranchesV2', BooleanOverride.Enabled, 'showRemoteBranches', true));
1769-
it('Should export BooleanOverride.Disabled correctly', testApplyField('showRemoteBranchesV2', BooleanOverride.Disabled, 'showRemoteBranches', false));
1768+
it('Should import BooleanOverride.Enabled correctly', testApplyField('showRemoteBranchesV2', BooleanOverride.Enabled, 'showRemoteBranches', true));
1769+
it('Should import BooleanOverride.Disabled correctly', testApplyField('showRemoteBranchesV2', BooleanOverride.Disabled, 'showRemoteBranches', false));
17701770
});
17711771

17721772
describe('showStashes', () => {
1773-
it('Should export BooleanOverride.Enabled correctly', testApplyField('showStashes', BooleanOverride.Enabled, 'showStashes', true));
1774-
it('Should export BooleanOverride.Disabled correctly', testApplyField('showStashes', BooleanOverride.Disabled, 'showStashes', false));
1773+
it('Should import BooleanOverride.Enabled correctly', testApplyField('showStashes', BooleanOverride.Enabled, 'showStashes', true));
1774+
it('Should import BooleanOverride.Disabled correctly', testApplyField('showStashes', BooleanOverride.Disabled, 'showStashes', false));
17751775
});
17761776

17771777
describe('showTags', () => {
1778-
it('Should export BooleanOverride.Enabled correctly', testApplyField('showTags', BooleanOverride.Enabled, 'showTags', true));
1779-
it('Should export BooleanOverride.Disabled correctly', testApplyField('showTags', BooleanOverride.Disabled, 'showTags', false));
1778+
it('Should import BooleanOverride.Enabled correctly', testApplyField('showTags', BooleanOverride.Enabled, 'showTags', true));
1779+
it('Should import BooleanOverride.Disabled correctly', testApplyField('showTags', BooleanOverride.Disabled, 'showTags', false));
17801780
});
17811781
});
17821782

web/dropdown.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ class Dropdown {
145145
// Select the option with the specified value
146146
this.optionsSelected[optionIndex] = true;
147147

148-
if (this.optionsSelected.slice(1).every((selected) => selected)) {
149-
// All options are selected, so simplify selected items to just be "Show All"
150-
this.optionsSelected[0] = true;
151-
for (let i = 1; i < this.optionsSelected.length; i++) {
152-
this.optionsSelected[i] = false;
153-
}
154-
}
155-
156148
// A change has occurred, re-render the dropdown options
157149
const menuScroll = this.menuElem.scrollTop;
158150
this.render();

web/findWidget.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,7 @@ class FindWidget {
394394
if (workspaceState.findOpenCommitDetailsView) {
395395
const commitHash = this.getCurrentHash();
396396
if (commitHash !== null && !this.view.isCdvOpen(commitHash, null)) {
397-
const commitId = this.view.getCommitId(commitHash);
398-
const commitElems = getCommitElems();
399-
const commitElem = findCommitElemWithId(commitElems, commitId);
397+
const commitElem = findCommitElemWithId(getCommitElems(), this.view.getCommitId(commitHash));
400398
if (commitElem !== null) {
401399
this.view.loadCommitDetails(commitElem);
402400
}

web/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2611,14 +2611,14 @@ class GitGraphView {
26112611
if (externalDiffPossible) {
26122612
document.getElementById('cdvExternalDiff')!.addEventListener('click', () => {
26132613
const expandedCommit = this.expandedCommit;
2614-
if (expandedCommit === null) return;
2614+
if (expandedCommit === null || this.gitConfig === null || (this.gitConfig.diffTool === null && this.gitConfig.guiDiffTool === null)) return;
26152615
const commitOrder = this.getCommitOrder(expandedCommit.commitHash, expandedCommit.compareWithHash === null ? expandedCommit.commitHash : expandedCommit.compareWithHash);
26162616
runAction({
26172617
command: 'openExternalDirDiff',
26182618
repo: this.currentRepo,
26192619
fromHash: commitOrder.from,
26202620
toHash: commitOrder.to,
2621-
isGui: this.gitConfig !== null && this.gitConfig.guiDiffTool !== null
2621+
isGui: this.gitConfig.guiDiffTool !== null
26222622
}, 'Opening External Directory Diff');
26232623
});
26242624
}
@@ -2969,7 +2969,7 @@ class GitGraphView {
29692969
const externalDiffBtnElem = document.getElementById('cdvExternalDiff');
29702970
if (externalDiffBtnElem === null) return;
29712971

2972-
alterClass(externalDiffBtnElem, CLASS_DISABLED, this.gitConfig === null || (this.gitConfig.diffTool === null && this.gitConfig.guiDiffTool === null));
2972+
alterClass(externalDiffBtnElem, CLASS_ENABLED, this.gitConfig !== null && (this.gitConfig.diffTool !== null || this.gitConfig.guiDiffTool !== null));
29732973
const toolName = this.gitConfig !== null
29742974
? this.gitConfig.guiDiffTool !== null
29752975
? this.gitConfig.guiDiffTool

web/styles/main.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,12 @@ body.selection-background-color-exists ::selection{
356356
background-color:rgba(128,128,128,0.125);
357357
}
358358

359-
#cdvExternalDiff.disabled{
359+
#cdvExternalDiff{
360360
display:none;
361361
}
362+
#cdvExternalDiff.enabled{
363+
display:block;
364+
}
362365

363366
.cdvControlBtn svg{
364367
position:absolute;

0 commit comments

Comments
 (0)