1 Commits

Author SHA1 Message Date
Eric Amodio
529549129f Preps v5.0.0-alpha
Updates dependencies
2017-09-02 01:46:29 -04:00
49 changed files with 1289 additions and 1700 deletions

View File

@@ -4,87 +4,62 @@ 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/). The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [5.0.0-alpha.2] - 2017-09-03 ## [5.0.0-alpha] - 2017-09-02
### Added ### Added
- Adds an all-new `GitLens` custom view to the Explorer activity - Adds an all-new `GitLens` custom view to the Explorer activity
- `Repository View` - provides a full repository explorer - `Repository View` - provides a full repository explorer
![GitLens Repository view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-git-custom-view-repository.png) ![GitLens Repository view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-git-custom-view-repository.png)
- `Repository Status` node — provides the status of the repository - `Status` node — provides the status of current branch
- Provides the name of the current branch, its upstream tracking branch (if available), and its upstream status (if available) - Indicates whether or not the current branch is up-to-date with its upstream branch
- Provides indicator dots on the repository icon which denote the following: - If the branch is out of sync, additional nodes will be shown with the specific commits ahead and/or behind the upstream
- `None` - up-to-date with the upstream
- `Green` - ahead of the upstream
- `Red` - behind the upstream
- `Yellow` - both ahead of and behind the upstream
- Provides additional nodes, if the current branch is not synchronized with the upstream, to quickly see and explore the specific commits ahead and/or behind the upstream
- Provides a context menu with `Open Repository in Remote`, and `Refresh` commands
- `Branches` node — provides a list of the local branches - `Branches` node — provides a list of the local branches
- Indicates which branch is the current branch and optionally shows the remote tracking branch - Indicates which branch is the current branch
- Expand each branch to easily see its revision (commit) history - Expand each branch to easily see its revision (commit) history
- Expand each revision (commit) to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes - Expand each revision (commit) to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes
- Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, and `Show Commit File Details` commands - Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, and `Show Commit File Details` commands
- Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, `Show Commit Details`, and `Refresh` commands - Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, and `Show Commit Details` commands
- Provides a context menu on each branch with `Open Branch in Remote`, and `Refresh` commands - Provides a context menu on each branch with an `Open Branch in Remote` command
- Provides a context menu with `Open Branches in Remote`, and `Refresh` commands
- `Remotes` node — provides a list of remotes - `Remotes` node — provides a list of the remote branches
- Expand each remote to see its list of branches - See `Branches` node above for details
- Expand each branch to easily see its revision (commit) history
- Expand each revision (commit) to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes
- Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, and `Show Commit File Details` commands
- Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, `Show Commit Details`, and `Refresh` commands
- Provides a context menu on each remote with `Open Branches in Remote`, `Open Repository in Remote`, and `Refresh` commands
- Provides a context menu with a `Refresh` command
- `Stashes` node — provides a list of stashed changes - `Stashes` node — provides a list of stashed changes
- Expand each stash to quickly see the set of files stashed, complete with status indicators for adds, changes, renames, and deletes - Expand each stash to quickly see the set of files stashed, complete with status indicators for adds, changes, renames, and deletes
- Provides a context menu with `Stash Changes`, and `Refresh` commands - Provides a context menu on each stash with `Apply Stashed Changes` (confirmation required), `Delete Stashed Changes` (confirmation required), `Copy Commit Message to Clipboard`, `Open Files`, and `Open Revisions` commands
- Provides a context menu on each stash with `Apply Stashed Changes` (confirmation required), `Delete Stashed Changes` (confirmation required), `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, and `Refresh` commands - Provides a context menu on each stashed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, and `Show File History` commands
- Provides a context menu on each stashed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Apply Changes`, and `Show File History` commands
- `History View` - provides the revision history of the active file - `History View` - provides the revision history of the active file
![GitLens History view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-git-custom-view-history.png) ![GitLens History view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-git-custom-view-history.png)
- Automatically updates to track the active editor - Automatically updates to track the active editor
- Provides a context menu with `Open File`, `Open File in Remote`, and `Refresh` commands - Provides a context menu on each revision (commit) with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, and `Show Commit File Details` commands
- Provides a context menu on each revision (commit) with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, and `Show Commit File Details` commands
- Quickly switch between views using the `Switch to Repository View` or `Switch to History View` commands - Quickly switch between views using the `Switch to Repository View` or `Switch to History View` commands
- Provides toolbar commands to `Search Commits`, `Switch to Repository View` or `Switch to History View`, and `Refresh` - Provides toolbar buttons to `Search Commits`, `Switch to Repository View` or `Switch to History View`, and `Refresh`
- Adds `Open Branches in Remote` command (`gitlens.openBranchesInRemote`) - opens the branches in the supported remote service - Adds `${filePath}` token to file formatting
- Adds `Stash Changes` command (`gitlens.stashSave`) to the source control group context menu -- can now stash a group of files
- Adds `Stash Changes` command (`gitlens.stashSave`) to the source control resource context menu -- can now stash individual files (works with multi-select too!)
- Adds `gitlens.gitExplorer.view` setting to specify the starting view (mode) of the `GitLens` custom view
- Adds `gitlens.gitExplorer.showTrackingBranch` setting to specify whether or not to show the tracking branch when displaying local branches in the `GitLens` custom view
- Adds `gitlens.gitExplorer.commitFormat` setting to specify the format of committed changes in the `GitLens` custom view
- Adds `gitlens.gitExplorer.commitFileFormat` setting to specify the format of a committed file in the `GitLens` custom view
- Adds `gitlens.gitExplorer.stashFormat` setting to specify the format of stashed changes in the `GitLens` custom view
- Adds `gitlens.gitExplorer.stashFileFormat` setting to specify the format of a stashed file in the `GitLens` custom view
- Adds `${filePath}` token to file formatting settings
### Changed ### Changed
- Changes `Show Stashed Changes` option icon in repository status quick pick menu to match the `GitLens` custom view - Renames `Compare File with Previous` command (gitlens.diffWithPrevious) to `Compare File with Previous Revision`
- Changes `Stash Changes` option icon in stashed changes quick pick menu to a plus (+)
- Renames `Compare File with Previous` command (`gitlens.diffWithPrevious`) to `Compare File with Previous Revision`
- Renames `Compare File with Next Commit` command (`gitlens.diffWithNext`) to `Compare File with Next Revision` - Renames `Compare File with Next Commit` command (`gitlens.diffWithNext`) to `Compare File with Next Revision`
- Renames `Compare File with Working Tree` command (`gitlens.diffWithWorking`) to `Compare File with Working Revision` - Renames `Compare File with Working Tree` command (`gitlens.diffWithWorking`) to `Compare File with Working Revision`
- Renames `Compare Line Commit with Previous` command (`gitlens.diffLineWithPrevious`) to `Compare Line Revision with Previous` - Renames `Compare Line Commit with Previous` command (`gitlens.diffLineWithPrevious`) to `Compare Line Revision with Previous`
- Renames `Compare Line Commit with Working Tree` command (`gitlens.diffLineWithWorking`) to `Compare Line Revision with Working` - Renames `Compare Line Commit with Working Tree` command (`gitlens.diffLineWithWorking`) to `Compare Line Revision with Working`
### Removed - Renames `gitlens.stashExplorer.stashFormat` setting to `gitlens.gitExplorer.stashFormat`
- Removes `Git Stashes` custom view view - as it's functionality has been folded into the new `GitLens` custom view - Renames `gitlens.stashExplorer.stashFileFormat` setting to `gitlens.gitExplorer.stashFileFormat`
- Removes `gitlens.stashExplorer.stashFormat` setting - Changes `gitlens.gitExplorer.stashFileFormat` setting to defaults to `${filePath}` for better separator handling
- Removes `gitlens.stashExplorer.stashFileFormat` setting
- Removes `Stash Unstaged Changes` option from stashed changes quick pick menu -- didn't work as intended ## Removed
- Removes the `Git Stashes` custom view view - as it's functionality has been folded into the new `GitLens` custom view
- Removes the seeding of the commit search command from the clipboard - Removes the seeding of the commit search command from the clipboard
### Fixed ## Fixed
- Fixes an issue where remote branches couldn't be opened properly in their remote service - Fixes an issue where remote branches couldn't be opened properly in their remote service
## [4.4.3] - 2017-08-30 ## [4.4.3] - 2017-08-30
@@ -147,7 +122,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## Added ## Added
- Adds `Git Stashes` custom view to the Explorer activity - Adds `Git Stashes` custom view to the Explorer activity
![Git Stashes view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-git-stashes.png) ![Git Stashes view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-git-stashes.png)
- Shows all of the stashed changes in the repository - Shows all of the stashed changes in the repository
- Provides toolbar buttons to `Stash Changes` and `Refresh` - Provides toolbar buttons to `Stash Changes` and `Refresh`

View File

