Browse Source

Aligns Repositories view with other views

Adds more customization options to Repositories view
main
Eric Amodio 3 years ago
parent
commit
8d41664ec0
20 changed files with 1109 additions and 349 deletions
  1. +37
    -27
      README.md
  2. +351
    -18
      package.json
  3. +10
    -1
      src/config.ts
  4. +1
    -1
      src/views/branchesView.ts
  5. +28
    -19
      src/views/commitsView.ts
  6. +62
    -37
      src/views/nodes/branchNode.ts
  7. +1
    -0
      src/views/nodes/branchTrackingStatusFilesNode.ts
  8. +56
    -25
      src/views/nodes/branchTrackingStatusNode.ts
  9. +5
    -2
      src/views/nodes/branchesNode.ts
  10. +9
    -8
      src/views/nodes/compareBranchNode.ts
  11. +1
    -0
      src/views/nodes/remoteNode.ts
  12. +83
    -43
      src/views/nodes/repositoryNode.ts
  13. +23
    -25
      src/views/nodes/statusFilesNode.ts
  14. +185
    -0
      src/views/repositoriesView.ts
  15. +3
    -3
      src/webviews/apps/settings/partials/views.branches.html
  16. +3
    -3
      src/webviews/apps/settings/partials/views.commits.html
  17. +2
    -2
      src/webviews/apps/settings/partials/views.contributors.html
  18. +3
    -3
      src/webviews/apps/settings/partials/views.remotes.html
  19. +244
    -130
      src/webviews/apps/settings/partials/views.repositories.html
  20. +2
    -2
      src/webviews/apps/settings/partials/views.searchAndCompare.html

+ 37
- 27
README.md View File

