Skip to content

Commit

Permalink
Adds branch compare visiblity view setting
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed May 22, 2019
1 parent d11cb57 commit 67dcc69
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 17 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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`)
Expand Down Expand Up @@ -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<br /><br />`list` - displays branches as a list<br />`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<br /><br />`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<br />`list` - displays files as a list<br />`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<br /><br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`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<br /><br />`list` - displays branches as a list<br />`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<br /><br />`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<br />`list` - displays files as a list<br />`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<br /><br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`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')

Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export interface RepositoriesViewConfig {
files: ViewsFilesConfig;
includeWorkingTree: boolean;
location: ViewLocation;
showBranchComparison: boolean;
showTrackingBranch: boolean;
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/nodes/repositoryNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class RepositoryNode extends SubscribeableViewNode<RepositoriesView> {
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));
}

Expand Down
17 changes: 17 additions & 0 deletions src/webviews/apps/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,23 @@ <h2 class="section__title">
</select>
</div>

<div
class="settings-group__setting ml-2 hidden"
data-enablement="views.repositories.enabled"
data-visibility="settings.mode =advanced"
>
<input
class="setting"
id="views.repositories.showBranchComparison"
name="views.repositories.showBranchComparison"
type="checkbox"
disabled
/>
<label for="views.repositories.showBranchComparison"
>Show a comparison of the current branch to a user-selected reference</label
>
</div>

<div
class="settings-group__setting ml-2 hidden"
data-enablement="views.repositories.enabled"
Expand Down

0 comments on commit 67dcc69

Please sign in to comment.