@@ -10,7 +10,7 @@ GitLens **supercharges** the built-in Visual Studio Code Git capabilities. It he
GitLens provides an unobtrusive blame annotation at the end of the current line, a status bar item showing the commit information (author and date, by default) of the current line, code lens showing the most recent commit and # of authors of the file and/or code block, and many commands for exploring commits and histories, comparing and navigating revisions, stash access, repository status, and more. GitLens is also [highly customizable](#extension-settings) to meet your specific needs — find code lens intrusive or the current line blame annotation distracting — no problem, it is easy to [turn them off or change how they behave](#extension-settings). GitLens provides an unobtrusive blame annotation at the end of the current line, a status bar item showing the commit information (author and date, by default) of the current line, code lens showing the most recent commit and # of authors of the file and/or code block, and many commands for exploring commits and histories, comparing and navigating revisions, stash access, repository status, and more. GitLens is also [highly customizable](#extension-settings) to meet your specific needs — find code lens intrusive or the current line blame annotation distracting — no problem, it is easy to [turn them off or change how they behave](#extension-settings).
### Preview — featuring blame annotations, code lens, status bar details, quick pick menus for navigation and exploration, compare with previous, and more ### Preview — featuring blame annotations, code lens, status bar details, quick pick menus for navigation and exploration, compare with previous, and more
![GitLens preview](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/gitlens-preview.gif) ![GitLens preview](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/gitlens-preview.gif)
## Features ## Features
@@ -18,16 +18,16 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds an unobtrusive, highly [customizable](#line-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotation** to the end of the current line ([optional](#line-blame-annotation-settings), on by default) - Adds an unobtrusive, highly [customizable](#line-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotation** to the end of the current line ([optional](#line-blame-annotation-settings), on by default)
![Line Blame Annotation](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-line-blame-annotation.png) ![Line Blame Annotation](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-line-blame-annotation.png)
- Contains the author, date, and message of the line's most recent commit, by [default](#line-blame-annotation-settings) - Contains the author, date, and message of the line's most recent commit, by [default](#line-blame-annotation-settings)
- Adds a `details` hover annotation to the current line annotation, which provides more commit details ([optional](#line-blame-annotation-settings), on by default) - Adds a `details` hover annotation to the current line annotation, which provides more commit details ([optional](#line-blame-annotation-settings), on by default)
- Adds a `changes` (diff) hover annotation to the current line annotation, which provides **instant** access to the line's previous version ([optional](#line-blame-annotation-settings), on by default) - Adds a `changes` (diff) hover annotation to the current line annotation, which provides **instant** access to the line's previous version ([optional](#line-blame-annotation-settings), on by default)
![Line Blame Annotations](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-line-blame-annotations.png) ![Line Blame Annotations](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-line-blame-annotations.png)
- Adds on-demand, beautiful, highly [customizable](#file-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotations** of the whole file - Adds on-demand, beautiful, highly [customizable](#file-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotations** of the whole file
![File Blame Annotation](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-file-blame-annotations.png) ![File Blame Annotation](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-file-blame-annotations.png)
- Choose between `gutter` (default) and `hover` [annotation styles](#file-blame-annotation-settings) - Choose between `gutter` (default) and `hover` [annotation styles](#file-blame-annotation-settings)
- Contains the commit message and date, by [default](#file-blame-annotation-settings) - Contains the commit message and date, by [default](#file-blame-annotation-settings)
- Adds a `details` hover annotation to the line's annotation, which provides more commit details ([optional](#file-blame-annotation-settings), on by default) - Adds a `details` hover annotation to the line's annotation, which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
@@ -37,7 +37,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds [customizable](#status-bar-settings) **blame information** about the current line to the **status bar** ([optional](#status-bar-settings), on by default) - Adds [customizable](#status-bar-settings) **blame information** about the current line to the **status bar** ([optional](#status-bar-settings), on by default)
![Status Bar Blame](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-status-bar.png) ![Status Bar Blame](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-status-bar.png)
- Contains the commit author and date, by [default](#status-bar-settings) - Contains the commit author and date, by [default](#status-bar-settings)
- Clicking the status bar item will, by [default](#status-bar-settings), show a **commit details quick pick menu** with commands for comparing, navigating and exploring commits, and more - Clicking the status bar item will, by [default](#status-bar-settings), show a **commit details quick pick menu** with commands for comparing, navigating and exploring commits, and more
- Provides [customizable](#status-bar-settings) click behavior — choose between one of the following - Provides [customizable](#status-bar-settings) click behavior — choose between one of the following
@@ -70,7 +70,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds **code lens** to the top of the file and on code blocks ([optional](#code-lens-settings), on by default) - Adds **code lens** to the top of the file and on code blocks ([optional](#code-lens-settings), on by default)
![Git Code Lens](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-code-lens.png) ![Git Code Lens](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-code-lens.png)
- **Recent Change** — author and date of the most recent commit for the file or code block - **Recent Change** — author and date of the most recent commit for the file or code block
- Clicking the code lens will, by [default](#code-lens-settings), show a **commit file details quick pick menu** with commands for comparing, navigating and exploring commits, and more - Clicking the code lens will, by [default](#code-lens-settings), show a **commit file details quick pick menu** with commands for comparing, navigating and exploring commits, and more
- **Authors** — number of authors of the file or code block and the most prominent author (if there is more than one) - **Authors** — number of authors of the file or code block and the most prominent author (if there is more than one)
@@ -115,57 +115,41 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- `Repository View` - provides a full repository explorer - `Repository View` - provides a full repository explorer
![GitLens Repository view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-git-custom-view-repository.png) ![GitLens Repository view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-git-custom-view-repository.png)
- `Repository Status` node — provides the status of the repository - `Status` node — provides the status of current branch
- Provides the name of the current branch, its upstream tracking branch (if available), and its upstream status (if available) - Indicates whether or not the current branch is up-to-date with its upstream branch
- Provides indicator dots on the repository icon which denote the following: - If the branch is out of sync, additional nodes will be shown with the specific commits ahead and/or behind the upstream
- `None` - up-to-date with the upstream
- `Green` - ahead of the upstream
- `Red` - behind the upstream
- `Yellow` - both ahead of and behind the upstream
- Provides additional nodes, if the current branch is not synchronized with the upstream, to quickly see and explore the specific commits ahead and/or behind the upstream
- Provides a context menu with `Open Repository in Remote`, and `Refresh` commands
- `Branches` node — provides a list of the local branches - `Branches` node — provides a list of the local branches
- Indicates which branch is the current branch and [optionally](#gitlens-custom-view-settings) shows the remote tracking branch - Indicates which branch is the current branch
- Expand each branch to easily see its revision (commit) history - Expand each branch to easily see its revision (commit) history
- Expand each revision (commit) to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes - Expand each revision (commit) to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes
- Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, and `Show Commit File Details` commands - Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, and `Show Commit File Details` commands
- Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, `Show Commit Details`, and `Refresh` commands - Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, and `Show Commit Details` commands
- Provides a context menu on each branch with `Open Branch in Remote`, and `Refresh` commands - Provides a context menu on each branch with an `Open Branch in Remote` command
- Provides a context menu with `Open Branches in Remote`, and `Refresh` commands
- `Remotes` node — provides a list of remotes - `Remotes` node — provides a list of the remote branches
- Expand each remote to see its list of branches - See `Branches` node above for details
- Expand each branch to easily see its revision (commit) history
- Expand each revision (commit) to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes
- Provides a context menu on each changed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, and `Show Commit File Details` commands
- Provides a context menu on each revision (commit) with `Open Commit in Remote`, `Copy Commit ID to Clipboard`, `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, `Show Commit Details`, and `Refresh` commands
- Provides a context menu on each remote with `Open Branches in Remote`, `Open Repository in Remote`, and `Refresh` commands
- Provides a context menu with a `Refresh` command
- `Stashes` node — provides a list of stashed changes - `Stashes` node — provides a list of stashed changes
- Expand each stash to quickly see the set of files stashed, complete with status indicators for adds, changes, renames, and deletes - Expand each stash to quickly see the set of files stashed, complete with status indicators for adds, changes, renames, and deletes
- Provides a context menu with `Stash Changes`, and `Refresh` commands - Provides a context menu on each stash with `Apply Stashed Changes` (confirmation required), `Delete Stashed Changes` (confirmation required), `Copy Commit Message to Clipboard`, `Open Files`, and `Open Revisions` commands
- Provides a context menu on each stash with `Apply Stashed Changes` (confirmation required), `Delete Stashed Changes` (confirmation required), `Copy Commit Message to Clipboard`, `Open Files`, `Open Revisions`, and `Refresh` commands - Provides a context menu on each stashed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, and `Show File History` commands
- Provides a context menu on each stashed file with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Apply Changes`, and `Show File History` commands
- `History View` - provides the revision history of the active file - `History View` - provides the revision history of the active file
![GitLens History view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-git-custom-view-history.png) ![GitLens History view](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-git-custom-view-history.png)
- Automatically updates to track the active editor - Automatically updates to track the active editor
- Provides a context menu with `Open File`, `Open File in Remote`, and `Refresh` commands - Provides a context menu on each revision (commit) with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, and `Show Commit File Details` commands
- Provides a context menu on each revision (commit) with `Open Changes`, `Open Changes with Working Tree`, `Open File`, `Open Revision`, `Open File in Remote`, `Open Revision in Remote`, `Apply Changes`, and `Show Commit File Details` commands
- Quickly switch between views using the `Switch to Repository View` or `Switch to History View` commands - Quickly switch between views using the `Switch to Repository View` or `Switch to History View` commands
- Provides toolbar commands to `Search Commits`, `Switch to Repository View` or `Switch to History View`, and `Refresh` - Provides toolbar buttons to `Search Commits`, `Switch to Repository View` or `Switch to History View`, and `Refresh`
- Adds a `Search Commits` command (`gitlens.showCommitSearch`) with a shortcut of `alt+/` to search for commits by message, author, file(s), or commit id - Adds a `Search Commits` command (`gitlens.showCommitSearch`) with a shortcut of `alt+/` to search for commits by message, author, file(s), or commit id
- Adds commands to open files, commits, branches, and the repository in the supported remote services, currently **BitBucket, GitHub, GitLab, and Visual Studio Team Services** — only available if a Git upstream service is configured in the repository - Adds commands to open files, commits, branches, and the repository in the supported remote services, currently **BitBucket, GitHub, GitLab, and Visual Studio Team Services** — only available if a Git upstream service is configured in the repository
- `Open Branches in Remote` command (`gitlens.openBranchesInRemote`) — opens the branches in the supported remote service
- `Open Branch in Remote` command (`gitlens.openBranchInRemote`) — opens the current branch commits in the supported remote service - `Open Branch in Remote` command (`gitlens.openBranchInRemote`) — opens the current branch commits in the supported remote service
- `Open Commit in Remote` command (`gitlens.openCommitInRemote`) — opens the commit revision of the active line in the supported remote service - `Open Commit in Remote` command (`gitlens.openCommitInRemote`) — opens the commit revision of the active line in the supported remote service
- `Open File in Remote` command (`gitlens.openFileInRemote`) — opens the active file/revision in the supported remote service - `Open File in Remote` command (`gitlens.openFileInRemote`) — opens the active file/revision in the supported remote service
@@ -173,7 +157,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Show Current Branch History` command (`gitlens.showQuickRepoHistory`) with a shortcut of `shift+alt+h` to show a paged **branch history quick pick menu** of the current branch for exploring its commit history - Adds a `Show Current Branch History` command (`gitlens.showQuickRepoHistory`) with a shortcut of `shift+alt+h` to show a paged **branch history quick pick menu** of the current branch for exploring its commit history
![Branch History Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-branch-history.png) ![Branch History Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-branch-history.png)
- Provides entries to `Show Commit Search` and `Open Branch in <remote-service>` when available - Provides entries to `Show Commit Search` and `Open Branch in <remote-service>` when available
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available - Navigate back to the previous quick pick menu via `alt+left arrow`, if available
@@ -184,7 +168,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Show File History` command (`gitlens.showQuickFileHistory`) to show a paged **file history quick pick menu** of the active file for exploring its commit history - Adds a `Show File History` command (`gitlens.showQuickFileHistory`) to show a paged **file history quick pick menu** of the active file for exploring its commit history
![File History Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-file-history.png) ![File History Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-file-history.png)
- Provides entries to `Show Branch History` and `Open File in <remote-service>` when available - Provides entries to `Show Branch History` and `Open File in <remote-service>` when available
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available - Navigate back to the previous quick pick menu via `alt+left arrow`, if available
@@ -192,7 +176,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Show Commit Details` command (`gitlens.showQuickCommitDetails`) to show a **commit details quick pick menu** of the most recent commit of the active file - Adds a `Show Commit Details` command (`gitlens.showQuickCommitDetails`) to show a **commit details quick pick menu** of the most recent commit of the active file
![Commit Details Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-commit-details.png) ![Commit Details Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-commit-details.png)
- Quickly see the set of files changed in the commit, complete with status indicators for adds, changes, renames, and deletes - Quickly see the set of files changed in the commit, complete with status indicators for adds, changes, renames, and deletes
- Provides entries to `Copy to Clipboard`, `Directory Compare`, `Open Changed Files`, `Open File in <remote-service>` when available, and more - Provides entries to `Copy to Clipboard`, `Directory Compare`, `Open Changed Files`, `Open File in <remote-service>` when available, and more
@@ -202,7 +186,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Show Commit File Details` command (`gitlens.showQuickCommitFileDetails`) with a shortcut of `alt+c` to show a **file commit details quick pick menu** of the most recent commit of the active file - Adds a `Show Commit File Details` command (`gitlens.showQuickCommitFileDetails`) with a shortcut of `alt+c` to show a **file commit details quick pick menu** of the most recent commit of the active file
![Commit File Details Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-commit-file-details.png) ![Commit File Details Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-commit-file-details.png)
- Provides entries to `Show Commit Details`, `Show File History`, `Compare File with...`, `Copy to Clipboard`, `Open File`, `Open File in <remote-service>` when available, and more - Provides entries to `Show Commit Details`, `Show File History`, `Compare File with...`, `Copy to Clipboard`, `Open File`, `Open File in <remote-service>` when available, and more
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available - Navigate back to the previous quick pick menu via `alt+left arrow`, if available
@@ -210,7 +194,7 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Show Repository Status` command (`gitlens.showQuickRepoStatus`) with a shortcut of `alt+s` to show a **repository status quick pick menu** for visualizing the current repository status - Adds a `Show Repository Status` command (`gitlens.showQuickRepoStatus`) with a shortcut of `alt+s` to show a **repository status quick pick menu** for visualizing the current repository status
![Repository Status Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-repo-status.png) ![Repository Status Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-repo-status.png)
- Quickly see upstream status (if an Git upstream is configured) — complete with ahead and behind information - Quickly see upstream status (if an Git upstream is configured) — complete with ahead and behind information
- If you are ahead of the upstream, an entry will be shown with the number of commits ahead. Choosing it will show a limited **branch history quick pick menu** containing just the commits ahead of the upstream - If you are ahead of the upstream, an entry will be shown with the number of commits ahead. Choosing it will show a limited **branch history quick pick menu** containing just the commits ahead of the upstream
@@ -222,14 +206,14 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Show Stashed Changes` command (`gitlens.showQuickStashList`) to show a **stashed changes quick pick menu** for exploring your repository stash history - Adds a `Show Stashed Changes` command (`gitlens.showQuickStashList`) to show a **stashed changes quick pick menu** for exploring your repository stash history
![Stashed Changes Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-stash-list.png) ![Stashed Changes Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-stash-list.png)
- Provides entries to `Stash Changes` - Provides entries to `Stash Changes`
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available - Navigate back to the previous quick pick menu via `alt+left arrow`, if available
- Choosing a stash entry shows a **stash details quick pick menu** which is very similar to the **commit details quick pick menu** above - Choosing a stash entry shows a **stash details quick pick menu** which is very similar to the **commit details quick pick menu** above
![Stash Details Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/develop/images/screenshot-stash-details.png) ![Stash Details Quick Pick Menu](https://raw.githubusercontent.com/eamodio/vscode-gitlens/master/images/screenshot-stash-details.png)
- Quickly see the set of files changed in the stash, complete with status indicators for adds, changes, renames, and deletes - Quickly see the set of files changed in the stash, complete with status indicators for adds, changes, renames, and deletes
- Provides entries to `Copy Message to Clipboard`, `Directory Compare`, and `Open Changed Files` - Provides entries to `Copy Message to Clipboard`, `Directory Compare`, and `Open Changed Files`
@@ -259,7 +243,6 @@ GitLens provides an unobtrusive blame annotation at the end of the current line,
- Adds a `Apply Stashed Changes` command (`gitlens.stashApply`) to chose a stash entry to apply to the working tree from a quick pick menu - Adds a `Apply Stashed Changes` command (`gitlens.stashApply`) to chose a stash entry to apply to the working tree from a quick pick menu
- Adds a `Stash Changes` command (`gitlens.stashSave`) to save any working tree changes to the stash — can optionally provide a stash message - Adds a `Stash Changes` command (`gitlens.stashSave`) to save any working tree changes to the stash — can optionally provide a stash message
- Also adds the command to the Source Control items context menu to stash an individual or group of files, works with multi-select too!
## Insiders ## Insiders
@@ -337,7 +320,6 @@ GitLens is highly customizable and provides many configuration settings to allow
|Name | Description |Name | Description
|-----|------------ |-----|------------
|`gitlens.gitExplorer.view`|Specifies the starting view (mode) of the `GitLens` custom view<br />`history` - shows the commit history of the active file<br />`repository` - shows a repository explorer" |`gitlens.gitExplorer.view`|Specifies the starting view (mode) of the `GitLens` custom view<br />`history` - shows the commit history of the active file<br />`repository` - shows a repository explorer"
|`gitlens.gitExplorer.showTrackingBranch`|Specifies whether or not to show the tracking branch when displaying local branches in the `GitLens` custom view"
|`gitlens.gitExplorer.commitFormat`|Specifies the format of committed changes in the `GitLens` custom view<br />Available tokens<br /> ${id} - commit id<br /> ${author} - commit author<br /> ${message} - commit message<br /> ${ago} - relative commit date (e.g. 1 day ago)<br /> ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br /> ${authorAgo} - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting |`gitlens.gitExplorer.commitFormat`|Specifies the format of committed changes in the `GitLens` custom view<br />Available tokens<br /> ${id} - commit id<br /> ${author} - commit author<br /> ${message} - commit message<br /> ${ago} - relative commit date (e.g. 1 day ago)<br /> ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br /> ${authorAgo} - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|`gitlens.gitExplorer.commitFileFormat`|Specifies the format of a committed file in the `GitLens` custom view<br />Available tokens<br /> ${file} - file name<br /> ${filePath} - file name and path<br /> ${path} - file path |`gitlens.gitExplorer.commitFileFormat`|Specifies the format of a committed file in the `GitLens` custom view<br />Available tokens<br /> ${file} - file name<br /> ${filePath} - file name and path<br /> ${path} - file path
|`gitlens.gitExplorer.stashFormat`|Specifies the format of stashed changes in the `GitLens` custom view<br />Available tokens<br /> ${id} - commit id<br /> ${author} - commit author<br /> ${message} - commit message<br /> ${ago} - relative commit date (e.g. 1 day ago)<br /> ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br /> ${authorAgo} - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting |`gitlens.gitExplorer.stashFormat`|Specifies the format of stashed changes in the `GitLens` custom view<br />Available tokens<br /> ${id} - commit id<br /> ${author} - commit author<br /> ${message} - commit message<br /> ${ago} - relative commit date (e.g. 1 day ago)<br /> ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br /> ${authorAgo} - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#C5C5C5" d="m6,12l-1,0l0,-1l1,0l0,1l0,0zm0,-3l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm8,-1l0,12c0,0.55 -0.45,1 -1,1l-5,0l0,2l-1.5,-1.5l-1.5,1.5l0,-2l-2,0c-0.55,0 -1,-0.45 -1,-1l0,-12c0,-0.55 0.45,-1 1,-1l10,0c0.55,0 1,0.45 1,1l0,0zm-1,10l-10,0l0,2l2,0l0,-1l3,0l0,1l5,0l0,-2l0,0zm0,-10l-9,0l0,9l9,0l0,-9l0,0z" />
<ellipse fill="#32cd32" stroke="#C5C5C5" stroke-width="0.5" rx="3" ry="3" cx="13" cy="4" />
</svg>

Before

Width:  |  Height:  |  Size: 586 B

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#C5C5C5" d="m6,12l-1,0l0,-1l1,0l0,1l0,0zm0,-3l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm8,-1l0,12c0,0.55 -0.45,1 -1,1l-5,0l0,2l-1.5,-1.5l-1.5,1.5l0,-2l-2,0c-0.55,0 -1,-0.45 -1,-1l0,-12c0,-0.55 0.45,-1 1,-1l10,0c0.55,0 1,0.45 1,1l0,0zm-1,10l-10,0l0,2l2,0l0,-1l3,0l0,1l5,0l0,-2l0,0zm0,-10l-9,0l0,9l9,0l0,-9l0,0z" />
<ellipse fill="#cd3131" stroke="#C5C5C5" stroke-width="0.5" rx="3" ry="3" cx="13" cy="4" />
</svg>

Before

Width:  |  Height:  |  Size: 586 B

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#C5C5C5" d="m6,12l-1,0l0,-1l1,0l0,1l0,0zm0,-3l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm8,-1l0,12c0,0.55 -0.45,1 -1,1l-5,0l0,2l-1.5,-1.5l-1.5,1.5l0,-2l-2,0c-0.55,0 -1,-0.45 -1,-1l0,-12c0,-0.55 0.45,-1 1,-1l10,0c0.55,0 1,0.45 1,1l0,0zm-1,10l-10,0l0,2l2,0l0,-1l3,0l0,1l5,0l0,-2l0,0zm0,-10l-9,0l0,9l9,0l0,-9l0,0z" />
<ellipse fill="#cdcd32" stroke="#C5C5C5" stroke-width="0.5" rx="3" ry="3" cx="13" cy="4" />
</svg>

Before

Width:  |  Height:  |  Size: 586 B

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#424242" d="m6,12l-1,0l0,-1l1,0l0,1l0,0zm0,-3l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm8,-1l0,12c0,0.55 -0.45,1 -1,1l-5,0l0,2l-1.5,-1.5l-1.5,1.5l0,-2l-2,0c-0.55,0 -1,-0.45 -1,-1l0,-12c0,-0.55 0.45,-1 1,-1l10,0c0.55,0 1,0.45 1,1l0,0zm-1,10l-10,0l0,2l2,0l0,-1l3,0l0,1l5,0l0,-2l0,0zm0,-10l-9,0l0,9l9,0l0,-9l0,0z" />
<ellipse fill="#32cd32" stroke="#424242" stroke-width="0.5" rx="3" ry="3" cx="13" cy="4" />
</svg>

Before

Width:  |  Height:  |  Size: 586 B

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#424242" d="m6,12l-1,0l0,-1l1,0l0,1l0,0zm0,-3l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm8,-1l0,12c0,0.55 -0.45,1 -1,1l-5,0l0,2l-1.5,-1.5l-1.5,1.5l0,-2l-2,0c-0.55,0 -1,-0.45 -1,-1l0,-12c0,-0.55 0.45,-1 1,-1l10,0c0.55,0 1,0.45 1,1l0,0zm-1,10l-10,0l0,2l2,0l0,-1l3,0l0,1l5,0l0,-2l0,0zm0,-10l-9,0l0,9l9,0l0,-9l0,0z" />
<ellipse fill="#cd3131" stroke="#424242" stroke-width="0.5" rx="3" ry="3" cx="13" cy="4" />
</svg>

Before

Width:  |  Height:  |  Size: 586 B

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path fill="#424242" d="m6,12l-1,0l0,-1l1,0l0,1l0,0zm0,-3l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm0,-2l-1,0l0,1l1,0l0,-1l0,0zm8,-1l0,12c0,0.55 -0.45,1 -1,1l-5,0l0,2l-1.5,-1.5l-1.5,1.5l0,-2l-2,0c-0.55,0 -1,-0.45 -1,-1l0,-12c0,-0.55 0.45,-1 1,-1l10,0c0.55,0 1,0.45 1,1l0,0zm-1,10l-10,0l0,2l2,0l0,-1l3,0l0,1l5,0l0,-2l0,0zm0,-10l-9,0l0,9l9,0l0,-9l0,0z" />
<ellipse fill="#cdcd32" stroke="#424242" stroke-width="0.5" rx="3" ry="3" cx="13" cy="4" />
</svg>

Before

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 25 KiB

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlens", "name": "gitlens",
"version": "5.0.0-alpha.2", "version": "5.0.0-alpha",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "gitlens", "name": "gitlens",
"version": "5.0.0-alpha.2", "version": "5.0.0-alpha",
"author": { "author": {
"name": "Eric Amodio", "name": "Eric Amodio",
"email": "eamodio@gmail.com" "email": "eamodio@gmail.com"
@@ -413,6 +413,15 @@
"default": null, "default": null,
"description": "Specifies how all absolute dates will be formatted by default\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats" "description": "Specifies how all absolute dates will be formatted by default\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats"
}, },
"gitlens.gitExplorer.view": {
"type": "string",
"default": "repository",
"enum": [
"history",
"repository"
],
"description": "Specifies the starting view (mode) of the `GitLens` custom view\n `history` - shows the commit history of the active file\n `repository` - shows a repository explorer"
},
"gitlens.gitExplorer.commitFormat": { "gitlens.gitExplorer.commitFormat": {
"type": "string", "type": "string",
"default": "${message} \u00a0\u2022\u00a0 ${authorAgo} \u00a0\u2022\u00a0 ${id}", "default": "${message} \u00a0\u2022\u00a0 ${authorAgo} \u00a0\u2022\u00a0 ${id}",
@@ -423,11 +432,6 @@
"default": "${filePath}", "default": "${filePath}",
"description": "Specifies the format of a committed file in the `GitLens` custom view\nAvailable tokens\n ${file} - file name\n ${filePath} - file name and path\n ${path} - file path" "description": "Specifies the format of a committed file in the `GitLens` custom view\nAvailable tokens\n ${file} - file name\n ${filePath} - file name and path\n ${path} - file path"
}, },
"gitlens.gitExplorer.showTrackingBranch": {
"type": "boolean",
"default": true,
"description": "Specifies whether or not to show the tracking branch when displaying local branches in the `GitLens` custom view"
},
"gitlens.gitExplorer.stashFormat": { "gitlens.gitExplorer.stashFormat": {
"type": "string", "type": "string",
"default": "${message}", "default": "${message}",
@@ -438,15 +442,6 @@
"default": "${filePath}", "default": "${filePath}",
"description": "Specifies the format of a stashed file in the `GitLens` custom view\nAvailable tokens\n ${file} - file name\n ${filePath} - file name and path\n ${path} - file path" "description": "Specifies the format of a stashed file in the `GitLens` custom view\nAvailable tokens\n ${file} - file name\n ${filePath} - file name and path\n ${path} - file path"
}, },
"gitlens.gitExplorer.view": {
"type": "string",
"default": "repository",
"enum": [
"history",
"repository"
],
"description": "Specifies the starting view (mode) of the `GitLens` custom view\n `history` - shows the commit history of the active file\n `repository` - shows a repository explorer"
},
"gitlens.statusBar.enabled": { "gitlens.statusBar.enabled": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,
@@ -954,11 +949,6 @@
"title": "Open Changed Files", "title": "Open Changed Files",
"category": "GitLens" "category": "GitLens"
}, },
{
"command": "gitlens.openBranchesInRemote",
"title": "Open Branches in Remote",
"category": "GitLens"
},
{ {
"command": "gitlens.openBranchInRemote", "command": "gitlens.openBranchInRemote",
"title": "Open Branch in Remote", "title": "Open Branch in Remote",
@@ -1064,11 +1054,6 @@
"command": "gitlens.gitExplorer.openChangedFileRevisions", "command": "gitlens.gitExplorer.openChangedFileRevisions",
"title": "Open Revisions", "title": "Open Revisions",
"category": "GitLens" "category": "GitLens"
},
{
"command": "gitlens.gitExplorer.applyChanges",
"title": "Apply Changes",
"category": "GitLens"
} }
], ],
"menus": { "menus": {
@@ -1193,10 +1178,6 @@
"command": "gitlens.openChangedFiles", "command": "gitlens.openChangedFiles",
"when": "gitlens:enabled" "when": "gitlens:enabled"
}, },
{
"command": "gitlens.openBranchesInRemote",
"when": "gitlens:hasRemotes"
},
{ {
"command": "gitlens.openBranchInRemote", "command": "gitlens.openBranchInRemote",
"when": "gitlens:hasRemotes" "when": "gitlens:hasRemotes"
@@ -1264,10 +1245,6 @@
{ {
"command": "gitlens.gitExplorer.openChangedFileRevisions", "command": "gitlens.gitExplorer.openChangedFileRevisions",
"when": "false" "when": "false"
},
{
"command": "gitlens.gitExplorer.applyChanges",
"when": "false"
} }
], ],
"editor/context": [ "editor/context": [
@@ -1341,12 +1318,12 @@
}, },
{ {
"command": "gitlens.openFileInRemote", "command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.advanced.menus.editorTitleContext.remote", "when": "gitlens:enabled && config.gitlens.advanced.menus.editorTitleContext.remote",
"group": "1_gitlens" "group": "1_gitlens"
}, },
{ {
"command": "gitlens.openRepoInRemote", "command": "gitlens.openRepoInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.advanced.menus.editorTitleContext.remote", "when": "gitlens:enabled && config.gitlens.advanced.menus.editorTitleContext.remote",
"group": "1_gitlens" "group": "1_gitlens"
}, },
{ {
@@ -1378,7 +1355,7 @@
"editor/title/context": [ "editor/title/context": [
{ {
"command": "gitlens.openFileInRemote", "command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.advanced.menus.editorTitleContext.remote", "when": "gitlens:enabled && config.gitlens.advanced.menus.editorTitleContext.remote",
"group": "1_gitlens" "group": "1_gitlens"
}, },
{ {
@@ -1405,7 +1382,7 @@
"explorer/context": [ "explorer/context": [
{ {
"command": "gitlens.openFileInRemote", "command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && config.gitlens.advanced.menus.explorerContext.remote", "when": "gitlens:enabled && config.gitlens.advanced.menus.explorerContext.remote",
"group": "navigation@100" "group": "navigation@100"
}, },
{ {
@@ -1434,11 +1411,6 @@
"command": "gitlens.closeUnchangedFiles", "command": "gitlens.closeUnchangedFiles",
"when": "gitlens:enabled", "when": "gitlens:enabled",
"group": "1_gitlens@2" "group": "1_gitlens@2"
},
{
"command": "gitlens.stashSave",
"when": "gitlens:enabled",
"group": "2_gitlens@1"
} }
], ],
"scm/resourceState/context": [ "scm/resourceState/context": [
@@ -1456,11 +1428,6 @@
"command": "gitlens.showQuickFileHistory", "command": "gitlens.showQuickFileHistory",
"when": "gitlens:enabled", "when": "gitlens:enabled",
"group": "1_gitlens_1@1" "group": "1_gitlens_1@1"
},
{
"command": "gitlens.stashSave",
"when": "gitlens:enabled",
"group": "2_gitlens@1"
} }
], ],
"view/title": [ "view/title": [
@@ -1486,19 +1453,14 @@
} }
], ],
"view/item/context": [ "view/item/context": [
{
"command": "gitlens.openBranchesInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:branches",
"group": "1_gitlens@1"
},
{ {
"command": "gitlens.openBranchInRemote", "command": "gitlens.openBranchInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:branch-history", "when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:branch-history",
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },
{ {
"command": "gitlens.openCommitInRemote", "command": "gitlens.openCommitInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:commit", "when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:commit",
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },
{ {
@@ -1548,53 +1510,23 @@
}, },
{ {
"command": "gitlens.openFileInRemote", "command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:commit-file", "when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:commit-file",
"group": "3_gitlens@1" "group": "3_gitlens@1"
}, },
{ {
"command": "gitlens.gitExplorer.openFileRevisionInRemote", "command": "gitlens.gitExplorer.openFileRevisionInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:commit-file",
"group": "3_gitlens@2"
},
{
"command": "gitlens.gitExplorer.applyChanges",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:commit-file", "when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:commit-file",
"group": "4_gitlens@1" "group": "3_gitlens@2"
}, },
{ {
"command": "gitlens.showQuickFileHistory", "command": "gitlens.showQuickFileHistory",
"when": "gitlens:isTracked && view == gitlens.gitExplorer && viewItem == gitlens:commit-file && gitlens:gitExplorer:view == repository", "when": "gitlens:isTracked && view == gitlens.gitExplorer && viewItem == gitlens:commit-file && gitlens:gitExplorer:view == repository",
"group": "5_gitlens@1" "group": "4_gitlens@1"
}, },
{ {
"command": "gitlens.showQuickCommitFileDetails", "command": "gitlens.showQuickCommitFileDetails",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:commit-file", "when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:commit-file",
"group": "5_gitlens@2" "group": "4_gitlens@2"
},
{
"command": "gitlens.gitExplorer.openFile",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:file-history",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:file-history",
"group": "1_gitlens@2"
},
{
"command": "gitlens.openBranchesInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:remote",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openRepoInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:remote",
"group": "1_gitlens@2"
},
{
"command": "gitlens.stashSave",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:stashes",
"group": "1_gitlens@1"
}, },
{ {
"command": "gitlens.stashApply", "command": "gitlens.stashApply",
@@ -1643,28 +1575,13 @@
}, },
{ {
"command": "gitlens.openFileInRemote", "command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:stash-file",
"group": "3_gitlens@1"
},
{
"command": "gitlens.gitExplorer.applyChanges",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:stash-file", "when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == gitlens:stash-file",
"group": "4_gitlens@1" "group": "3_gitlens@1"
}, },
{ {
"command": "gitlens.showQuickFileHistory", "command": "gitlens.showQuickFileHistory",
"when": "gitlens:isTracked && view == gitlens.gitExplorer && viewItem == gitlens:stash-file", "when": "gitlens:isTracked && view == gitlens.gitExplorer && viewItem == gitlens:stash-file",
"group": "5_gitlens@1" "group": "4_gitlens@1"
},
{
"command": "gitlens.openRepoInRemote",
"when": "gitlens:enabled && gitlens:hasRemotes && view == gitlens.gitExplorer && viewItem == gitlens:status",
"group": "1_gitlens@1"
},
{
"command": "gitlens.gitExplorer.refresh",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem != gitlens:commit-file && viewItem != gitlens:stash-file",
"group": "9_gitlens@1"
} }
] ]
}, },

View File

@@ -14,7 +14,6 @@ export * from './commands/diffWithPrevious';
export * from './commands/diffWithRevision'; export * from './commands/diffWithRevision';
export * from './commands/diffWithWorking'; export * from './commands/diffWithWorking';
export * from './commands/openChangedFiles'; export * from './commands/openChangedFiles';
export * from './commands/openBranchesInRemote';
export * from './commands/openBranchInRemote'; export * from './commands/openBranchInRemote';
export * from './commands/openCommitInRemote'; export * from './commands/openCommitInRemote';
export * from './commands/openFileInRemote'; export * from './commands/openFileInRemote';

View File

@@ -1,7 +1,7 @@
'use strict'; 'use strict';
import { commands, Disposable, SourceControlResourceGroup, SourceControlResourceState, TextDocumentShowOptions, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode'; import { commands, Disposable, SourceControlResourceGroup, SourceControlResourceState, TextDocumentShowOptions, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
import { ExplorerNode } from '../views/explorerNodes'; import { ExplorerNode } from '../views/explorerNodes';
import { GitBranch, GitCommit, GitRemote } from '../gitService'; import { GitBranch, GitCommit } from '../gitService';
import { Logger } from '../logger'; import { Logger } from '../logger';
import { Telemetry } from '../telemetry'; import { Telemetry } from '../telemetry';
@@ -19,7 +19,6 @@ export type Commands =
'gitlens.diffWithWorking' | 'gitlens.diffWithWorking' |
'gitlens.diffLineWithWorking' | 'gitlens.diffLineWithWorking' |
'gitlens.openChangedFiles' | 'gitlens.openChangedFiles' |
'gitlens.openBranchesInRemote' |
'gitlens.openBranchInRemote' | 'gitlens.openBranchInRemote' |
'gitlens.openCommitInRemote' | 'gitlens.openCommitInRemote' |
'gitlens.openFileInRemote' | 'gitlens.openFileInRemote' |
@@ -60,7 +59,6 @@ export const Commands = {
DiffWithWorking: 'gitlens.diffWithWorking' as Commands, DiffWithWorking: 'gitlens.diffWithWorking' as Commands,
DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands, DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands,
OpenChangedFiles: 'gitlens.openChangedFiles' as Commands, OpenChangedFiles: 'gitlens.openChangedFiles' as Commands,
OpenBranchesInRemote: 'gitlens.openBranchesInRemote' as Commands,
OpenBranchInRemote: 'gitlens.openBranchInRemote' as Commands, OpenBranchInRemote: 'gitlens.openBranchInRemote' as Commands,
OpenCommitInRemote: 'gitlens.openCommitInRemote' as Commands, OpenCommitInRemote: 'gitlens.openCommitInRemote' as Commands,
OpenFileInRemote: 'gitlens.openFileInRemote' as Commands, OpenFileInRemote: 'gitlens.openFileInRemote' as Commands,
@@ -140,10 +138,6 @@ export function isCommandViewContextWithCommit<T extends GitCommit>(context: Com
return context.type === 'view' && (context.node as any).commit && (context.node as any).commit instanceof GitCommit; return context.type === 'view' && (context.node as any).commit && (context.node as any).commit instanceof GitCommit;
} }
export function isCommandViewContextWithRemote(context: CommandContext): context is CommandViewContext & { node: (ExplorerNode & { remote: GitRemote }) } {
return context.type === 'view' && (context.node as any).remote && (context.node as any).remote instanceof GitRemote;
}
export type CommandContext = CommandScmGroupsContext | CommandScmStatesContext | CommandUnknownContext | CommandUriContext | CommandViewContext; export type CommandContext = CommandScmGroupsContext | CommandScmStatesContext | CommandUnknownContext | CommandUriContext | CommandViewContext;
function isScmResourceGroup(group: any): group is SourceControlResourceGroup { function isScmResourceGroup(group: any): group is SourceControlResourceGroup {

View File

@@ -10,7 +10,6 @@ import { OpenInRemoteCommandArgs } from './openInRemote';
export interface OpenBranchInRemoteCommandArgs { export interface OpenBranchInRemoteCommandArgs {
branch?: string; branch?: string;
remote?: string;
} }
export class OpenBranchInRemoteCommand extends ActiveEditorCommand { export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
@@ -22,9 +21,7 @@ export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
protected async preExecute(context: CommandContext, args: OpenBranchInRemoteCommandArgs = {}): Promise<any> { protected async preExecute(context: CommandContext, args: OpenBranchInRemoteCommandArgs = {}): Promise<any> {
if (isCommandViewContextWithBranch(context)) { if (isCommandViewContextWithBranch(context)) {
args = { ...args }; args = { ...args };
args.branch = context.node.branch.name; args.branch = context.node.branch.name;
args.remote = context.node.branch.getRemote();
return this.execute(context.editor, context.uri, args); return this.execute(context.editor, context.uri, args);
} }
@@ -60,7 +57,6 @@ export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
type: 'branch', type: 'branch',
branch: args.branch branch: args.branch
}, },
remote: args.remote,
remotes remotes
} as OpenInRemoteCommandArgs); } as OpenInRemoteCommandArgs);
} }

View File

@@ -1,53 +0,0 @@
'use strict';
import { Arrays } from '../system';
import { commands, TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithRemote } from './common';
import { GitService, GitUri } from '../gitService';
import { Logger } from '../logger';
import { OpenInRemoteCommandArgs } from './openInRemote';
export interface OpenBranchesInRemoteCommandArgs {
remote?: string;
}
export class OpenBranchesInRemoteCommand extends ActiveEditorCommand {
constructor(private git: GitService) {
super(Commands.OpenBranchesInRemote);
}
protected async preExecute(context: CommandContext, args: OpenBranchesInRemoteCommandArgs = {}): Promise<any> {
if (isCommandViewContextWithRemote(context)) {
args = { ...args };
args.remote = context.node.remote.name;
return this.execute(context.editor, context.uri, args);
}
return this.execute(context.editor, context.uri, args);
}
async execute(editor?: TextEditor, uri?: Uri, args: OpenBranchesInRemoteCommandArgs = {}) {
uri = getCommandUri(uri, editor);
const gitUri = uri && await GitUri.fromUri(uri, this.git);
const repoPath = gitUri === undefined ? this.git.repoPath : gitUri.repoPath;
if (!repoPath) return undefined;
try {
const remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), r => r.url, r => !!r.provider);
return commands.executeCommand(Commands.OpenInRemote, uri, {
resource: {
type: 'branches'
},
remote: args.remote,
remotes
} as OpenInRemoteCommandArgs);
}
catch (ex) {
Logger.error(ex, 'OpenBranchesInRemoteCommand');
return window.showErrorMessage(`Unable to open branches in remote provider. See output channel for more details`);
}
}
}

View File

@@ -8,7 +8,6 @@ import { Logger } from '../logger';
import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks'; import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks';
export interface OpenInRemoteCommandArgs { export interface OpenInRemoteCommandArgs {
remote?: string;
remotes?: GitRemote[]; remotes?: GitRemote[];
resource?: RemoteResource; resource?: RemoteResource;
@@ -27,14 +26,6 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
args = { ...args }; args = { ...args };
if (args.remotes === undefined || args.resource === undefined) return undefined; if (args.remotes === undefined || args.resource === undefined) return undefined;
if (args.remote !== undefined) {
const remotes = args.remotes.filter(r => r.name === args.remote);
// Only filter if we get some results
if (remotes.length > 0) {
args.remotes = remotes;
}
}
try { try {
if (args.remotes.length === 1) { if (args.remotes.length === 1) {
this.ensureRemoteBranchName(args); this.ensureRemoteBranchName(args);

View File

@@ -1,32 +1,18 @@
'use strict'; 'use strict';
import { Arrays } from '../system'; import { Arrays } from '../system';
import { commands, TextEditor, Uri, window } from 'vscode'; import { commands, TextEditor, Uri, window } from 'vscode';
import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithRemote } from './common'; import { ActiveEditorCommand, Commands, getCommandUri } from './common';
import { GitService, GitUri } from '../gitService'; import { GitService, GitUri } from '../gitService';
import { Logger } from '../logger'; import { Logger } from '../logger';
import { OpenInRemoteCommandArgs } from './openInRemote'; import { OpenInRemoteCommandArgs } from './openInRemote';
export interface OpenRepoInRemoteCommandArgs {
remote?: string;
}
export class OpenRepoInRemoteCommand extends ActiveEditorCommand { export class OpenRepoInRemoteCommand extends ActiveEditorCommand {
constructor(private git: GitService) { constructor(private git: GitService) {
super(Commands.OpenRepoInRemote); super(Commands.OpenRepoInRemote);
} }
protected async preExecute(context: CommandContext, args: OpenRepoInRemoteCommandArgs = {}): Promise<any> { async execute(editor?: TextEditor, uri?: Uri) {
if (isCommandViewContextWithRemote(context)) {
args = { ...args };
args.remote = context.node.remote.name;
return this.execute(context.editor, context.uri, args);
}
return this.execute(context.editor, context.uri, args);
}
async execute(editor?: TextEditor, uri?: Uri, args: OpenRepoInRemoteCommandArgs = {}) {
uri = getCommandUri(uri, editor); uri = getCommandUri(uri, editor);
const gitUri = uri && await GitUri.fromUri(uri, this.git); const gitUri = uri && await GitUri.fromUri(uri, this.git);
@@ -35,13 +21,11 @@ export class OpenRepoInRemoteCommand extends ActiveEditorCommand {
if (!repoPath) return undefined; if (!repoPath) return undefined;
try { try {
const remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), r => r.url, r => !!r.provider); const remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), _ => _.url, _ => !!_.provider);
return commands.executeCommand(Commands.OpenInRemote, uri, { return commands.executeCommand(Commands.OpenInRemote, uri, {
resource: { resource: {
type: 'repo' type: 'repo'
}, },
remote: args.remote,
remotes remotes
} as OpenInRemoteCommandArgs); } as OpenInRemoteCommandArgs);
} }

View File

@@ -1,14 +1,13 @@
'use strict'; 'use strict';
import { InputBoxOptions, Uri, window } from 'vscode'; import { InputBoxOptions, window } from 'vscode';
import { GitService } from '../gitService'; import { GitService } from '../gitService';
import { CommandContext } from '../commands';
import { Command, Commands } from './common'; import { Command, Commands } from './common';
import { Logger } from '../logger'; import { Logger } from '../logger';
import { CommandQuickPickItem } from '../quickPicks'; import { CommandQuickPickItem } from '../quickPicks';
export interface StashSaveCommandArgs { export interface StashSaveCommandArgs {
message?: string; message?: string;
uris?: Uri[]; unstagedOnly?: boolean;
goBackCommand?: CommandQuickPickItem; goBackCommand?: CommandQuickPickItem;
} }
@@ -19,28 +18,16 @@ export class StashSaveCommand extends Command {
super(Commands.StashSave); super(Commands.StashSave);
} }
protected async preExecute(context: CommandContext, args: StashSaveCommandArgs = {}): Promise<any> { async execute(args: StashSaveCommandArgs = { unstagedOnly: false }) {
if (context.type === 'scm-states') {
args = { ...args };
args.uris = context.scmResourceStates.map(s => s.resourceUri);
return this.execute(args);
}
if (context.type === 'scm-groups') {
args = { ...args };
args.uris = context.scmResourceGroups.reduce<Uri[]>((a, b) => a.concat(b.resourceStates.map(s => s.resourceUri)), []);
return this.execute(args);
}
return this.execute(args);
}
async execute(args: StashSaveCommandArgs = { }) {
if (!this.git.repoPath) return undefined; if (!this.git.repoPath) return undefined;
args = { ...args };
if (args.unstagedOnly === undefined) {
args.unstagedOnly = false;
}
try { try {
if (args.message == null) { if (args.message == null) {
args = { ...args };
args.message = await window.showInputBox({ args.message = await window.showInputBox({
prompt: `Please provide a stash message`, prompt: `Please provide a stash message`,
placeHolder: `Stash message` placeHolder: `Stash message`
@@ -48,7 +35,7 @@ export class StashSaveCommand extends Command {
if (args.message === undefined) return args.goBackCommand === undefined ? undefined : args.goBackCommand.execute(); if (args.message === undefined) return args.goBackCommand === undefined ? undefined : args.goBackCommand.execute();
} }
return await this.git.stashSave(this.git.repoPath, args.message, args.uris); return await this.git.stashSave(this.git.repoPath, args.message, args.unstagedOnly);
} }
catch (ex) { catch (ex) {
Logger.error(ex, 'StashSaveCommand'); Logger.error(ex, 'StashSaveCommand');

View File

@@ -299,7 +299,6 @@ export interface IConfig {
gitExplorer: { gitExplorer: {
view: GitExplorerView; view: GitExplorerView;
showTrackingBranch: boolean;
commitFormat: string; commitFormat: string;
commitFileFormat: string; commitFileFormat: string;
stashFormat: string; stashFormat: string;

View File

@@ -3,7 +3,7 @@
import { commands, ExtensionContext, extensions, languages, window, workspace } from 'vscode'; import { commands, ExtensionContext, extensions, languages, window, workspace } from 'vscode';
import { AnnotationController } from './annotations/annotationController'; import { AnnotationController } from './annotations/annotationController';
import { CloseUnchangedFilesCommand, OpenChangedFilesCommand } from './commands'; import { CloseUnchangedFilesCommand, OpenChangedFilesCommand } from './commands';
import { OpenBranchesInRemoteCommand, OpenBranchInRemoteCommand, OpenCommitInRemoteCommand, OpenFileInRemoteCommand, OpenInRemoteCommand, OpenRepoInRemoteCommand } from './commands'; import { OpenBranchInRemoteCommand, OpenCommitInRemoteCommand, OpenFileInRemoteCommand, OpenInRemoteCommand, OpenRepoInRemoteCommand } from './commands';
import { CopyMessageToClipboardCommand, CopyShaToClipboardCommand } from './commands'; import { CopyMessageToClipboardCommand, CopyShaToClipboardCommand } from './commands';
import { DiffDirectoryCommand, DiffLineWithPreviousCommand, DiffLineWithWorkingCommand, DiffWithBranchCommand, DiffWithNextCommand, DiffWithPreviousCommand, DiffWithRevisionCommand, DiffWithWorkingCommand } from './commands'; import { DiffDirectoryCommand, DiffLineWithPreviousCommand, DiffLineWithWorkingCommand, DiffWithBranchCommand, DiffWithNextCommand, DiffWithPreviousCommand, DiffWithRevisionCommand, DiffWithWorkingCommand } from './commands';
import { ResetSuppressedWarningsCommand } from './commands'; import { ResetSuppressedWarningsCommand } from './commands';
@@ -108,7 +108,6 @@ export async function activate(context: ExtensionContext) {
context.subscriptions.push(new DiffWithPreviousCommand(git)); context.subscriptions.push(new DiffWithPreviousCommand(git));
context.subscriptions.push(new DiffWithRevisionCommand(git)); context.subscriptions.push(new DiffWithRevisionCommand(git));
context.subscriptions.push(new DiffWithWorkingCommand(git)); context.subscriptions.push(new DiffWithWorkingCommand(git));
context.subscriptions.push(new OpenBranchesInRemoteCommand(git));
context.subscriptions.push(new OpenBranchInRemoteCommand(git)); context.subscriptions.push(new OpenBranchInRemoteCommand(git));
context.subscriptions.push(new OpenCommitInRemoteCommand(git)); context.subscriptions.push(new OpenCommitInRemoteCommand(git));
context.subscriptions.push(new OpenFileInRemoteCommand(git)); context.subscriptions.push(new OpenFileInRemoteCommand(git));

View File

@@ -10,7 +10,6 @@ import * as iconv from 'iconv-lite';
export { IGit }; export { IGit };
export * from './models/models'; export * from './models/models';
export * from './parsers/blameParser'; export * from './parsers/blameParser';
export * from './parsers/branchParser';
export * from './parsers/diffParser'; export * from './parsers/diffParser';
export * from './parsers/logParser'; export * from './parsers/logParser';
export * from './parsers/stashParser'; export * from './parsers/stashParser';
@@ -34,11 +33,10 @@ const GitWarnings = [
/no such path/, /no such path/,
/does not have any commits/, /does not have any commits/,
/Path \'.*?\' does not exist in/, /Path \'.*?\' does not exist in/,
/Path \'.*?\' exists on disk, but not in/, /Path \'.*?\' exists on disk, but not in/
/no upstream configured for branch/
]; ];
async function gitCommand(options: { cwd: string, encoding?: string, onError?: (ex: Error) => string | undefined }, ...args: any[]) { async function gitCommand(options: { cwd: string, encoding?: string }, ...args: any[]) {
try { try {
// Fixes https://github.com/eamodio/vscode-gitlens/issues/73 // Fixes https://github.com/eamodio/vscode-gitlens/issues/73
// See https://stackoverflow.com/questions/4144417/how-to-handle-asian-characters-in-file-names-in-git-on-os-x // See https://stackoverflow.com/questions/4144417/how-to-handle-asian-characters-in-file-names-in-git-on-os-x
@@ -52,11 +50,6 @@ async function gitCommand(options: { cwd: string, encoding?: string, onError?: (
return iconv.decode(Buffer.from(s, 'binary'), opts.encoding); return iconv.decode(Buffer.from(s, 'binary'), opts.encoding);
} }
catch (ex) { catch (ex) {
if (options.onError !== undefined) {
const result = options.onError(ex);
if (result !== undefined) return result;
}
const msg = ex && ex.toString(); const msg = ex && ex.toString();
if (msg) { if (msg) {
for (const warning of GitWarnings) { for (const warning of GitWarnings) {
@@ -175,33 +168,15 @@ export class Git {
return gitCommand({ cwd: root }, ...params, `--`, file); return gitCommand({ cwd: root }, ...params, `--`, file);
} }
static branch(repoPath: string, options: { all: boolean } = { all: false }) { static branch(repoPath: string, all: boolean) {
const params = [`branch`, `-vv`]; const params = [`branch`];
if (options.all) { if (all) {
params.push(`-a`); params.push(`-a`);
} }
return gitCommand({ cwd: repoPath }, ...params); return gitCommand({ cwd: repoPath }, ...params);
} }
static branch_current(repoPath: string) {
const params = [`rev-parse`, `--abbrev-ref`, `--symbolic-full-name`, `@`, `@{u}`];
const onError = (ex: Error) => {
if (/no upstream configured for branch/.test(ex && ex.toString())) {
return ex.message.split('\n')[0];
}
return undefined;
};
return gitCommand({ cwd: repoPath, onError: onError }, ...params);
}
static checkout(repoPath: string, fileName: string, sha: string) {
const [file, root] = Git.splitPath(fileName, repoPath);
return gitCommand({ cwd: root }, `checkout`, sha, `--`, file);
}
static async config_get(key: string, repoPath?: string) { static async config_get(key: string, repoPath?: string) {
try { try {
return await gitCommand({ cwd: repoPath || '' }, `config`, `--get`, key); return await gitCommand({ cwd: repoPath || '' }, `config`, `--get`, key);
@@ -347,18 +322,11 @@ export class Git {
return gitCommand({ cwd: repoPath }, ...defaultStashParams); return gitCommand({ cwd: repoPath }, ...defaultStashParams);
} }
static stash_push(repoPath: string, pathspecs: string[], message?: string) { static stash_save(repoPath: string, message?: string, unstagedOnly: boolean = false) {
const params = [`stash`, `push`, `-u`]; const params = [`stash`, `save`, `--include-untracked`];
if (message) { if (unstagedOnly) {
params.push(`-m`); params.push(`--keep-index`);
params.push(message);
} }
params.splice(params.length, 0, `--`, ...pathspecs);
return gitCommand({ cwd: repoPath }, ...params);
}
static stash_save(repoPath: string, message?: string) {
const params = [`stash`, `save`, `-u`];
if (message) { if (message) {
params.push(message); params.push(message);
} }

View File

@@ -5,9 +5,15 @@ export class GitBranch {
current: boolean; current: boolean;
name: string; name: string;
remote: boolean; remote: boolean;
tracking?: string;
constructor(public readonly repoPath: string, branch: string, current: boolean = false, tracking?: string) { constructor(branch: string) {
branch = branch.trim();
if (branch.startsWith('* ')) {
branch = branch.substring(2);
this.current = true;
}
if (branch.startsWith('remotes/')) { if (branch.startsWith('remotes/')) {
branch = branch.substring(8); branch = branch.substring(8);
this.remote = true; this.remote = true;
@@ -18,24 +24,6 @@ export class GitBranch {
branch = branch.substring(0, index); branch = branch.substring(0, index);
} }
this.current = current;
this.name = branch; this.name = branch;
this.tracking = tracking;
}
getName(): string {
return this.remote
? this.name.substring(this.name.indexOf('/') + 1)
: this.name;
}
getRemote(): string | undefined {
if (this.remote) return GitBranch.getRemote(this.name);
if (this.tracking !== undefined) return GitBranch.getRemote(this.tracking);
return undefined;
}
static getRemote(branch: string): string {
return branch.substring(0, branch.indexOf('/'));
} }
} }

View File

@@ -1,24 +0,0 @@
'use strict';
import { GitBranch } from './../git';
const branchWithTrackingRegex = /^(\*?)\s+(.+?)\s+([0-9,a-f]+)\s+(?:\[(.*?\/.*?)(?:\:|\]))?/gm;
export class GitBranchParser {
static parse(data: string, repoPath: string): GitBranch[] | undefined {
if (!data) return undefined;
const branches: GitBranch[] = [];
let match: RegExpExecArray | null = null;
do {
match = branchWithTrackingRegex.exec(data);
if (match == null) break;
branches.push(new GitBranch(repoPath, match[2], match[1] === '*', match[4]));
} while (match != null);
if (!branches.length) return undefined;
return branches;
}
}

View File

@@ -12,10 +12,6 @@ export class BitbucketService extends RemoteProvider {
return 'Bitbucket'; return 'Bitbucket';
} }
protected getUrlForBranches(): string {
return `${this.baseUrl}/branches`;
}
protected getUrlForBranch(branch: string): string { protected getUrlForBranch(branch: string): string {
return `${this.baseUrl}/commits/branch/${branch}`; return `${this.baseUrl}/commits/branch/${branch}`;
} }

View File

@@ -12,10 +12,6 @@ export class GitHubService extends RemoteProvider {
return 'GitHub'; return 'GitHub';
} }
protected getUrlForBranches(): string {
return `${this.baseUrl}/branches`;
}
protected getUrlForBranch(branch: string): string { protected getUrlForBranch(branch: string): string {
return `${this.baseUrl}/commits/${branch}`; return `${this.baseUrl}/commits/${branch}`;
} }

View File

@@ -3,10 +3,9 @@ import { commands, Range, Uri } from 'vscode';
import { BuiltInCommands } from '../../constants'; import { BuiltInCommands } from '../../constants';
import { GitLogCommit } from '../../gitService'; import { GitLogCommit } from '../../gitService';
export type RemoteResourceType = 'branch' | 'branches' | 'commit' | 'file' | 'repo' | 'revision'; export type RemoteResourceType = 'branch' | 'commit' | 'file' | 'repo' | 'revision';
export type RemoteResource = export type RemoteResource =
{ type: 'branch', branch: string } | { type: 'branch', branch: string } |
{ type: 'branches' } |
{ type: 'commit', sha: string } | { type: 'commit', sha: string } |
{ type: 'file', branch?: string, fileName: string, range?: Range } | { type: 'file', branch?: string, fileName: string, range?: Range } |
{ type: 'repo' } | { type: 'repo' } |
@@ -15,7 +14,6 @@ export type RemoteResource =
export function getNameFromRemoteResource(resource: RemoteResource) { export function getNameFromRemoteResource(resource: RemoteResource) {
switch (resource.type) { switch (resource.type) {
case 'branch': return 'Branch'; case 'branch': return 'Branch';
case 'branches': return 'Branches';
case 'commit': return 'Commit'; case 'commit': return 'Commit';
case 'file': return 'File'; case 'file': return 'File';
case 'repo': return 'Repository'; case 'repo': return 'Repository';
@@ -34,7 +32,6 @@ export abstract class RemoteProvider {
return `https://${this.domain}/${this.path}`; return `https://${this.domain}/${this.path}`;
} }
protected abstract getUrlForBranches(): string;
protected abstract getUrlForBranch(branch: string): string; protected abstract getUrlForBranch(branch: string): string;
protected abstract getUrlForCommit(sha: string): string; protected abstract getUrlForCommit(sha: string): string;
protected abstract getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string; protected abstract getUrlForFile(fileName: string, branch?: string, sha?: string, range?: Range): string;
@@ -48,7 +45,6 @@ export abstract class RemoteProvider {
open(resource: RemoteResource): Promise<{} | undefined> { open(resource: RemoteResource): Promise<{} | undefined> {
switch (resource.type) { switch (resource.type) {
case 'branch': return this.openBranch(resource.branch); case 'branch': return this.openBranch(resource.branch);
case 'branches': return this.openBranches();
case 'commit': return this.openCommit(resource.sha); case 'commit': return this.openCommit(resource.sha);
case 'file': return this.openFile(resource.fileName, resource.branch, undefined, resource.range); case 'file': return this.openFile(resource.fileName, resource.branch, undefined, resource.range);
case 'repo': return this.openRepo(); case 'repo': return this.openRepo();
@@ -60,10 +56,6 @@ export abstract class RemoteProvider {
return this._openUrl(this.baseUrl); return this._openUrl(this.baseUrl);
} }
openBranches() {
return this._openUrl(this.getUrlForBranches());
}
openBranch(branch: string) { openBranch(branch: string) {
return this._openUrl(this.getUrlForBranch(branch)); return this._openUrl(this.getUrlForBranch(branch));
} }

View File

@@ -12,10 +12,6 @@ export class VisualStudioService extends RemoteProvider {
return 'Visual Studio Team Services'; return 'Visual Studio Team Services';
} }
protected getUrlForBranches(): string {
return `${this.baseUrl}/branches`;
}
protected getUrlForBranch(branch: string): string { protected getUrlForBranch(branch: string): string {
return `${this.baseUrl}/?version=GB${branch}&_a=history`; return `${this.baseUrl}/?version=GB${branch}&_a=history`;
} }

View File

@@ -3,7 +3,7 @@ import { Functions, Iterables, Objects } from './system';
import { Disposable, Event, EventEmitter, FileSystemWatcher, Location, Position, Range, TextDocument, TextDocumentChangeEvent, TextEditor, Uri, workspace } from 'vscode'; import { Disposable, Event, EventEmitter, FileSystemWatcher, Location, Position, Range, TextDocument, TextDocumentChangeEvent, TextEditor, Uri, workspace } from 'vscode';
import { IConfig } from './configuration'; import { IConfig } from './configuration';
import { DocumentSchemes, ExtensionKey, GlyphChars } from './constants'; import { DocumentSchemes, ExtensionKey, GlyphChars } from './constants';
import { Git, GitAuthor, GitBlame, GitBlameCommit, GitBlameLine, GitBlameLines, GitBlameParser, GitBranch, GitBranchParser, GitCommit, GitDiff, GitDiffChunkLine, GitDiffParser, GitLog, GitLogCommit, GitLogParser, GitRemote, GitStash, GitStashParser, GitStatus, GitStatusFile, GitStatusParser, IGit, setDefaultEncoding } from './git/git'; import { Git, GitAuthor, GitBlame, GitBlameCommit, GitBlameLine, GitBlameLines, GitBlameParser, GitBranch, GitCommit, GitDiff, GitDiffChunkLine, GitDiffParser, GitLog, GitLogCommit, GitLogParser, GitRemote, GitStash, GitStashParser, GitStatus, GitStatusFile, GitStatusParser, IGit, setDefaultEncoding } from './git/git';
import { GitUri, IGitCommitInfo, IGitUriData } from './git/gitUri'; import { GitUri, IGitCommitInfo, IGitUriData } from './git/gitUri';
import { Logger } from './logger'; import { Logger } from './logger';
import * as fs from 'fs'; import * as fs from 'fs';
@@ -64,11 +64,7 @@ export const GitRepoSearchBy = {
Sha: 'sha' as GitRepoSearchBy Sha: 'sha' as GitRepoSearchBy
}; };
export type RepoChangedReasons = 'stash' | 'unknown'; type RepoChangedReasons = 'stash' | 'unknown';
export const RepoChangedReasons = {
Stash: 'stash' as RepoChangedReasons,
Unknown: 'unknown' as RepoChangedReasons
};
export class GitService extends Disposable { export class GitService extends Disposable {
@@ -281,13 +277,6 @@ export class GitService extends Disposable {
} }
} }
checkoutFile(uri: GitUri, sha?: string) {
sha = sha || uri.sha;
Logger.log(`checkoutFile('${uri.repoPath}', '${uri.fsPath}', ${sha})`);
return Git.checkout(uri.repoPath!, uri.fsPath, sha!);
}
private async _fileExists(repoPath: string, fileName: string): Promise<boolean> { private async _fileExists(repoPath: string, fileName: string): Promise<boolean> {
return await new Promise<boolean>((resolve, reject) => fs.exists(path.resolve(repoPath, fileName), resolve)); return await new Promise<boolean>((resolve, reject) => fs.exists(path.resolve(repoPath, fileName), resolve));
} }
@@ -572,16 +561,17 @@ export class GitService extends Disposable {
async getBranch(repoPath: string): Promise<GitBranch | undefined> { async getBranch(repoPath: string): Promise<GitBranch | undefined> {
Logger.log(`getBranch('${repoPath}')`); Logger.log(`getBranch('${repoPath}')`);
const data = await Git.branch_current(repoPath); const data = await Git.branch(repoPath, false);
const branch = data.split('\n'); const branches = data.split('\n').filter(_ => !!_).map(_ => new GitBranch(_));
return new GitBranch(repoPath, branch[0], true, branch[1]); return branches.find(_ => _.current);
} }
async getBranches(repoPath: string): Promise<GitBranch[]> { async getBranches(repoPath: string): Promise<GitBranch[]> {
Logger.log(`getBranches('${repoPath}')`); Logger.log(`getBranches('${repoPath}')`);
const data = await Git.branch(repoPath, { all: true }); const data = await Git.branch(repoPath, true);
return GitBranchParser.parse(data, repoPath) || []; const branches = data.split('\n').filter(_ => !!_).map(_ => new GitBranch(_));
return branches;
} }
getCacheEntryKey(fileName: string): string; getCacheEntryKey(fileName: string): string;
@@ -1024,12 +1014,10 @@ export class GitService extends Disposable {
return Git.stash_delete(repoPath, stashName); return Git.stash_delete(repoPath, stashName);
} }
stashSave(repoPath: string, message?: string, uris?: Uri[]) { stashSave(repoPath: string, message?: string, unstagedOnly: boolean = false) {
Logger.log(`stashSave('${repoPath}', ${message}, ${uris})`); Logger.log(`stashSave('${repoPath}', ${message}, ${unstagedOnly})`);
if (uris === undefined) return Git.stash_save(repoPath, message); return Git.stash_save(repoPath, message, unstagedOnly);
const pathspecs = uris.map(u => Git.splitPath(u.fsPath, repoPath)[0]);
return Git.stash_push(repoPath, pathspecs, message);
} }
static getGitPath(gitPath?: string): Promise<IGit> { static getGitPath(gitPath?: string): Promise<IGit> {

View File

@@ -11,8 +11,7 @@ export type SuppressedKeys = 'suppressCommitHasNoPreviousCommitWarning' |
'suppressGitVersionWarning' | 'suppressGitVersionWarning' |
'suppressLineUncommittedWarning' | 'suppressLineUncommittedWarning' |
'suppressNoRepositoryWarning' | 'suppressNoRepositoryWarning' |
'suppressUpdateNotice' | 'suppressUpdateNotice';
'suppressWelcomeNotice';
export const SuppressedKeys = { export const SuppressedKeys = {
CommitHasNoPreviousCommitWarning: 'suppressCommitHasNoPreviousCommitWarning' as SuppressedKeys, CommitHasNoPreviousCommitWarning: 'suppressCommitHasNoPreviousCommitWarning' as SuppressedKeys,
CommitNotFoundWarning: 'suppressCommitNotFoundWarning' as SuppressedKeys, CommitNotFoundWarning: 'suppressCommitNotFoundWarning' as SuppressedKeys,
@@ -20,8 +19,7 @@ export const SuppressedKeys = {
GitVersionWarning: 'suppressGitVersionWarning' as SuppressedKeys, GitVersionWarning: 'suppressGitVersionWarning' as SuppressedKeys,
LineUncommittedWarning: 'suppressLineUncommittedWarning' as SuppressedKeys, LineUncommittedWarning: 'suppressLineUncommittedWarning' as SuppressedKeys,
NoRepositoryWarning: 'suppressNoRepositoryWarning' as SuppressedKeys, NoRepositoryWarning: 'suppressNoRepositoryWarning' as SuppressedKeys,
UpdateNotice: 'suppressUpdateNotice' as SuppressedKeys, UpdateNotice: 'suppressUpdateNotice' as SuppressedKeys
WelcomeNotice: 'suppressWelcomeNotice' as SuppressedKeys
}; };
export class Messages { export class Messages {
@@ -67,7 +65,7 @@ export class Messages {
static async showWelcomeMessage(): Promise<string | undefined> { static async showWelcomeMessage(): Promise<string | undefined> {
const viewDocs = 'View Docs'; const viewDocs = 'View Docs';
const result = await Messages._showMessage('info', `Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs.`, SuppressedKeys.WelcomeNotice, null, viewDocs); const result = await window.showInformationMessage(`Thank you for choosing GitLens! GitLens is powerful, feature rich, and highly configurable, so please be sure to view the docs and tailor it to suit your needs.`, viewDocs);
if (result === viewDocs) { if (result === viewDocs) {
commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens')); commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://marketplace.visualstudio.com/items/eamodio.gitlens'));
} }
@@ -75,7 +73,7 @@ export class Messages {
} }
private static async _showMessage(type: 'info' | 'warn' | 'error', message: string, suppressionKey: SuppressedKeys, dontShowAgain: string | null = 'Don\'t Show Again', ...actions: any[]): Promise<string | undefined> { private static async _showMessage(type: 'info' | 'warn' | 'error', message: string, suppressionKey: SuppressedKeys, dontShowAgain: string | null = 'Don\'t Show Again', ...actions: any[]): Promise<string | undefined> {
Logger.log(`ShowMessage(${type}, '${message}', ${suppressionKey}, ${dontShowAgain})`); Logger.log(`ShowMessage(${type}, "${message}", ${suppressionKey}, ${dontShowAgain})`);
if (Messages.context.globalState.get(suppressionKey, false)) { if (Messages.context.globalState.get(suppressionKey, false)) {
Logger.log(`ShowMessage(${type}, ${message}, ${suppressionKey}, ${dontShowAgain}) skipped`); Logger.log(`ShowMessage(${type}, ${message}, ${suppressionKey}, ${dontShowAgain}) skipped`);
@@ -102,13 +100,12 @@ export class Messages {
} }
if (dontShowAgain === null || result === dontShowAgain) { if (dontShowAgain === null || result === dontShowAgain) {
Logger.log(`ShowMessage(${type}, '${message}', ${suppressionKey}, ${dontShowAgain}) don't show again requested`); Logger.log(`ShowMessage(${type}, ${message}, ${suppressionKey}, ${dontShowAgain}) don't show again requested`);
await Messages.context.globalState.update(suppressionKey, true); await Messages.context.globalState.update(suppressionKey, true);
return undefined;
if (result === dontShowAgain) return undefined;
} }
Logger.log(`ShowMessage(${type}, '${message}', ${suppressionKey}, ${dontShowAgain}) returned ${result}`); Logger.log(`ShowMessage(${type}, ${message}, ${suppressionKey}, ${dontShowAgain}) returned ${result}`);
return result; return result;
} }
} }

View File

@@ -4,7 +4,7 @@ import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode';
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands'; import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './common'; import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './common';
import { GlyphChars } from '../constants'; import { GlyphChars } from '../constants';
import { GitLog, GitLogCommit, GitService, GitUri, RemoteResource } from '../gitService'; import { GitBranch, GitLog, GitLogCommit, GitService, GitUri, RemoteResource } from '../gitService';
import { Keyboard, KeyCommand, KeyNoopCommand } from '../keyboard'; import { Keyboard, KeyCommand, KeyNoopCommand } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes'; import { OpenRemotesCommandQuickPickItem } from './remotes';
import * as moment from 'moment'; import * as moment from 'moment';
@@ -128,11 +128,11 @@ export class CommitFileDetailsQuickPick {
const remotes = Arrays.uniqueBy(await git.getRemotes(commit.repoPath), _ => _.url, _ => !!_.provider); const remotes = Arrays.uniqueBy(await git.getRemotes(commit.repoPath), _ => _.url, _ => !!_.provider);
if (remotes.length) { if (remotes.length) {
if (commit.workingFileName && commit.status !== 'D') { if (commit.workingFileName && commit.status !== 'D') {
const branch = await git.getBranch(commit.repoPath || git.repoPath); const branch = await git.getBranch(commit.repoPath || git.repoPath) as GitBranch;
items.push(new OpenRemotesCommandQuickPickItem(remotes, { items.push(new OpenRemotesCommandQuickPickItem(remotes, {
type: 'file', type: 'file',
fileName: commit.workingFileName, fileName: commit.workingFileName,
branch: branch!.name branch: branch.name
} as RemoteResource, currentCommand)); } as RemoteResource, currentCommand));
} }
if (!stash) { if (!stash) {

View File

@@ -38,10 +38,6 @@ export class OpenRemotesCommandQuickPickItem extends CommandQuickPickItem {
description = `$(git-branch) ${resource.branch}`; description = `$(git-branch) ${resource.branch}`;
break; break;
case 'branches':
description = `$(git-branch) Branches`;
break;
case 'commit': case 'commit':
const shortSha = resource.sha.substring(0, 8); const shortSha = resource.sha.substring(0, 8);
description = `$(git-commit) ${shortSha}`; description = `$(git-commit) ${shortSha}`;

View File

@@ -156,7 +156,7 @@ export class RepoStatusQuickPick {
} }
items.splice(0, 0, new CommandQuickPickItem({ items.splice(0, 0, new CommandQuickPickItem({
label: `$(inbox) Show Stashed Changes`, label: `$(repo) Show Stashed Changes`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows stashed changes in the repository` description: `${Strings.pad(GlyphChars.Dash, 2, 3)} shows stashed changes in the repository`
}, Commands.ShowQuickStashList, [ }, Commands.ShowQuickStashList, [
new GitUri(Uri.file(status.repoPath), { fileName: '', repoPath: status.repoPath }), new GitUri(Uri.file(status.repoPath), { fileName: '', repoPath: status.repoPath }),

View File

@@ -14,10 +14,21 @@ export class StashListQuickPick {
if (mode === 'list') { if (mode === 'list') {
items.splice(0, 0, new CommandQuickPickItem({ items.splice(0, 0, new CommandQuickPickItem({
label: `$(plus) Stash Changes`, label: `$(repo-push) Stash Unstaged Changes`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} stashes only unstaged changes`
}, Commands.StashSave, [
{
unstagedOnly: true,
goBackCommand: currentCommand
} as StashSaveCommandArgs
]));
items.splice(0, 0, new CommandQuickPickItem({
label: `$(repo-force-push) Stash Changes`,
description: `${Strings.pad(GlyphChars.Dash, 2, 3)} stashes all changes` description: `${Strings.pad(GlyphChars.Dash, 2, 3)} stashes all changes`
}, Commands.StashSave, [ }, Commands.StashSave, [
{ {
unstagedOnly: false,
goBackCommand: currentCommand goBackCommand: currentCommand
} as StashSaveCommandArgs } as StashSaveCommandArgs
])); ]));

View File

@@ -4,13 +4,13 @@ import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitNode } from './commitNode'; import { CommitNode } from './commitNode';
import { GlyphChars } from '../constants'; import { GlyphChars } from '../constants';
import { ExplorerNode, ResourceType } from './explorerNode'; import { ExplorerNode, ResourceType } from './explorerNode';
import { GitBranch, GitService, GitUri } from '../gitService'; import { GitBranch, GitRemote, GitService, GitUri } from '../gitService';
export class BranchHistoryNode extends ExplorerNode { export class BranchHistoryNode extends ExplorerNode {
readonly resourceType: ResourceType = 'gitlens:branch-history'; readonly resourceType: ResourceType = 'gitlens:branch-history';
constructor(public readonly branch: GitBranch, uri: GitUri, private readonly template: string, protected readonly context: ExtensionContext, protected readonly git: GitService) { constructor(public readonly branch: GitBranch, private readonly remote: GitRemote | undefined, uri: GitUri, private readonly template: string, protected readonly context: ExtensionContext, protected readonly git: GitService) {
super(uri); super(uri);
} }
@@ -22,11 +22,10 @@ export class BranchHistoryNode extends ExplorerNode {
} }
async getTreeItem(): Promise<TreeItem> { async getTreeItem(): Promise<TreeItem> {
let name = this.branch.getName(); const name = this.remote !== undefined
if (!this.branch.remote && this.branch.tracking !== undefined && this.git.config.gitExplorer.showTrackingBranch) { ? this.branch.name.substring(this.remote.name.length + 1)
name += ` ${GlyphChars.Space}${GlyphChars.ArrowLeftRight}${GlyphChars.Space} ${this.branch.tracking}`; : this.branch.name;
} const item = new TreeItem(`${name}${this.branch!.current ? ` ${GlyphChars.Space} ${GlyphChars.Check}` : ''}`, TreeItemCollapsibleState.Collapsed);
const item = new TreeItem(`${this.branch!.current ? `${GlyphChars.Check} ${GlyphChars.Space}` : ''}${name}`, TreeItemCollapsibleState.Collapsed);
item.contextValue = this.resourceType; item.contextValue = this.resourceType;
item.iconPath = { item.iconPath = {

View File

@@ -18,7 +18,7 @@ export class BranchesNode extends ExplorerNode {
if (branches === undefined) return []; if (branches === undefined) return [];
branches.sort((a, b) => (a.current ? -1 : 1) - (b.current ? -1 : 1) || a.name.localeCompare(b.name)); branches.sort((a, b) => (a.current ? -1 : 1) - (b.current ? -1 : 1) || a.name.localeCompare(b.name));
return [...Iterables.filterMap(branches, b => b.remote ? undefined : new BranchHistoryNode(b, this.uri, this.git.config.gitExplorer.commitFormat, this.context, this.git))]; return [...Iterables.filterMap(branches, b => b.remote ? undefined : new BranchHistoryNode(b, undefined, this.uri, this.git.config.gitExplorer.commitFormat, this.context, this.git))];
} }
getTreeItem(): TreeItem { getTreeItem(): TreeItem {

View File

@@ -4,8 +4,7 @@ import { Command, ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'v
import { Commands, DiffWithPreviousCommandArgs } from '../commands'; import { Commands, DiffWithPreviousCommandArgs } from '../commands';
import { CommitFileNode } from './commitFileNode'; import { CommitFileNode } from './commitFileNode';
import { ExplorerNode, ResourceType } from './explorerNode'; import { ExplorerNode, ResourceType } from './explorerNode';
import { CommitFormatter, getGitStatusIcon, GitLogCommit, GitService, GitUri } from '../gitService'; import { CommitFormatter, GitLogCommit, GitService, GitUri } from '../gitService';
import * as path from 'path';
export class CommitNode extends ExplorerNode { export class CommitNode extends ExplorerNode {
@@ -34,23 +33,17 @@ export class CommitNode extends ExplorerNode {
item.command = this.getCommand(); item.command = this.getCommand();
const resourceType: ResourceType = 'gitlens:commit-file'; const resourceType: ResourceType = 'gitlens:commit-file';
item.contextValue = resourceType; item.contextValue = resourceType;
const icon = getGitStatusIcon(this.commit.status!);
item.iconPath = {
dark: this.context.asAbsolutePath(path.join('images', 'dark', icon)),
light: this.context.asAbsolutePath(path.join('images', 'light', icon))
};
} }
else { else {
item.collapsibleState = TreeItemCollapsibleState.Collapsed; item.collapsibleState = TreeItemCollapsibleState.Collapsed;
item.contextValue = this.resourceType; item.contextValue = this.resourceType;
item.iconPath = {
dark: this.context.asAbsolutePath('images/dark/icon-commit.svg'),
light: this.context.asAbsolutePath('images/light/icon-commit.svg')
};
} }
item.iconPath = {
dark: this.context.asAbsolutePath('images/dark/icon-commit.svg'),
light: this.context.asAbsolutePath('images/light/icon-commit.svg')
};
return item; return item;
} }

View File

@@ -1,12 +1,11 @@
'use strict'; 'use strict';
import { Functions, Objects } from '../system'; import { Functions } from '../system';
import { commands, Event, EventEmitter, ExtensionContext, TextDocumentShowOptions, TextEditor, TreeDataProvider, TreeItem, Uri, window, workspace } from 'vscode'; import { commands, Event, EventEmitter, ExtensionContext, TextDocumentShowOptions, TextEditor, TreeDataProvider, TreeItem, Uri, window } from 'vscode';
import { Commands, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, openEditor, OpenFileInRemoteCommandArgs } from '../commands'; import { Commands, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs, openEditor, OpenFileInRemoteCommandArgs } from '../commands';
import { UriComparer } from '../comparers'; import { UriComparer } from '../comparers';
import { ExtensionKey, IConfig } from '../configuration';
import { CommandContext, setCommandContext } from '../constants'; import { CommandContext, setCommandContext } from '../constants';
import { CommitFileNode, CommitNode, ExplorerNode, HistoryNode, MessageNode, RepositoryNode, StashNode } from './explorerNodes'; import { CommitFileNode, CommitNode, ExplorerNode, HistoryNode, MessageNode, RepositoryNode, StashNode } from './explorerNodes';
import { GitService, GitUri, RepoChangedReasons } from '../gitService'; import { GitService, GitUri } from '../gitService';
export * from './explorerNodes'; export * from './explorerNodes';
@@ -25,7 +24,6 @@ export interface OpenFileRevisionCommandArgs {
export class GitExplorer implements TreeDataProvider<ExplorerNode> { export class GitExplorer implements TreeDataProvider<ExplorerNode> {
private _config: IConfig;
private _root?: ExplorerNode; private _root?: ExplorerNode;
private _view: GitExplorerView = GitExplorerView.Repository; private _view: GitExplorerView = GitExplorerView.Repository;
@@ -45,17 +43,11 @@ export class GitExplorer implements TreeDataProvider<ExplorerNode> {
commands.registerCommand('gitlens.gitExplorer.openFileRevisionInRemote', this.openFileRevisionInRemote, this); commands.registerCommand('gitlens.gitExplorer.openFileRevisionInRemote', this.openFileRevisionInRemote, this);
commands.registerCommand('gitlens.gitExplorer.openChangedFiles', this.openChangedFiles, this); commands.registerCommand('gitlens.gitExplorer.openChangedFiles', this.openChangedFiles, this);
commands.registerCommand('gitlens.gitExplorer.openChangedFileRevisions', this.openChangedFileRevisions, this); commands.registerCommand('gitlens.gitExplorer.openChangedFileRevisions', this.openChangedFileRevisions, this);
commands.registerCommand('gitlens.gitExplorer.applyChanges', this.applyChanges, this);
context.subscriptions.push(this.git.onDidChangeRepo(this.onRepoChanged, this));
const fn = Functions.debounce(this.onActiveEditorChanged, 500); const fn = Functions.debounce(this.onActiveEditorChanged, 500);
context.subscriptions.push(window.onDidChangeActiveTextEditor(fn, this)); context.subscriptions.push(window.onDidChangeActiveTextEditor(fn, this));
context.subscriptions.push(workspace.onDidChangeConfiguration(this.onConfigurationChanged, this));
this.onConfigurationChanged(); this._view = this.git.config.gitExplorer.view;
this._view = this._config.gitExplorer.view;
setCommandContext(CommandContext.GitExplorerView, this._view); setCommandContext(CommandContext.GitExplorerView, this._view);
this._root = this.getRootNode(); this._root = this.getRootNode();
} }
@@ -97,39 +89,15 @@ export class GitExplorer implements TreeDataProvider<ExplorerNode> {
private onActiveEditorChanged(editor: TextEditor | undefined) { private onActiveEditorChanged(editor: TextEditor | undefined) {
if (this._view !== GitExplorerView.History) return; if (this._view !== GitExplorerView.History) return;
const root = this.getRootNode(editor); const root = this.getRootNode(editor);
if (root === this._root) return; if (root === this._root) return;
this._root = root; this.refresh(root);
this.refresh(undefined, root);
} }
private onConfigurationChanged() { refresh(root?: ExplorerNode) {
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!; this._root = root || this.getRootNode();
this._onDidChangeTreeData.fire();
if (!Objects.areEquivalent(cfg.gitExplorer, this._config && this._config.gitExplorer)) {
setTimeout(() => {
this._root = this.getRootNode(window.activeTextEditor);
this.refresh();
}, 1);
}
this._config = cfg;
}
private onRepoChanged(reasons: RepoChangedReasons[]) {
if (this._view !== GitExplorerView.Repository) return;
this.refresh();
}
refresh(node?: ExplorerNode, root?: ExplorerNode) {
if (root === undefined && this._view === GitExplorerView.History) {
this._root = this.getRootNode(window.activeTextEditor);
}
this._onDidChangeTreeData.fire(node);
} }
switchTo(view: GitExplorerView) { switchTo(view: GitExplorerView) {
@@ -138,15 +106,10 @@ export class GitExplorer implements TreeDataProvider<ExplorerNode> {
this._view = view; this._view = view;
setCommandContext(CommandContext.GitExplorerView, this._view); setCommandContext(CommandContext.GitExplorerView, this._view);
this._root = this.getRootNode(window.activeTextEditor); this._root = undefined;
this.refresh(); this.refresh();
} }
private async applyChanges(node: CommitNode | StashNode) {
await this.git.checkoutFile(node.uri);
return this.openFile(node);
}
private openChanges(node: CommitNode | StashNode) { private openChanges(node: CommitNode | StashNode) {
const command = node.getCommand(); const command = node.getCommand();
if (command === undefined || command.arguments === undefined) return; if (command === undefined || command.arguments === undefined) return;

View File

@@ -18,7 +18,7 @@ export class RemoteNode extends ExplorerNode {
if (branches === undefined) return []; if (branches === undefined) return [];
branches.sort((a, b) => a.name.localeCompare(b.name)); branches.sort((a, b) => a.name.localeCompare(b.name));
return [...Iterables.filterMap(branches, b => !b.remote || !b.name.startsWith(this.remote.name) ? undefined : new BranchHistoryNode(b, this.uri, this.git.config.gitExplorer.commitFormat, this.context, this.git))]; return [...Iterables.filterMap(branches, b => !b.remote || !b.name.startsWith(this.remote.name) ? undefined : new BranchHistoryNode(b, this.remote, this.uri, this.git.config.gitExplorer.commitFormat, this.context, this.git))];
} }
getTreeItem(): TreeItem { getTreeItem(): TreeItem {

View File

@@ -1,7 +1,7 @@
'use strict'; 'use strict';
import { Arrays, Iterables } from '../system'; import { Arrays, Iterables } from '../system';
import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode'; import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { ExplorerNode, MessageNode, ResourceType } from './explorerNode'; import { ExplorerNode, ResourceType } from './explorerNode';
import { GitService, GitUri } from '../gitService'; import { GitService, GitUri } from '../gitService';
import { RemoteNode } from './remoteNode'; import { RemoteNode } from './remoteNode';
@@ -15,7 +15,7 @@ export class RemotesNode extends ExplorerNode {
async getChildren(): Promise<ExplorerNode[]> { async getChildren(): Promise<ExplorerNode[]> {
const remotes = Arrays.uniqueBy(await this.git.getRemotes(this.uri.repoPath!), r => r.url, r => !!r.provider); const remotes = Arrays.uniqueBy(await this.git.getRemotes(this.uri.repoPath!), r => r.url, r => !!r.provider);
if (remotes === undefined || remotes.length === 0) return [new MessageNode('No remotes configured')]; if (remotes === undefined) return [];
remotes.sort((a, b) => a.name.localeCompare(b.name)); remotes.sort((a, b) => a.name.localeCompare(b.name));
return [...Iterables.map(remotes, r => new RemoteNode(r, this.uri, this.context, this.git))]; return [...Iterables.map(remotes, r => new RemoteNode(r, this.uri, this.context, this.git))];

View File

@@ -34,7 +34,6 @@ export class StatusNode extends ExplorerNode {
let hasChildren = false; let hasChildren = false;
let label = ''; let label = '';
let iconSuffix = '';
if (status.upstream) { if (status.upstream) {
if (!status.state.ahead && !status.state.behind) { if (!status.state.ahead && !status.state.behind) {
label = `${status.branch} is up-to-date with ${status.upstream}`; label = `${status.branch} is up-to-date with ${status.upstream}`;
@@ -42,15 +41,6 @@ export class StatusNode extends ExplorerNode {
else { else {
label = `${status.branch} is not up-to-date with ${status.upstream}`; label = `${status.branch} is not up-to-date with ${status.upstream}`;
hasChildren = true; hasChildren = true;
if (status.state.ahead && status.state.behind) {
iconSuffix = '-yellow';
}
else if (status.state.ahead) {
iconSuffix = '-green';
}
else if (status.state.behind) {
iconSuffix = '-red';
}
} }
} }
else { else {
@@ -61,8 +51,8 @@ export class StatusNode extends ExplorerNode {
item.contextValue = this.resourceType; item.contextValue = this.resourceType;
item.iconPath = { item.iconPath = {
dark: this.context.asAbsolutePath(`images/dark/icon-repo${iconSuffix}.svg`), dark: this.context.asAbsolutePath('images/dark/icon-repo.svg'),
light: this.context.asAbsolutePath(`images/light/icon-repo${iconSuffix}.svg`) light: this.context.asAbsolutePath('images/light/icon-repo.svg')
}; };
return item; return item;

View File

@@ -37,8 +37,8 @@ export class StatusUpstreamNode extends ExplorerNode {
async getTreeItem(): Promise<TreeItem> { async getTreeItem(): Promise<TreeItem> {
const label = this.direction === 'ahead' const label = this.direction === 'ahead'
? `${this.status.state.ahead} commit${this.status.state.ahead > 1 ? 's' : ''} ahead (local changes)` // of ${this.status.upstream}` ? `${this.status.state.ahead} commit${this.status.state.ahead > 1 ? 's' : ''} ahead` // of ${this.status.upstream}`
: `${this.status.state.behind} commit${this.status.state.behind > 1 ? 's' : ''} behind (remote changes)`; // ${this.status.upstream}`; : `${this.status.state.behind} commit${this.status.state.behind > 1 ? 's' : ''} behind`; // ${this.status.upstream}`;
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed); const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
item.contextValue = this.resourceType; item.contextValue = this.resourceType;