@ -265,8 +265,8 @@ The _Commits_ view lists all of the commits on the current branch, and additiona
- the current branch status — shows the upstream status of the current branch
- **Publish <current branch> to <remote>** — shown when the current branch has not been published to a remote
- **Up to date with <remote>** — shown when the current branch is up to date with the upstream remote
- **Changes to push to <remote>** — lists of all the files changed in the unpublished commits when the current branch has (unpublished) commits that waiting to be pushed to the upstream remote
- **Changes to pull from <remote>** — lists all of the commits waiting to be pulled when the current branch has commits that are waiting to be pulled from the upstream remote
- **Changes to push to <remote>** — lists of all the files changed in the unpublished commits when the current branch has (unpublished) commits that waiting to be pushed to the upstream remote
- any associated pull request — shows any opened pull request associated with the current branch
---
@ -289,23 +289,24 @@ The Repositories view lists opened Git repositories, and additionally provides,
- _Red dot_ — has changes un-pulled (behind)
- _Yellow dot_ — both unpublished and un-pulled changes
- a branch comparison tool (**Compare <current branch> with <branch, tag, or ref>**) — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows a comparison of the current branch (or working tree) to a user-selected reference
- the current branch status — shows the upstream status of the current branch (if not up to date)
- **Publish <current branch> to remote** — shown when the current branch has not been published to a remote
- **Changes to push to <remote>** — lists of all the files changed in the unpublished commits when the current branch has (unpublished) commits that waiting to be pushed to the upstream remote
- **Changes to pull from <remote>** — lists all of the commits waiting to be pulled when the current branch has commits that are waiting to be pulled from the upstream remote
- any associated pull request — shows any opened pull request associated with the current branch
- **Behind** — lists the commits that are missing from the current branch (i.e. behind) but exist in the selected reference
- **# files changed** — lists all of the files changed between the compared references
- **Ahead** — lists the commits that the current branch has (i.e. ahead) but are missing in the selected reference
- **# files changed** — lists all of the files changed between the compared references
- the changed files — lists all of the files changed by the unpublished (unpushed) commits and [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') any working tree changes
- the current branch commits — similar to the [Commits view](#commits-view- 'Commits view')
- the local branches — similar to the [Branches view](#branches-view- 'Branches view')
- the contributors — similar to the [Contributors view](#contributors-view- 'Contributors view')
- any incoming activity (experimental) — lists the command, branch (if available), and date of recent incoming activity (merges and pulls) to your local repository
- the remotes and remote branches — similar to the [Remotes view](#remotes-view- 'Remotes view')
- the stashes — similar to the [Stashes view](#stashes-view- 'Stashes view')
- the tags — similar to the [Tags view](#tags-view- 'Tags view')
- **# files changed** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') lists all of the files changed in the working tree
- the current branch status — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the upstream status of the current branch
- **Publish <current branch> to remote** — shown when the current branch has not been published to a remote
- **Up to date with <remote>** — shown when the current branch is up to date with the upstream remote
- **Changes to pull from <remote>** — lists all of the unpulled commits and all of the files changed in them, when the current branch has commits that are waiting to be pulled from the upstream remote
- **Changes to push to <remote>** — lists of all the unpublished commits and all of the files changed in them, when the current branch has commits that waiting to be pushed to the upstream remote
- any associated pull request — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows any opened pull request associated with the current branch
- **Commits** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the current branch commits, similar to the [Commits view](#commits-view- 'Commits view')
- **Branches** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the local branches, similar to the [Branches view](#branches-view- 'Branches view')
- **Remotes** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the remotes and remote branches, similar to the [Remotes view](#remotes-view- 'Remotes view')
- **Stashes** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the stashes, similar to the [Stashes view](#stashes-view- 'Stashes view')
- **Tags** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the tags, similar to the [Tags view](#tags-view- 'Tags view')
- **Contributors** — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows the contributors, similar to the [Contributors view](#contributors-view- 'Contributors view')
- **Incoming Activity** (experimental) — [optionally](#repositories-view-settings- 'Jump to the Repositories view settings') shows any incoming activity, which lists the command, branch (if available), and date of recent incoming activity (merges and pulls) to your local repository
---
@ -727,19 +728,28 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
See also [View Settings](#view-settings- 'Jump to the View settings')
| Name | Description |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.repositories.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view |
| `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes |
| `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files |
| `gitlens.views.repositories.branches.layout` | Specifies how the _Repositories_ view will display branches<br /><br />`list` - displays branches as a list<br />`tree` - displays branches as a tree when branch names contain slashes `/` |
| `gitlens.views.repositories.compact` | Specifies whether to show the _Repositories_ view in a compact display density |
| `gitlens.views.repositories.enabled` | Specifies whether to show the _Repositories_ view |
| `gitlens.views.repositories.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `tree` or `auto` |
| `gitlens.views.repositories.files.layout` | Specifies how the _Repositories_ view will display files<br /><br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.repositories.files.threshold` value and the number of files at each nesting level<br />`list` - displays files as a list<br />`tree` - displays files as a tree |
| `gitlens.views.repositories.files.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `auto` |
| `gitlens.views.repositories.includeWorkingTree` | Specifies whether to include working tree file status for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showBranchComparison` | Specifies whether to show a comparison of a user-selected reference (branch, tag. etc) to the current branch or the working tree in the _Repositories_ view |
| Name | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.repositories.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view |
| `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes |
| `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files |
| `gitlens.views.repositories.branches.layout` | Specifies how the _Repositories_ view will display branches<br /><br />`list` - displays branches as a list<br />`tree` - displays branches as a tree when branch names contain slashes `/` |
| `gitlens.views.repositories.branches.showBranchComparison` | Specifies whether to show a comparison of the branch with a user-selected reference (branch, tag. etc) under _Branches_ in the _Repositories_ view view |
| `gitlens.views.repositories.compact` | Specifies whether to show the _Repositories_ view in a compact display density |
| `gitlens.views.repositories.enabled` | Specifies whether to show the _Repositories_ view |
| `gitlens.views.repositories.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `tree` or `auto` |
| `gitlens.views.repositories.files.layout` | Specifies how the _Repositories_ view will display files<br /><br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.repositories.files.threshold` value and the number of files at each nesting level<br />`list` - displays files as a list<br />`tree` - displays files as a tree |
| `gitlens.views.repositories.files.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `auto` |
| `gitlens.views.repositories.includeWorkingTree` | Specifies whether to include working tree file status for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showBranchComparison` | Specifies whether to show a comparison of a user-selected reference (branch, tag. etc) to the current branch or the working tree in the _Repositories_ view |
| `gitlens.views.repositories.showBranches` | Specifies whether to show the branches for each repository in the _Repositories_ view |
| `itlens.views.repositories.showCommits` | Specifies whether to show the commits on the current branch for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showContributors` | Specifies whether to show the contributors for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showIncomingActivity` | Specifies whether to show the experimental incoming activity for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showRemotes` | Specifies whether to show the remotes for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showStashes` | Specifies whether to show the stashes for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showTags` | Specifies whether to show the tags for each repository in the _Repositories_ view |
| `gitlens.views.repositories.showUpstreamStatus` | Specifies whether to show the upstream status of the current branch for each repository in the _Repositories_ view |
## File History View Settings [#](#file-history-view-settings- 'File History View Settings')

+ 351
- 18
package.json View File

@ -2021,6 +2021,27 @@
"markdownDescription": "Specifies how the _Repositories_ view will display branches",
"scope": "window"
},
"gitlens.views.repositories.branches.showBranchComparison": {
"anyOf": [
{
"enum": [
false
]
},
{
"type": "string",
"enum": [
"branch"
],
"enumDescriptions": [
"Compares the branch with a user-selected reference"
]
}
],
"default": "branch",
"markdownDescription": "Specifies whether to show a comparison of the branch with a user-selected reference (branch, tag. etc) under _Branches_ in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.compact": {
"type": "boolean",
"default": false,
@ -2108,6 +2129,54 @@
"markdownDescription": "Specifies whether to show a comparison of the current branch or the working tree with a user-selected reference (branch, tag. etc) in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showBranches": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the branches for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showCommits": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the commits on the current branch for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showContributors": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the contributors for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showIncomingActivity": {
"type": "boolean",
"default": false,
"markdownDescription": "Specifies whether to show the experimental incoming activity for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showRemotes": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the remotes for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showStashes": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the stashes for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showTags": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the tags for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showUpstreamStatus": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show the upstream status of the current branch for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.searchAndCompare.avatars": {
"type": "boolean",
"default": true,
@ -3930,12 +3999,12 @@
},
{
"command": "gitlens.views.branches.setShowBranchComparisonOn",
"title": "Show Branch Comparison",
"title": "Show Branch Comparisons",
"category": "GitLens"
},
{
"command": "gitlens.views.branches.setShowBranchComparisonOff",
"title": "Hide Branch Comparison",
"title": "Hide Branch Comparisons",
"category": "GitLens"
},
{
@ -4315,6 +4384,91 @@
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOn",
"title": "Show Branch Comparisons",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOff",
"title": "Hide Branch Comparisons",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowBranchesOn",
"title": "Show Branches",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowBranchesOff",
"title": "Hide Branches",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowCommitsOn",
"title": "Show Commits",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowCommitsOff",
"title": "Hide Commits",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowContributorsOn",
"title": "Show Contributors",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowContributorsOff",
"title": "Hide Contributors",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowRemotesOn",
"title": "Show Remotes",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowRemotesOff",
"title": "Hide Remotes",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowStashesOn",
"title": "Show Stashes",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowStashesOff",
"title": "Hide Stashes",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowTagsOn",
"title": "Show Tags",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowTagsOff",
"title": "Hide Tags",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowUpstreamStatusOn",
"title": "Show Current Branch Status",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowUpstreamStatusOff",
"title": "Hide Current Branch Status",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowSectionOff",
"title": "Hide",
"category": "GitLens"
},
{
"command": "gitlens.views.searchAndCompare.clear",
"title": "Clear Results",
"category": "GitLens",
@ -5603,6 +5757,74 @@
"when": "false"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowBranchesOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowBranchesOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowCommitsOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowCommitsOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowContributorsOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowContributorsOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowRemotesOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowRemotesOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowStashesOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowStashesOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowTagsOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowTagsOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowUpstreamStatusOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowUpstreamStatusOff",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowSectionOff",
"when": "false"
},
{
"command": "gitlens.views.searchAndCompare.clear",
"when": "false"
},
@ -6211,12 +6433,12 @@
{
"command": "gitlens.showRepositoriesView",
"when": "view =~ /^gitlens\\.views\\.commits/ && !config.gitlens.views.repositories.enabled",
"group": "8_gitlens@0"
"group": "8_gitlens_toggles@0"
},
{
"command": "gitlens.hideRepositoriesView",
"when": "view =~ /^gitlens\\.views\\.commits/ && config.gitlens.views.repositories.enabled",
"group": "8_gitlens@0"
"group": "8_gitlens_toggles@0"
},
{
"command": "gitlens.views.addAuthors",
@ -6321,12 +6543,12 @@
{
"command": "gitlens.showLineHistoryView",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !config.gitlens.views.lineHistory.enabled",
"group": "8_gitlens@0"
"group": "8_gitlens_toggles@0"
},
{
"command": "gitlens.hideLineHistoryView",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && config.gitlens.views.lineHistory.enabled",
"group": "8_gitlens@0"
"group": "8_gitlens_toggles@0"
},
{
"command": "gitlens.views.lineHistory.setEditorFollowingOn",
@ -6459,6 +6681,11 @@
"group": "3_gitlens@0"
},
{
"submenu": "gitlens/view/repositories/sections",
"when": "view =~ /^gitlens\\.views\\.repositories/",
"group": "4_gitlens@1"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.repositories/ && !config.gitlens.views.repositories.avatars",
"group": "5_gitlens@0"
@ -6469,16 +6696,6 @@
"group": "5_gitlens@0"
},
{
"command": "gitlens.views.repositories.setShowBranchComparisonOn",
"when": "view =~ /^gitlens\\.views\\.repositories/ && !config.gitlens.views.repositories.showBranchComparison",
"group": "5_gitlens@1"
},
{
"command": "gitlens.views.repositories.setShowBranchComparisonOff",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.showBranchComparison",
"group": "5_gitlens@1"
},
{
"submenu": "gitlens/view/searchAndCompare/new",
"when": "view =~ /^gitlens\\.views\\.searchAndCompare\\b/",
"group": "navigation@10"
@ -6713,6 +6930,16 @@
"alt": "gitlens.copyRemoteBranchesUrl"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOn",
"when": "view =~ /^gitlens\\.views\\.repositories/ && viewItem =~ /gitlens:branches\\b/ && !config.gitlens.views.repositories.branches.showBranchComparison",
"group": "8_gitlens_toggles@1"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOff",
"when": "view =~ /^gitlens\\.views\\.repositories/ && viewItem =~ /gitlens:branches\\b/ && config.gitlens.views.repositories.branches.showBranchComparison",
"group": "8_gitlens_toggles@1"
},
{
"command": "gitlens.views.switchToBranch",
"when": "!gitlens:readonly && viewItem =~ /gitlens:branch\\b(?!.*?\\b\\+current\\b)/",
"group": "inline@7"
@ -7161,6 +7388,16 @@
"group": "inline@1"
},
{
"command": "gitlens.views.repositories.setBranchesLayoutToList",
"when": "viewItem =~ /gitlens:remotes\\b/ && config.gitlens.views.repositories.branches.layout == tree",
"group": "inline@50"
},
{
"command": "gitlens.views.repositories.setBranchesLayoutToTree",
"when": "viewItem =~ /gitlens:remotes\\b/ && config.gitlens.views.repositories.branches.layout == list",
"group": "inline@50"
},
{
"command": "gitlens.views.addRemote",
"when": "!gitlens:readonly && viewItem =~ /gitlens:remotes\\b/",
"group": "1_gitlens_actions@1"
@ -7451,12 +7688,22 @@
{
"command": "gitlens.views.branches.setShowBranchComparisonOff",
"when": "view =~ /gitlens\\.views\\.branches\\b/ && viewItem =~ /gitlens:compare:branch\\b/",
"group": "8_gitlens@1"
"group": "8_gitlens_toggles@1"
},
{
"command": "gitlens.views.commits.setShowBranchComparisonOff",
"when": "view =~ /gitlens\\.views\\.commits\\b/ && viewItem =~ /gitlens:compare:branch\\b/",
"group": "8_gitlens@1"
"group": "8_gitlens_toggles@1"
},
{
"command": "gitlens.views.repositories.setBranchesShowBranchComparisonOff",
"when": "view =~ /gitlens\\.views\\.repositories\\b/ && viewItem =~ /gitlens:compare:branch(?!.*?\\b\\+root\\b)\\b/",
"group": "8_gitlens_toggles@1"
},
{
"command": "gitlens.views.repositories.setShowSectionOff",
"when": "view =~ /gitlens\\.views\\.repositories\\b/ && viewItem =~ /gitlens:(compare:branch(?=.*?\\b\\+root\\b)|branches|branch(?=.*?\\b\\+commits\\b)|reflog|remotes|stashes|status:upstream|tags)\\b/",
"group": "8_gitlens_toggles@99"
},
{
"command": "gitlens.views.clearNode",
@ -7981,6 +8228,88 @@
"group": "1_gitlens@2"
}
],
"gitlens/view/repositories/sections": [
{
"command": "gitlens.views.repositories.setShowBranchComparisonOn",
"when": "!config.gitlens.views.repositories.showBranchComparison",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.repositories.setShowBranchComparisonOff",
"when": "config.gitlens.views.repositories.showBranchComparison",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.repositories.setShowUpstreamStatusOn",
"when": "!config.gitlens.views.repositories.showUpstreamStatus",
"group": "1_gitlens@1"
},
{
"command": "gitlens.views.repositories.setShowUpstreamStatusOff",
"when": "config.gitlens.views.repositories.showUpstreamStatus",
"group": "1_gitlens@1"
},
{
"command": "gitlens.views.repositories.setShowCommitsOn",
"when": "!config.gitlens.views.repositories.showCommits",
"group": "2_gitlens@2"
},
{
"command": "gitlens.views.repositories.setShowCommitsOff",
"when": "config.gitlens.views.repositories.showCommits",
"group": "2_gitlens@2"
},
{
"command": "gitlens.views.repositories.setShowBranchesOn",
"when": "!config.gitlens.views.repositories.showBranches",
"group": "2_gitlens@3"
},
{
"command": "gitlens.views.repositories.setShowBranchesOff",
"when": "config.gitlens.views.repositories.showBranches",
"group": "2_gitlens@3"
},
{
"command": "gitlens.views.repositories.setShowRemotesOn",
"when": "!config.gitlens.views.repositories.showRemotes",
"group": "2_gitlens@4"
},
{
"command": "gitlens.views.repositories.setShowRemotesOff",
"when": "config.gitlens.views.repositories.showRemotes",
"group": "2_gitlens@4"
},
{
"command": "gitlens.views.repositories.setShowStashesOn",
"when": "!config.gitlens.views.repositories.showStashes",
"group": "2_gitlens@5"
},
{
"command": "gitlens.views.repositories.setShowStashesOff",
"when": "config.gitlens.views.repositories.showStashes",
"group": "2_gitlens@5"
},
{
"command": "gitlens.views.repositories.setShowTagsOn",
"when": "!config.gitlens.views.repositories.showTags",
"group": "2_gitlens@6"
},
{
"command": "gitlens.views.repositories.setShowTagsOff",
"when": "config.gitlens.views.repositories.showTags",
"group": "2_gitlens@6"
},
{
"command": "gitlens.views.repositories.setShowContributorsOn",
"when": "!config.gitlens.views.repositories.showContributors",
"group": "2_gitlens@7"
},
{
"command": "gitlens.views.repositories.setShowContributorsOff",
"when": "config.gitlens.views.repositories.showContributors",
"group": "2_gitlens@7"
}
],
"gitlens/view/searchAndCompare/new": [
{
"command": "gitlens.views.searchAndCompare.searchCommits",
@ -8052,6 +8381,10 @@
"label": "Open Changes"
},
{
"id": "gitlens/view/repositories/sections",
"label": "Sections"
},
{
"id": "gitlens/view/searchAndCompare/new",
"label": "New Search or Compare",
"icon": "$(add)"

+ 10
- 1
src/config.ts View File

@ -485,7 +485,7 @@ export interface BranchesViewConfig {
showForBranches: boolean;
showForCommits: boolean;
};
showBranchComparison: false | ViewShowBranchComparison;
showBranchComparison: false | ViewShowBranchComparison.Branch;
}
export interface CommitsViewConfig {
@ -537,6 +537,7 @@ export interface RepositoriesViewConfig {
avatars: boolean;
branches: {
layout: ViewBranchesLayout;
showBranchComparison: false | ViewShowBranchComparison.Branch;
};
compact: boolean;
enabled: boolean;
@ -548,6 +549,14 @@ export interface RepositoriesViewConfig {
showForCommits: boolean;
};
showBranchComparison: false | ViewShowBranchComparison;
showBranches: boolean;
showCommits: boolean;
showContributors: boolean;
showIncomingActivity: boolean;
showRemotes: boolean;
showStashes: boolean;
showTags: boolean;
showUpstreamStatus: boolean;
}
export interface SearchAndCompareViewConfig {

+ 1
- 1
src/views/branchesView.ts View File

@ -323,7 +323,7 @@ export class BranchesView extends ViewBase
'views',
this.configKey,
'showBranchComparison',
enabled ? ViewShowBranchComparison.Working : false,
enabled ? ViewShowBranchComparison.Branch : false,
);
}

+ 28
- 19
src/views/commitsView.ts View File

@ -4,6 +4,7 @@ import {
commands,
ConfigurationChangeEvent,
Disposable,
MarkdownString,
ProgressLocation,
TreeItem,
TreeItemCollapsibleState,
@ -88,9 +89,9 @@ export class CommitsRepositoryNode extends RepositoryFolderNode
const lastFetched = (await this.repo?.getLastFetched()) ?? 0;
const status = branch?.getTrackingStatus();
item.description = `${status ? `${status} ${GlyphChars.Dot} ` : ''}${branch.name}${
item.description = `${status ? `${status}${Strings.pad(GlyphChars.Dot, 1, 1)}` : ''}${branch.name}${
lastFetched
? `${Strings.pad(GlyphChars.Dot, 2, 2)}Last fetched ${Repository.formatLastFetched(lastFetched)}`
? `${Strings.pad(GlyphChars.Dot, 1, 1)}Last fetched ${Repository.formatLastFetched(lastFetched)}`
: ''
}`;
@ -103,23 +104,31 @@ export class CommitsRepositoryNode extends RepositoryFolderNode
providerName = remote?.provider?.name;
}
item.tooltip = `${this.repo.formattedName ?? this.uri.repoPath ?? ''}${
lastFetched
? `${Strings.pad(GlyphChars.Dash, 2, 2)}Last fetched ${Repository.formatLastFetched(
lastFetched,
false,
)}`
: ''
}${this.repo.formattedName ? `\n${this.uri.repoPath}` : ''}\n\nBranch ${branch.name}${
branch.tracking
? ` is ${branch.getTrackingStatus({
empty: `up to date with ${branch.tracking}${providerName ? ` on ${providerName}` : ''}`,
expand: true,
separator: ', ',
suffix: ` ${branch.tracking}${providerName ? ` on ${providerName}` : ''}`,
})}`
: `hasn't been published to ${providerName ?? 'a remote'}`
}`;
item.tooltip = new MarkdownString(
`${this.repo.formattedName ?? this.uri.repoPath ?? ''}${
lastFetched
? `${Strings.pad(GlyphChars.Dash, 2, 2)}Last fetched ${Repository.formatLastFetched(
lastFetched,
false,
)}`
: ''
}${this.repo.formattedName ? `\n${this.uri.repoPath}` : ''}\n\nCurrent branch $(git-branch) ${
branch.name
}${
branch.tracking
? ` is ${branch.getTrackingStatus({
empty: `up to date with $(git-branch) ${branch.tracking}${
providerName ? ` on ${providerName}` : ''
}`,
expand: true,
icons: true,
separator: ', ',
suffix: ` $(git-branch) ${branch.tracking}${providerName ? ` on ${providerName}` : ''}`,
})}`
: `hasn't been published to ${providerName ?? 'a remote'}`
}`,
true,
);
}
return item;

+ 62
- 37
src/views/nodes/branchNode.ts View File

@ -1,5 +1,5 @@
'use strict';
import { TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { BranchesView } from '../branchesView';
import { BranchTrackingStatusNode } from './branchTrackingStatusNode';
import { CommitNode } from './commitNode';
@ -38,6 +38,7 @@ export class BranchNode
private _children: ViewNode[] | undefined;
private readonly options: {
expanded: boolean;
showAsCommits: boolean;
showComparison: false | ViewShowBranchComparison;
showCurrent: boolean;
showTracking: boolean;
@ -50,11 +51,12 @@ export class BranchNode
view: BranchesView | CommitsView | RemotesView | RepositoriesView,
parent: ViewNode,
public readonly branch: GitBranch,
// Specifies that the node is shown as a root and not nested under the branches node
// Specifies that the node is shown as a root
public readonly root: boolean,
options?: {
expanded?: boolean;
showAsCommits?: boolean;
showComparison?: false | ViewShowBranchComparison;
showCurrent?: boolean;
showTracking?: boolean;
@ -65,6 +67,7 @@ export class BranchNode
this.options = {
expanded: false,
showAsCommits: false,
showComparison: false,
// Hide the current branch checkmark when the node is displayed as a root under the repository node
showCurrent: !this.root,
@ -89,6 +92,8 @@ export class BranchNode
}
get label(): string {
if (this.options.showAsCommits) return 'Commits';
const branchName = this.branch.getNameWithoutRemote();
return this.view.config.branches?.layout !== ViewBranchesLayout.Tree ||
this.compacted ||
@ -132,11 +137,17 @@ export class BranchNode
]);
if (log == null) return [new MessageNode(this.view, this, 'No commits could be found.')];
if (
this.options.showComparison !== false &&
(this.view instanceof BranchesView || this.view instanceof CommitsView)
) {
children.push(new CompareBranchNode(this.uri, this.view, this, this.branch));
if (this.options.showComparison !== false && !(this.view instanceof RemotesView)) {
children.push(
new CompareBranchNode(
this.uri,
this.view,
this,
this.branch,
this.options.showComparison,
this.splatted,
),
);
}
if (pr != null) {
@ -157,15 +168,15 @@ export class BranchNode
new BranchTrackingStatusNode(this.view, this, this.branch, status, 'same', this.root),
);
} else {
if (status.state.ahead) {
if (status.state.behind) {
children.push(
new BranchTrackingStatusNode(this.view, this, this.branch, status, 'ahead', this.root),
new BranchTrackingStatusNode(this.view, this, this.branch, status, 'behind', this.root),
);
}
if (status.state.behind) {
if (status.state.ahead) {
children.push(
new BranchTrackingStatusNode(this.view, this, this.branch, status, 'behind', this.root),
new BranchTrackingStatusNode(this.view, this, this.branch, status, 'ahead', this.root),
);
}
}
@ -214,9 +225,9 @@ export class BranchNode
async getTreeItem(): Promise<TreeItem> {
this.splatted = false;
const name = this.label;
let tooltip = `Branch ${this.branch.getNameWithoutRemote()}${this.current ? ' (current)' : ''}`;
let iconSuffix = '';
let tooltip = `${
this.current ? 'Current branch' : 'Branch'
} $(git-branch) ${this.branch.getNameWithoutRemote()}`;
let contextValue: string = ContextValues.Branch;
if (this.current) {
@ -231,8 +242,13 @@ export class BranchNode
if (this.branch.tracking) {
contextValue += '+tracking';
}
if (this.options.showAsCommits) {
contextValue += '+commits';
}
let color: ThemeColor | undefined;
let description;
let iconSuffix = '';
if (!this.branch.remote) {
if (this.branch.tracking != null) {
let arrows = GlyphChars.Dash;
@ -262,27 +278,36 @@ export class BranchNode
}
}
description = `${this.branch.getTrackingStatus({ suffix: `${GlyphChars.Space} ` })}${arrows}${
GlyphChars.Space
} ${this.branch.tracking}`;
description = this.options.showAsCommits
? `${this.branch.getTrackingStatus({
suffix: Strings.pad(GlyphChars.Dot, 1, 1),
})}${this.branch.getNameWithoutRemote()}${Strings.pad(arrows, 2, 2)}${this.branch.tracking}`
: `${this.branch.getTrackingStatus({ suffix: `${GlyphChars.Space} ` })}${arrows}${
GlyphChars.Space
} ${this.branch.tracking}`;
tooltip += ` is ${this.branch.getTrackingStatus({
empty: `up to date with ${this.branch.tracking}${
empty: `up to date with $(git-branch) ${this.branch.tracking}${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`,
expand: true,
icons: true,
separator: ', ',
suffix: ` ${this.branch.tracking}${remote?.provider?.name ? ` on ${remote.provider.name}` : ''}`,
suffix: ` $(git-branch) ${this.branch.tracking}${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`,
})}`;
if (this.branch.state.ahead || this.branch.state.behind) {
if (this.branch.state.behind) {
contextValue += '+behind';
iconSuffix = '-red';
}
if (this.branch.state.ahead) {
contextValue += '+ahead';
iconSuffix = this.branch.state.behind ? '-yellow' : '-green';
color = new ThemeColor('gitlens.viewChangesToPushIconColor');
iconSuffix = '-green';
}
if (this.branch.state.behind) {
contextValue += '+behind';
color = new ThemeColor('gitlens.viewChangesToPullIconColor');
iconSuffix = this.branch.state.ahead ? '-yellow' : '-red';
}
}
} else {
@ -295,28 +320,30 @@ export class BranchNode
}
}
if (this.branch.date !== undefined) {
if (this.branch.date != null) {
description = `${description ? `${description}${Strings.pad(GlyphChars.Dot, 2, 2)}` : ''}${
this.branch.formattedDate
}`;
tooltip += `\nLast commit ${this.branch.formatDateFromNow()} (${this.branch.formatDate(
tooltip += `\n\nLast commit ${this.branch.formatDateFromNow()} (${this.branch.formatDate(
BranchDateFormatting.dateFormat,
)})`;
}
const item = new TreeItem(
`${this.options.showCurrent && this.current ? `${GlyphChars.Check} ${GlyphChars.Space}` : ''}${name}`,
`${this.options.showCurrent && this.current ? Strings.pad(GlyphChars.Check, 0, 2) : ''}${this.label}`,
this.options.expanded ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed,
);
item.iconPath = this.options.showAsCommits
? new ThemeIcon('git-commit', color)
: {
dark: Container.context.asAbsolutePath(`images/dark/icon-branch${iconSuffix}.svg`),
light: Container.context.asAbsolutePath(`images/light/icon-branch${iconSuffix}.svg`),
};
item.contextValue = contextValue;
item.description = description;
item.iconPath = {
dark: Container.context.asAbsolutePath(`images/dark/icon-branch${iconSuffix}.svg`),
light: Container.context.asAbsolutePath(`images/light/icon-branch${iconSuffix}.svg`),
};
item.id = this.id;
item.tooltip = tooltip;
item.tooltip = new MarkdownString(tooltip, true);
return item;
}
@ -345,12 +372,10 @@ export class BranchNode
private _log: GitLog | undefined;
private async getLog() {
if (this._log == null) {
// Ensure we always show all unpublished commits (and the upstream tip)
let limit =
this.limit ??
(this.view instanceof CommitsView ? this.view.config.pageItemLimit : this.view.config.defaultItemLimit);
let limit = this.limit ?? (this.root ? this.view.config.pageItemLimit : this.view.config.defaultItemLimit);
// Try to show more commits if they are unpublished
if (limit !== 0 && this.branch.state.ahead > limit) {
limit = this.branch.state.ahead + 1;
limit = Math.min(this.branch.state.ahead + 1, limit * 2);
}
this._log = await Container.git.getLog(this.uri.repoPath!, {

+ 1
- 0
src/views/nodes/branchTrackingStatusFilesNode.ts View File

@ -27,6 +27,7 @@ export class BranchTrackingStatusFilesNode extends ViewNode {
public readonly branch: GitBranch,
public readonly status: Required<BranchTrackingStatus>,
public readonly direction: 'ahead' | 'behind',
// Specifies that the node is shown as a root
private readonly root: boolean = false,
) {
super(GitUri.fromRepoPath(status.repoPath), view, parent);

+ 56
- 25
src/views/nodes/branchTrackingStatusNode.ts View File

@ -1,5 +1,5 @@
'use strict';
import { ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import { BranchNode } from './branchNode';
import { BranchTrackingStatusFilesNode } from './branchTrackingStatusFilesNode';
import { CommitNode } from './commitNode';
@ -8,8 +8,7 @@ import { Container } from '../../container';
import { GitBranch, GitLog, GitRemote, GitRevision, GitTrackingState } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { insertDateMarkers } from './helpers';
import { RepositoriesView } from '../repositoriesView';
import { Dates, debug, gate, Iterables, memoize, Strings } from '../../system';
import { Dates, debug, gate, Iterables, Strings } from '../../system';
import { ViewsWithFiles } from '../viewBase';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
@ -32,16 +31,25 @@ export class BranchTrackingStatusNode extends ViewNode implement
return `${BranchNode.getId(repoPath, name, root)}${this.key}(${upstream ?? ''}):${upstreamType}`;
}
private readonly options: {
showAheadCommits?: boolean;
};
constructor(
view: ViewsWithFiles,
parent: ViewNode,
public readonly branch: GitBranch,
public readonly status: BranchTrackingStatus,
public readonly upstreamType: 'ahead' | 'behind' | 'same' | 'none',
// Specifies that the node is shown as a root and not nested under the branches node
// Specifies that the node is shown as a root
public readonly root: boolean = false,
options?: {
showAheadCommits?: boolean;
},
) {
super(GitUri.fromRepoPath(status.repoPath), view, parent);
this.options = { showAheadCommits: false, ...options };
}
get id(): string {
@ -80,7 +88,15 @@ export class BranchTrackingStatusNode extends ViewNode implement
}
const children = [];
if (!this.isReposView && this.status.upstream && this.upstreamType === 'ahead' && this.status.state.ahead > 0) {
let showFiles = true;
if (
!this.options.showAheadCommits &&
this.upstreamType === 'ahead' &&
this.status.upstream &&
this.status.state.ahead > 0
) {
showFiles = false;
// TODO@eamodio fix this
children.push(
...(await new BranchTrackingStatusFilesNode(
@ -109,13 +125,28 @@ export class BranchTrackingStatusNode extends ViewNode implement
}
}
if (showFiles) {
children.splice(
0,
0,
new BranchTrackingStatusFilesNode(
this.view,
this,
this.branch,
this.status as Required<BranchTrackingStatus>,
this.upstreamType,
this.root,
),
);
}
return children;
}
async getTreeItem(): Promise<TreeItem> {
let lastFetched = 0;
if (this.root && !this.isReposView && this.upstreamType !== 'none') {
if (this.upstreamType !== 'none') {
const repo = await Container.git.getRepository(this.repoPath);
lastFetched = (await repo?.getLastFetched()) ?? 0;
}
@ -134,14 +165,14 @@ export class BranchTrackingStatusNode extends ViewNode implement
remote?.provider?.name ? ` on ${remote?.provider.name}` : ''
}`;
description = Strings.pluralize('commit', this.status.state.ahead);
tooltip = `Branch ${this.branch.name} is ${Strings.pluralize(
tooltip = `Branch $(git-branch) ${this.branch.name} is ${Strings.pluralize(
'commit',
this.status.state.ahead,
)} ahead of ${this.status.upstream}${remote?.provider?.name ? ` on ${remote.provider.name}` : ''}`;
{ infix: '$(arrow-up) ' },
)} ahead of $(git-branch) ${this.status.upstream}${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`;
// collapsibleState = !this.isReposView
// ? TreeItemCollapsibleState.Expanded
// : TreeItemCollapsibleState.Collapsed;
collapsibleState = TreeItemCollapsibleState.Collapsed;
contextValue = this.root
? ContextValues.StatusAheadOfUpstream
@ -157,10 +188,13 @@ export class BranchTrackingStatusNode extends ViewNode implement
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`;
description = Strings.pluralize('commit', this.status.state.behind);
tooltip = `Branch ${this.branch.name} is ${Strings.pluralize(
tooltip = `Branch $(git-branch) ${this.branch.name} is ${Strings.pluralize(
'commit',
this.status.state.behind,
)} behind ${this.status.upstream}${remote?.provider?.name ? ` on ${remote.provider.name}` : ''}`;
{ infix: '$(arrow-down) ' },
)} behind $(git-branch) ${this.status.upstream}${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`;
collapsibleState = TreeItemCollapsibleState.Collapsed;
contextValue = this.root
@ -176,10 +210,10 @@ export class BranchTrackingStatusNode extends ViewNode implement
label = `Up to date with ${remote?.name ?? GitBranch.getRemote(this.status.upstream!)}${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`;
description = `Last fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`;
tooltip = `Branch ${this.branch.name} is up to date with ${this.status.upstream}${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`;
description = lastFetched ? `Last fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}` : '';
tooltip = `Branch $(git-branch) ${this.branch.name} is up to date with $(git-branch) ${
this.status.upstream
}${remote?.provider?.name ? ` on ${remote.provider.name}` : ''}`;
collapsibleState = TreeItemCollapsibleState.None;
contextValue = this.root ? ContextValues.StatusSameAsUpstream : undefined;
@ -194,7 +228,9 @@ export class BranchTrackingStatusNode extends ViewNode implement
const providerName = providers?.length ? providers[0].name : undefined;
label = `Publish ${this.branch.name} to ${providerName ?? 'a remote'}`;
tooltip = `Branch ${this.branch.name} hasn't been published to ${providerName ?? 'a remote'}`;
tooltip = `Branch $(git-branch) ${this.branch.name} hasn't been published to ${
providerName ?? 'a remote'
}`;
collapsibleState = TreeItemCollapsibleState.None;
contextValue = this.root ? ContextValues.StatusNoUpstream : undefined;
@ -209,19 +245,14 @@ export class BranchTrackingStatusNode extends ViewNode implement
item.contextValue = contextValue;
item.description = description;
if (lastFetched) {
tooltip += `\nLast fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`;
tooltip += `\n\nLast fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`;
}
item.iconPath = icon;
item.tooltip = tooltip;
item.tooltip = new MarkdownString(tooltip, true);
return item;
}
@memoize()
private get isReposView() {
return this.view instanceof RepositoriesView;
}
@gate()
@debug()
refresh(reset?: boolean) {

+ 5
- 2
src/views/nodes/branchesNode.ts View File

@ -42,14 +42,17 @@ export class BranchesNode extends ViewNode {
const branches = await this.repo.getBranches({
// only show local branches
filter: b => !b.remote,
sort: this.view instanceof RepositoriesView ? true : { current: false },
sort: { current: false },
});
if (branches.length === 0) return [new MessageNode(this.view, this, 'No branches could be found.')];
const branchNodes = branches.map(
b =>
new BranchNode(GitUri.fromRepoPath(this.uri.repoPath!, b.ref), this.view, this, b, false, {
showComparison: this.view.config.showBranchComparison,
showComparison:
this.view instanceof RepositoriesView
? this.view.config.branches.showBranchComparison
: this.view.config.showBranchComparison,
}),
);
if (this.view.config.branches.layout === ViewBranchesLayout.List) return branchNodes;

+ 9
- 8
src/views/nodes/compareBranchNode.ts View File

@ -17,8 +17,8 @@ import { ContextValues, ViewNode } from './viewNode';
export class CompareBranchNode extends ViewNode<BranchesView | CommitsView | RepositoriesView> {
static key = ':compare-branch';
static getId(repoPath: string, name: string): string {
return `${RepositoryNode.getId(repoPath)}${this.key}(${name})`;
static getId(repoPath: string, name: string, root: boolean): string {
return `${RepositoryNode.getId(repoPath)}${this.key}(${name})${root ? ':root' : ''}`;
}
private _children: ViewNode[] | undefined;
@ -29,6 +29,9 @@ export class CompareBranchNode extends ViewNode
view: BranchesView | CommitsView | RepositoriesView,
parent: ViewNode,
public readonly branch: GitBranch,
private readonly showComparison: ViewShowBranchComparison,
// Specifies that the node is shown as a root
public readonly root: boolean = false,
) {
super(uri, view, parent);
@ -52,7 +55,7 @@ export class CompareBranchNode extends ViewNode
}
get id(): string {
return CompareBranchNode.getId(this.branch.repoPath, this.branch.name);
return CompareBranchNode.getId(this.branch.repoPath, this.branch.name, this.root);
}
get repoPath(): string {
@ -162,7 +165,7 @@ export class CompareBranchNode extends ViewNode
};
item.contextValue = `${ContextValues.CompareBranch}${this.branch.current ? '+current' : ''}+${
this.comparisonType
}${this._compareWith == null ? '' : '+comparing'}`;
}${this._compareWith == null ? '' : '+comparing'}${this.root ? '+root' : ''}`;
item.description = description;
item.iconPath = new ThemeIcon('git-compare');
item.id = this.id;
@ -202,8 +205,7 @@ export class CompareBranchNode extends ViewNode
}
private get comparisonType() {
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
return this._compareWith?.type ?? (this.view.config.showBranchComparison || ViewShowBranchComparison.Working);
return this._compareWith?.type ?? this.showComparison;
}
private get compareWithWorkingTree() {
@ -331,8 +333,7 @@ export class CompareBranchNode extends ViewNode
this._compareWith = {
ref: compareWith,
notation: undefined,
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
type: this.view.config.showBranchComparison || ViewShowBranchComparison.Working,
type: this.showComparison,
};
} else {
this._compareWith = compareWith;

+ 1
- 0
src/views/nodes/remoteNode.ts View File

@ -49,6 +49,7 @@ export class RemoteNode extends ViewNode {
const branchNodes = branches.map(
b =>
new BranchNode(GitUri.fromRepoPath(this.uri.repoPath!, b.ref), this.view, this, b, false, {
showComparison: false,
showTracking: false,
}),
);

+ 83
- 43
src/views/nodes/repositoryNode.ts View File

@ -1,11 +1,10 @@
'use strict';
import { Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Disposable, MarkdownString, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { GlyphChars } from '../../constants';
import { Container } from '../../container';
import {
GitBranch,
GitRemote,
GitRevision,
GitStatus,
Repository,
RepositoryChange,
@ -71,45 +70,87 @@ export class RepositoryNode extends SubscribeableViewNode {
);
if (this.view.config.showBranchComparison !== false) {
children.push(new CompareBranchNode(this.uri, this.view, this, branch));
children.push(
new CompareBranchNode(
this.uri,
this.view,
this,
branch,
this.view.config.showBranchComparison,
true,
),
);
}
if (status.upstream) {
if (status.state.behind) {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'behind', true));
}
if (status.state.ahead) {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'ahead', true));
if (this.view.config.showUpstreamStatus) {
if (status.upstream) {
if (!status.state.behind && !status.state.ahead) {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'same', true));
} else {
if (status.state.behind) {
children.push(
new BranchTrackingStatusNode(this.view, this, branch, status, 'behind', true),
);
}
if (status.state.ahead) {
children.push(
new BranchTrackingStatusNode(this.view, this, branch, status, 'ahead', true, {
showAheadCommits: true,
}),
);
}
}
} else {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'none', true));
}
} else {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'none', true));
}
if (status.state.ahead || (status.files.length !== 0 && this.includeWorkingTree)) {
const range = status.upstream ? GitRevision.createRange(status.upstream, branch.ref) : undefined;
if (this.view.config.includeWorkingTree && status.files.length !== 0 ) {
const range = undefined; //status.upstream ? GitRevision.createRange(status.upstream, branch.ref) : undefined;
children.push(new StatusFilesNode(this.view, this, status, range));
}
children.push(new BranchNode(this.uri, this.view, this, branch, true));
if (!this.view.config.compact) {
if (children.length !== 0 && !this.view.config.compact) {
children.push(new MessageNode(this.view, this, '', GlyphChars.Dash.repeat(2), ''));
}
if (this.view.config.showCommits) {
children.push(
new BranchNode(this.uri, this.view, this, branch, true, {
showAsCommits: true,
showComparison: false,
showCurrent: false,
showTracking: false,
}),
);
}
}
children.push(
new BranchesNode(this.uri, this.view, this, this.repo),
new ContributorsNode(this.uri, this.view, this, this.repo),
);
if (this.view.config.showBranches) {
children.push(new BranchesNode(this.uri, this.view, this, this.repo));
}
if (this.view.config.showRemotes) {
children.push(new RemotesNode(this.uri, this.view, this, this.repo));
}
children.push(new ReflogNode(this.uri, this.view, this, this.repo));
if (this.view.config.showStashes) {
children.push(new StashesNode(this.uri, this.view, this, this.repo));
}
if (this.view.config.showTags) {
children.push(new TagsNode(this.uri, this.view, this, this.repo));
}
if (this.view.config.showContributors) {
children.push(new ContributorsNode(this.uri, this.view, this, this.repo));
}
if (this.view.config.showIncomingActivity) {
children.push(new ReflogNode(this.uri, this.view, this, this.repo));
}
children.push(
new RemotesNode(this.uri, this.view, this, this.repo),
new StashesNode(this.uri, this.view, this, this.repo),
new TagsNode(this.uri, this.view, this, this.repo),
);
this._children = children;
}
return this._children;
@ -139,20 +180,20 @@ export class RepositoryNode extends SubscribeableViewNode {
const status = await this._status;
if (status != null) {
tooltip += `\n\nBranch ${status.branch}`;
tooltip += `\n\nCurrent branch $(git-branch) ${status.branch}`;
if (status.files.length !== 0 && this.includeWorkingTree) {
if (this.view.config.includeWorkingTree && status.files.length !== 0) {
workingStatus = status.getFormattedDiffStatus({
compact: true,
prefix: Strings.pad(GlyphChars.Dot, 2, 2),
prefix: Strings.pad(GlyphChars.Dot, 1, 1),
});
}
const upstreamStatus = status.getUpstreamStatus({
prefix: `${GlyphChars.Space} `,
suffix: Strings.pad(GlyphChars.Dot, 1, 1),
});
description = `${status.branch}${upstreamStatus}${workingStatus}`;
description = `${upstreamStatus}${status.branch}${workingStatus}`;
let providerName;
if (status.upstream != null) {
@ -166,10 +207,13 @@ export class RepositoryNode extends SubscribeableViewNode {
iconSuffix = workingStatus ? '-blue' : '';
if (status.upstream != null) {
tooltip += ` is ${status.getUpstreamStatus({
empty: `up to date with ${status.upstream}${providerName ? ` on ${providerName}` : ''}`,
empty: `up to date with $(git-branch) ${status.upstream}${
providerName ? ` on ${providerName}` : ''
}`,
expand: true,
separator: ',',
suffix: ` ${status.upstream}${providerName ? ` on ${providerName}` : ''}`,
icons: true,
separator: ', ',
suffix: ` $(git-branch) ${status.upstream}${providerName ? ` on ${providerName}` : ''}`,
})}`;
if (status.state.behind) {
@ -200,7 +244,7 @@ export class RepositoryNode extends SubscribeableViewNode {
item.contextValue = contextValue;
item.description = `${description ?? ''}${
lastFetched
? `${Strings.pad(GlyphChars.Dot, 2, 2)}Last fetched ${Repository.formatLastFetched(lastFetched)}`
? `${Strings.pad(GlyphChars.Dot, 1, 1)}Last fetched ${Repository.formatLastFetched(lastFetched)}`
: ''
}`;
item.iconPath = {
@ -208,7 +252,7 @@ export class RepositoryNode extends SubscribeableViewNode {
light: Container.context.asAbsolutePath(`images/light/icon-repo${iconSuffix}.svg`),
};
item.id = this.id;
item.tooltip = tooltip;
item.tooltip = new MarkdownString(tooltip, true);
return item;
}
@ -276,7 +320,7 @@ export class RepositoryNode extends SubscribeableViewNode {
);
}
if (this.includeWorkingTree) {
if (this.view.config.includeWorkingTree) {
disposables.push(
this.repo.onDidChangeFileSystem(this.onFileSystemChanged, this),
this.repo.startWatchingFileSystem(),
@ -286,10 +330,6 @@ export class RepositoryNode extends SubscribeableViewNode {
return Disposable.from(...disposables);
}
private get includeWorkingTree(): boolean {
return this.view.config.includeWorkingTree;
}
protected get requiresResetOnVisible(): boolean {
return this._repoUpdatedAt !== this.repo.updatedAt;
}
@ -325,7 +365,7 @@ export class RepositoryNode extends SubscribeableViewNode {
index++;
}
const range = status.upstream ? GitRevision.createRange(status.upstream, status.sha) : undefined;
const range = undefined; //status.upstream ? GitRevision.createRange(status.upstream, status.sha) : undefined;
this._children.splice(index, deleteCount, new StatusFilesNode(this.view, this, status, range));
} else if (index !== -1) {
this._children.splice(index, 1);

+ 23
- 25
src/views/nodes/statusFilesNode.ts View File

@ -70,7 +70,7 @@ export class StatusFilesNode extends ViewNode {
}
}
if (this.status.files.length !== 0 && this.includeWorkingTree) {
if (this.view.config.includeWorkingTree && this.status.files.length !== 0) {
files.splice(
0,
0,
@ -133,29 +133,31 @@ export class StatusFilesNode extends ViewNode {
}
async getTreeItem(): Promise<TreeItem> {
let files = this.includeWorkingTree ? this.status.files.length : 0;
let files = this.view.config.includeWorkingTree ? this.status.files.length : 0;
if (this.status.upstream != null && this.status.state.ahead > 0) {
if (files > 0) {
const aheadFiles = await Container.git.getDiffStatus(this.repoPath, `${this.status.upstream}...`);
if (aheadFiles != null) {
const uniques = new Set();
for (const f of this.status.files) {
uniques.add(f.fileName);
}
for (const f of aheadFiles) {
uniques.add(f.fileName);
if (this.range != null) {
if (this.status.upstream != null && this.status.state.ahead > 0) {
if (files > 0) {
const aheadFiles = await Container.git.getDiffStatus(this.repoPath, `${this.status.upstream}...`);
if (aheadFiles != null) {
const uniques = new Set();
for (const f of this.status.files) {
uniques.add(f.fileName);
}
for (const f of aheadFiles) {
uniques.add(f.fileName);
}
files = uniques.size;
}
files = uniques.size;
}
} else {
const stats = await Container.git.getChangedFilesCount(this.repoPath, `${this.status.upstream}...`);
if (stats != null) {
files += stats.files;
} else {
files = -1;
const stats = await Container.git.getChangedFilesCount(this.repoPath, `${this.status.upstream}...`);
if (stats != null) {
files += stats.files;
} else {
files = -1;
}
}
}
}
@ -172,10 +174,6 @@ export class StatusFilesNode extends ViewNode {
return item;
}
private get includeWorkingTree(): boolean {
return this.view.config.includeWorkingTree;
}
private toStatusFile(file: GitStatusFile, ref: string, previousRef: string, date?: Date): GitFileWithCommit {
return {
status: file.status,

+ 185
- 0
src/views/repositoriesView.ts View File

@ -30,6 +30,10 @@ import {
BranchesNode,
BranchNode,
BranchOrTagFolderNode,
BranchTrackingStatusNode,
CompareBranchNode,
ContributorsNode,
ReflogNode,
RemoteNode,
RemotesNode,
RepositoriesNode,
@ -113,6 +117,110 @@ export class RepositoriesView extends ViewBase
() => this.setShowBranchComparison(false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setBranchesShowBranchComparisonOn'),
() => this.setBranchShowBranchComparison(true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setBranchesShowBranchComparisonOff'),
() => this.setBranchShowBranchComparison(false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowBranchesOn'),
() => this.toggleSection('showBranches', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowBranchesOff'),
() => this.toggleSection('showBranches', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowCommitsOn'),
() => this.toggleSection('showCommits', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowCommitsOff'),
() => this.toggleSection('showCommits', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowContributorsOn'),
() => this.toggleSection('showContributors', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowContributorsOff'),
() => this.toggleSection('showContributors', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowRemotesOn'),
() => this.toggleSection('showRemotes', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowRemotesOff'),
() => this.toggleSection('showRemotes', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowStashesOn'),
() => this.toggleSection('showStashes', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowStashesOff'),
() => this.toggleSection('showStashes', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowTagsOn'),
() => this.toggleSection('showTags', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowTagsOff'),
() => this.toggleSection('showTags', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowUpstreamStatusOn'),
() => this.toggleSection('showUpstreamStatus', true),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowUpstreamStatusOff'),
() => this.toggleSection('showUpstreamStatus', false),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setShowSectionOff'),
(
node:
| BranchesNode
| BranchNode
| BranchTrackingStatusNode
| CompareBranchNode
| ContributorsNode
| ReflogNode
| RemotesNode
| StashesNode
| TagsNode,
) => this.toggleSectionByNode(node, false),
this,
);
}
protected filterConfigurationChanged(e: ConfigurationChangeEvent) {
@ -573,4 +681,81 @@ export class RepositoriesView extends ViewBase
enabled ? ViewShowBranchComparison.Working : false,
);
}
private setBranchShowBranchComparison(enabled: boolean) {
return configuration.updateEffective(
'views',
this.configKey,
'branches',
'showBranchComparison',
enabled ? ViewShowBranchComparison.Branch : false,
);
}
toggleSection(
key:
| 'showBranches'
| 'showCommits'
| 'showContributors'
// | 'showIncomingActivity'
| 'showRemotes'
| 'showStashes'
| 'showTags'
| 'showUpstreamStatus',
enabled: boolean,
) {
return configuration.updateEffective('views', this.configKey, key, enabled);
}
toggleSectionByNode(
node:
| BranchesNode
| BranchNode
| BranchTrackingStatusNode
| CompareBranchNode
| ContributorsNode
| ReflogNode
| RemotesNode
| StashesNode
| TagsNode,
enabled: boolean,
) {
if (node instanceof BranchesNode) {
return configuration.updateEffective('views', this.configKey, 'showBranches', enabled);
}
if (node instanceof BranchNode) {
return configuration.updateEffective('views', this.configKey, 'showCommits', enabled);
}
if (node instanceof BranchTrackingStatusNode) {
return configuration.updateEffective('views', this.configKey, 'showUpstreamStatus', enabled);
}
if (node instanceof CompareBranchNode) {
return this.setShowBranchComparison(enabled);
}
if (node instanceof ContributorsNode) {
return configuration.updateEffective('views', this.configKey, 'showContributors', enabled);
}
if (node instanceof ReflogNode) {
return configuration.updateEffective('views', this.configKey, 'showIncomingActivity', enabled);
}
if (node instanceof RemotesNode) {
return configuration.updateEffective('views', this.configKey, 'showRemotes', enabled);
}
if (node instanceof StashesNode) {
return configuration.updateEffective('views', this.configKey, 'showStashes', enabled);
}
if (node instanceof TagsNode) {
return configuration.updateEffective('views', this.configKey, 'showTags', enabled);
}
return Promise.resolve();
}
}

+ 3
- 3
src/webviews/apps/settings/partials/views.branches.html View File

@ -53,7 +53,7 @@
data-setting
/>
<label for="views.branches.pullRequests.enabled"
>Show associated Pull Requests</label
>Show associated pull requests</label
>
</div>
<p class="setting__hint">
@ -72,7 +72,7 @@
disabled
/>
<label for="views.branches.pullRequests.showForBranches"
>Show the PR associated with each branch</label
>Show the pull request associated with each branch</label
>
</div>
</div>
@ -87,7 +87,7 @@
disabled
/>
<label for="views.branches.pullRequests.showForCommits"
>Show the PR that introduced each commit</label
>Show the pull request that introduced each commit</label
>
</div>
</div>

+ 3
- 3
src/webviews/apps/settings/partials/views.commits.html View File

@ -65,7 +65,7 @@
data-setting
/>
<label for="views.commits.pullRequests.enabled"
>Show associated Pull Requests</label
>Show associated pull requests</label
>
</div>
<p class="setting__hint">
@ -84,7 +84,7 @@
disabled
/>
<label for="views.commits.pullRequests.showForBranches"
>Show the PR associated with the current branch</label
>Show the pull request associated with the current branch</label
>
</div>
</div>
@ -99,7 +99,7 @@
disabled
/>
<label for="views.commits.pullRequests.showForCommits"
>Show the PR that introduced each commit</label
>Show the pull request that introduced each commit</label
>
</div>
</div>

+ 2
- 2
src/webviews/apps/settings/partials/views.contributors.html View File

@ -38,7 +38,7 @@
data-setting
/>
<label for="views.contributors.pullRequests.enabled"
>Show associated Pull Requests</label
>Show associated pull requests</label
>
</div>
<p class="setting__hint">
@ -57,7 +57,7 @@
disabled
/>
<label for="views.contributors.pullRequests.showForCommits"
>Show the PR that introduced each commit</label
>Show the pull request that introduced each commit</label
>
</div>
</div>

+ 3
- 3
src/webviews/apps/settings/partials/views.remotes.html View File

@ -38,7 +38,7 @@
data-setting
/>
<label for="views.remotes.pullRequests.enabled"
>Show associated Pull Requests</label
>Show associated pull requests</label
>
</div>
<p class="setting__hint">
@ -57,7 +57,7 @@
disabled
/>
<label for="views.remotes.pullRequests.showForBranches"
>Show the PR associated with each branch</label
>Show the pull request associated with each branch</label
>
</div>
</div>
@ -72,7 +72,7 @@
disabled
/>
<label for="views.remotes.pullRequests.showForCommits"
>Show the PR that introduced each commit</label
>Show the pull request that introduced each commit</label
>
</div>
</div>

+ 244
- 130
src/webviews/apps/settings/partials/views.repositories.html View File

@ -29,6 +29,224 @@
<div class="settings settings--fixed ml-1">
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<label class="non-interactive">Show the following sections under each repository</label>
</div>
</div>
<div class="settings ml-2">
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input setting__input--inner-select">
<input
id="views.repositories.showBranchComparison"
name="views.repositories.showBranchComparison"
type="checkbox"
value="working"
data-setting
disabled
/>
<label for="views.repositories.showBranchComparison">Comparison of the</label>
<div class="select-container">
<select
id="views.repositories.showBranchComparison"
name="views.repositories.showBranchComparison"
data-setting
data-enablement="views.repositories.enabled &amp; views.repositories.showBranchComparison !false"
disabled
>
<option value="branch">current branch</option>
<option value="working">working tree</option>
</select>
</div>
<label for="views.repositories.showBranchComparison"
>with a user-selected reference (branch, tag, etc)
</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showUpstreamStatus"
name="views.repositories.showUpstreamStatus"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showUpstreamStatus">Current branch status</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.includeWorkingTree"
name="views.repositories.includeWorkingTree"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.includeWorkingTree">Working tree file changes</label>
</div>
</div>
<div class="section__group">
<div class="section__content">
<div class="settings settings--fixed">
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.pullRequests.enabled"
name="views.repositories.pullRequests.enabled"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.pullRequests.enabled"
>Associated pull requests</label
>
</div>
<p class="setting__hint">
Requires a connection to a supported remote service (e.g. GitHub)
</p>
</div>
<div class="settings settings--fixed ml-2">
<div
class="setting"
data-enablement="views.repositories.enabled &amp; views.repositories.pullRequests.enabled"
>
<div class="setting__input">
<input
id="views.repositories.pullRequests.showForBranches"
name="views.repositories.pullRequests.showForBranches"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.pullRequests.showForBranches"
>Show the pull request associated with each branch</label
>
</div>
</div>
<div
class="setting"
data-enablement="views.repositories.enabled &amp; views.repositories.pullRequests.enabled"
>
<div class="setting__input">
<input
id="views.repositories.pullRequests.showForCommits"
name="views.repositories.pullRequests.showForCommits"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.pullRequests.showForCommits"
>Show the pull request that introduced each commit</label
>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showCommits"
name="views.repositories.showCommits"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showCommits">Commits</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showBranches"
name="views.repositories.showBranches"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showBranches">Branches</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showRemotes"
name="views.repositories.showRemotes"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showRemotes">Remotes</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showStashes"
name="views.repositories.showStashes"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showStashes">Stashes</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showTags"
name="views.repositories.showTags"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showTags">Tags</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showContributors"
name="views.repositories.showContributors"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showContributors">Contributors</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showIncomingActivity"
name="views.repositories.showIncomingActivity"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.showIncomingActivity"
>Incoming Activity (experimental)</label
>
</div>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.autoRefresh"
name="views.repositories.autoRefresh"
@ -60,104 +278,13 @@
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.includeWorkingTree"
name="views.repositories.includeWorkingTree"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.includeWorkingTree">Show working tree file changes</label>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input setting__input--inner-select">
<input
id="views.repositories.showBranchComparison"
name="views.repositories.showBranchComparison"
id="views.repositories.avatars"
name="views.repositories.avatars"
type="checkbox"
value="working"
data-setting
disabled
/>
<label for="views.repositories.showBranchComparison">Show a comparison of the</label>
<div class="select-container">
<select
id="views.repositories.showBranchComparison"
name="views.repositories.showBranchComparison"
data-setting
data-enablement="views.repositories.enabled &amp; views.repositories.showBranchComparison !false"
disabled
>
<option value="branch">current branch</option>
<option value="working">working tree</option>
</select>
</div>
<label for="views.repositories.showBranchComparison"
>with a user-selected reference (branch, tag, etc)
</label>
</div>
</div>
<div class="section__group">
<div class="section__content">
<div class="settings settings--fixed">
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.pullRequests.enabled"
name="views.repositories.pullRequests.enabled"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.pullRequests.enabled"
>Show associated Pull Requests</label
>
</div>
<p class="setting__hint">
Requires a connection to a supported remote service (e.g. GitHub)
</p>
</div>
<div class="settings settings--fixed ml-2">
<div
class="setting"
data-enablement="views.repositories.enabled &amp; views.repositories.pullRequests.enabled"
>
<div class="setting__input">
<input
id="views.repositories.pullRequests.showForBranches"
name="views.repositories.pullRequests.showForBranches"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.pullRequests.showForBranches"
>Show the PR associated with each branch</label
>
</div>
</div>
<div
class="setting"
data-enablement="views.repositories.enabled &amp; views.repositories.pullRequests.enabled"
>
<div class="setting__input">
<input
id="views.repositories.pullRequests.showForCommits"
name="views.repositories.pullRequests.showForCommits"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.pullRequests.showForCommits"
>Show the PR that introduced each commit</label
>
</div>
</div>
</div>
</div>
<label for="views.repositories.avatars">Use author avatars</label>
</div>
</div>
@ -180,34 +307,6 @@
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<label for="sortBranchesBy">Sort branches</label>
<div class="select-container">
<select id="sortBranchesBy" name="sortBranchesBy" data-setting disabled>
<option value="name:desc">by name, descending</option>
<option value="name:asc">by name, ascending</option>
<option value="date:desc">by date, descending</option>
<option value="date:asc">by date, ascending</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<label for="sortTagsBy">Sort tags</label>
<div class="select-container">
<select id="sortTagsBy" name="sortTagsBy" data-setting disabled>
<option value="name:desc">by name, descending</option>
<option value="name:asc">by name, ascending</option>
<option value="date:desc">by date, descending</option>
<option value="date:asc">by date, ascending</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<label for="views.repositories.files.layout">Layout files</label>
<div class="select-container">
<select
@ -243,14 +342,29 @@
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.avatars"
name="views.repositories.avatars"
type="checkbox"
data-setting
disabled
/>
<label for="views.repositories.avatars">Use author avatars</label>
<label for="sortBranchesBy">Sort branches</label>
<div class="select-container">
<select id="sortBranchesBy" name="sortBranchesBy" data-setting disabled>
<option value="name:desc">by name, descending</option>
<option value="name:asc">by name, ascending</option>
<option value="date:desc">by date, descending</option>
<option value="date:asc">by date, ascending</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<label for="sortTagsBy">Sort tags</label>
<div class="select-container">
<select id="sortTagsBy" name="sortTagsBy" data-setting disabled>
<option value="name:desc">by name, descending</option>
<option value="name:asc">by name, ascending</option>
<option value="date:desc">by date, descending</option>
<option value="date:asc">by date, ascending</option>
</select>
</div>
</div>
</div>
</div>

+ 2
- 2
src/webviews/apps/settings/partials/views.searchAndCompare.html View File

@ -39,7 +39,7 @@
data-setting
/>
<label for="views.searchAndCompare.pullRequests.enabled"
>Show associated Pull Requests</label
>Show associated pull requests</label
>
</div>
<p class="setting__hint">
@ -58,7 +58,7 @@
disabled
/>
<label for="views.searchAndCompare.pullRequests.showForCommits"
>Show the PR that introduced each commit</label
>Show the pull request that introduced each commit</label
>
</div>
</div>

Loading…
Cancel
Save