From 67dcc69c27a1f9f5920db22e4ecc4d30b71eb119 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 22 May 2019 01:28:36 -0400 Subject: [PATCH] Adds branch compare visiblity view setting --- CHANGELOG.md | 13 ++++++++++++ README.md | 40 +++++++++++++++++++++-------------- package.json | 6 ++++++ src/config.ts | 1 + src/views/nodes/repositoryNode.ts | 2 +- src/webviews/apps/settings/index.html | 17 +++++++++++++++ 6 files changed, 62 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c7ca8..8255db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +## Added + +- Adds a new _Compare Current Branch with..._ node to each repository in the _Repositories_ view — closes [#293](https://github.com/eamodio/vscode-gitlens/issues/293) + - **Compare Current Branch with...** — optionally shows a comparison of the current branch to a user-selected reference + - **\* Commits** — lists the commits between the compared revisions + - Expands to provide the message, author, date, and change indicator of each revision (commit) + - Each revision (commit) expands to list its set of changed files, complete with status indicators for adds, changes, renames, and deletes + - An inline toolbar provides quick access to the _Open File_, _Copy Commit ID to Clipboard_ (`alt-click` for _Copy Commit Message to Clipboard_), and _Open File on Remote_ (if available) commands + - A context menu provides access to more common file revision commands + - **\* Files Changed** — lists all of the files changed between the compared revisions +- Adds a `gitlens.views.repositories.showBranchComparison` setting to specify whether to show a comparison of the current branch to a user-selected reference in the _Repositories_ view ## [9.7.4] - 2019-05-15 ## Added diff --git a/README.md b/README.md index 0f97b7a..a44d5b3 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,13 @@ The repositories view provides the following features, - **\* Files Changed** — lists all the "working" changes - Expands to a file-based view of all changed files in the working tree ([optionally](#repositories-view-settings- 'Jump to the Repositories view settings')) and/or all files in all commits ahead of the upstream - An inline toolbar provides quick access to the _Stash All Changes_ command + - **Compare Current Branch with...** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows a comparison of the current branch to a user-selected reference + - **\* Commits** — lists the commits between the compared revisions + - Expands to provide the message, author, date, and change indicator of each revision (commit) — fully [customizable](#view-settings- 'Jump to the View settings') + - Each revision (commit) expands to list its set of changed files, complete with status indicators for adds, changes, renames, and deletes + - An inline toolbar provides quick access to the _Open File_, _Copy Commit ID to Clipboard_ (`alt-click` for _Copy Commit Message to Clipboard_), and _Open File on Remote_ (if available) commands + - A context menu provides access to more common file revision commands + - **\* Files Changed** — lists all of the files changed between the compared revisions - **Branches** — lists the local branches in the repository @@ -461,12 +468,12 @@ The compare view provides the following features, - Provides a semi-persistent results view for comparison operations - An inline toolbar provides quick access to the _Swap Comparison_, _Pin Comparison_ (when applicable), _Unpin Comparison_ (when applicable), _Refresh_, and _Dismiss_ commands - A context menu provides access to common comparison commands - - **\* Commits** — lists the commits between the compared revisions (branches or commits) + - **\* Commits** — lists the commits between the compared revisions - Expands to provide the message, author, date, and change indicator of each revision (commit) — fully [customizable](#view-settings- 'Jump to the View settings') - Each revision (commit) expands to list its set of changed files, complete with status indicators for adds, changes, renames, and deletes - An inline toolbar provides quick access to the _Open File_, _Copy Commit ID to Clipboard_ (`alt-click` for _Copy Commit Message to Clipboard_), and _Open File on Remote_ (if available) commands - A context menu provides access to more common file revision commands - - **\* Files Changed** — lists all of the files changed between the compared revisions (branches or commits) + - **\* Files Changed** — lists all of the files changed between the compared revisions - Expands to a file-based view of all changed files in the working tree ([optionally](#compare-view-settings- 'Jump to the Compare view settings')) and/or all files in all commits ahead of the upstream - Results can be provided by the following commands - _Compare with Remote_ command (`gitlens.views.compareWithRemote`) @@ -760,20 +767,21 @@ GitLens is highly customizable and provides many configuration settings to allow See also [View Settings](#view-settings- 'Jump to the View settings') -| Name | Description | -| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `gitlens.views.repositories.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view | -| `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes | -| `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files | -| `gitlens.views.repositories.branches.layout` | Specifies how the _Repositories_ view will display branches

`list` - displays branches as a list
`tree` - displays branches as a tree when branch names contain slashes `/` | -| `gitlens.views.repositories.compact` | Specifies whether to show the _Repositories_ view in a compact display density | -| `gitlens.views.repositories.enabled` | Specifies whether to show the _Repositories_ view | -| `gitlens.views.repositories.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `tree` or `auto` | -| `gitlens.views.repositories.files.layout` | Specifies how the _Repositories_ view will display files

`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.repositories.files.threshold` value and the number of files at each nesting level
`list` - displays files as a list
`tree` - displays files as a tree | -| `gitlens.views.repositories.files.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `auto` | -| `gitlens.views.repositories.includeWorkingTree` | Specifies whether to include working tree file status for each repository in the _Repositories_ view | -| `gitlens.views.repositories.location` | Specifies where to show the _Repositories_ view

`gitlens` - adds to the GitLens side bar
`explorer` - adds to the Explorer side bar
`scm` - adds to the Source Control side bar | -| `gitlens.views.repositories.showTrackingBranch` | Specifies whether to show the tracking branch when displaying local branches in the _Repositories_ view | +| Name | Description | +| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `gitlens.views.repositories.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view | +| `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes | +| `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files | +| `gitlens.views.repositories.branches.layout` | Specifies how the _Repositories_ view will display branches

`list` - displays branches as a list
`tree` - displays branches as a tree when branch names contain slashes `/` | +| `gitlens.views.repositories.compact` | Specifies whether to show the _Repositories_ view in a compact display density | +| `gitlens.views.repositories.enabled` | Specifies whether to show the _Repositories_ view | +| `gitlens.views.repositories.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `tree` or `auto` | +| `gitlens.views.repositories.files.layout` | Specifies how the _Repositories_ view will display files

`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.repositories.files.threshold` value and the number of files at each nesting level
`list` - displays files as a list
`tree` - displays files as a tree | +| `gitlens.views.repositories.files.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `auto` | +| `gitlens.views.repositories.includeWorkingTree` | Specifies whether to include working tree file status for each repository in the _Repositories_ view | +| `gitlens.views.repositories.location` | Specifies where to show the _Repositories_ view

`gitlens` - adds to the GitLens side bar
`explorer` - adds to the Explorer side bar
`scm` - adds to the Source Control side bar | +| `gitlens.views.repositories.showBranchComparison` | Specifies whether to show a comparison of the current branch to a user-selected reference in the _Repositories_ view | +| `gitlens.views.repositories.showTrackingBranch` | Specifies whether to show the tracking branch when displaying local branches in the _Repositories_ view | ### File History View Settings [#](#file-history-view-settings- 'File History View Settings') diff --git a/package.json b/package.json index 0ff9900..27a59df 100644 --- a/package.json +++ b/package.json @@ -1519,6 +1519,12 @@ "markdownDescription": "Specifies where to show the _Repositories_ view", "scope": "window" }, + "gitlens.views.repositories.showBranchComparison": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to show a comparison of the current branch to a user-selected reference in the _Repositories_ view", + "scope": "window" + }, "gitlens.views.repositories.showTrackingBranch": { "type": "boolean", "default": true, diff --git a/src/config.ts b/src/config.ts index 5ddc90c..d53d2d2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -363,6 +363,7 @@ export interface RepositoriesViewConfig { files: ViewsFilesConfig; includeWorkingTree: boolean; location: ViewLocation; + showBranchComparison: boolean; showTrackingBranch: boolean; } diff --git a/src/views/nodes/repositoryNode.ts b/src/views/nodes/repositoryNode.ts index 41ac0e0..18d2058 100644 --- a/src/views/nodes/repositoryNode.ts +++ b/src/views/nodes/repositoryNode.ts @@ -75,7 +75,7 @@ export class RepositoryNode extends SubscribeableViewNode { children.push(new StatusFilesNode(this.view, this, status, range)); } - if (Container.config.insiders) { + if (this.view.config.showBranchComparison) { children.push(new CompareBranchNode(this.uri, this.view, this, branch)); } diff --git a/src/webviews/apps/settings/index.html b/src/webviews/apps/settings/index.html index 026038f..d566844 100644 --- a/src/webviews/apps/settings/index.html +++ b/src/webviews/apps/settings/index.html @@ -2445,6 +2445,23 @@ data-enablement="views.repositories.enabled" data-visibility="settings.mode =advanced" > + + + + +