Skip to content

Commit fa2e6be

Browse files
committed
Splits views.avatars into separate settings per view
1 parent 70b5ed2 commit fa2e6be

File tree

13 files changed

+68
-51
lines changed

13 files changed

+68
-51
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
752752

753753
| Name | Description |
754754
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
755+
| `gitlens.views.repositories.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view |
755756
| `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes |
756757
| `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files |
757758
| `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 `/` |
@@ -790,6 +791,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
790791

791792
| Name | Description |
792793
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
794+
| `gitlens.views.search.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Search Commits_ view |
793795
| `gitlens.views.search.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Search Commits_ view<br />Only applies when `gitlens.views.compare.files.layout` is set to `tree` or `auto` |
794796
| `gitlens.views.search.enabled` | Specifies whether to show the _Search Commits_ view |
795797
| `gitlens.views.search.files.layout` | Specifies how the _Search Commits_ view will display files<br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.compare.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 |
@@ -802,6 +804,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
802804

803805
| Name | Description |
804806
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
807+
| `gitlens.views.compare.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Compare_ view |
805808
| `gitlens.views.compare.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Compare_ view. Only applies when `gitlens.views.compare.files.layout` is set to `tree` or `auto` |
806809
| `gitlens.views.compare.enabled` | Specifies whether to show the _Compare_ view |
807810
| `gitlens.views.compare.files.layout` | Specifies how the _Compare_ view will display files<br /><br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.compare.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 |
@@ -812,7 +815,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
812815

813816
| Name | Description |
814817
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
815-
| `gitlens.views.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the views |
816818
| `gitlens.views.commitFileFormat` | Specifies the format of a committed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path |
817819
| `gitlens.views.commitFileDescriptionFormat` | Specifies the description format of a committed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path |
818820
| `gitlens.views.commitFormat` | Specifies the format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting<br /><br />Available tokens<br />`${id}`&mdash; commit id<br />`${author}` &mdash; commit author<br />`${message}`&mdash; commit message<br />`${ago}` &mdash; relative commit date (e.g. 1 day ago)<br />`${date}`&mdash; formatted commit date (format specified by`gitlens.statusBar.dateFormat`)<br />`${agoOrDate}` &mdash; commit date specified by `gitlens.defaultDateStyle`<br />`${authorAgo}`&mdash; commit author, relative commit date<br />`${authorAgoOrDate}` &mdash; commit author, commit date specified by `gitlens.defaultDateStyle` |

package.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,12 +1199,6 @@
11991199
"markdownDescription": "Specifies the string to be shown in place of the _authors_ code lens when there are unsaved changes",
12001200
"scope": "window"
12011201
},
1202-
"gitlens.views.avatars": {
1203-
"type": "boolean",
1204-
"default": true,
1205-
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the views",
1206-
"scope": "window"
1207-
},
12081202
"gitlens.views.commitFileFormat": {
12091203
"type": "string",
12101204
"default": "${file}",
@@ -1229,6 +1223,12 @@
12291223
"markdownDescription": "Specifies the description format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting\n- Available tokens\n - `${id}` &mdash; commit id\n - `${author}` &mdash; commit author\n - `${message}` &mdash; commit message\n - `${ago}` &mdash; relative commit date (e.g. 1 day ago)\n - `${date}` &mdash; formatted commit date (format specified by `#gitlens.defaultDateFormat#`)\n - `${agoOrDate}` &mdash; commit date specified by `#gitlens.defaultDateStyle#`\n - `${authorAgo}` &mdash; commit author, relative commit date\n - `${authorAgoOrDate}` &mdash; commit author, commit date specified by `#gitlens.defaultDateStyle#`",
12301224
"scope": "window"
12311225
},
1226+
"gitlens.views.compare.avatars": {
1227+
"type": "boolean",
1228+
"default": true,
1229+
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Compare_ view",
1230+
"scope": "window"
1231+
},
12321232
"gitlens.views.compare.enabled": {
12331233
"type": "boolean",
12341234
"default": true,
@@ -1353,6 +1353,12 @@
13531353
"markdownDescription": "Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files",
13541354
"scope": "window"
13551355
},
1356+
"gitlens.views.repositories.avatars": {
1357+
"type": "boolean",
1358+
"default": true,
1359+
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view",
1360+
"scope": "window"
1361+
},
13561362
"gitlens.views.repositories.branches.layout": {
13571363
"type": "string",
13581364
"default": "tree",
@@ -1435,6 +1441,12 @@
14351441
"markdownDescription": "Specifies whether to show the tracking branch when displaying local branches in the _Repositories_ view",
14361442
"scope": "window"
14371443
},
1444+
"gitlens.views.search.avatars": {
1445+
"type": "boolean",
1446+
"default": true,
1447+
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Search Commits_ view",
1448+
"scope": "window"
1449+
},
14381450
"gitlens.views.search.enabled": {
14391451
"type": "boolean",
14401452
"default": true,

src/extension.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
9999
const previous = Versions.fromString(previousVersion);
100100

101101
try {
102-
if (Versions.compare(previous, Versions.from(9, 0, 0)) !== 1) {
102+
if (Versions.compare(previous, Versions.from(9, 2, 2)) !== 1) {
103+
await configuration.migrate('views.avatars', configuration.name('views')('compare')('avatars').value);
104+
await configuration.migrate('views.avatars', configuration.name('views')('repositories')('avatars').value);
105+
await configuration.migrate('views.avatars', configuration.name('views')('search')('avatars').value);
106+
}
107+
else if (Versions.compare(previous, Versions.from(9, 0, 0)) !== 1) {
103108
await configuration.migrate(
104109
'gitExplorer.autoRefresh',
105110
configuration.name('views')('repositories')('autoRefresh').value
@@ -197,7 +202,12 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
197202
configuration.name('views')('search')('location').value
198203
);
199204

200-
await configuration.migrate('explorers.avatars', configuration.name('views')('avatars').value);
205+
await configuration.migrate('explorers.avatars', configuration.name('views')('compare')('avatars').value);
206+
await configuration.migrate(
207+
'explorers.avatars',
208+
configuration.name('views')('repositories')('avatars').value
209+
);
210+
await configuration.migrate('explorers.avatars', configuration.name('views')('search')('avatars').value);
201211
await configuration.migrate(
202212
'explorers.commitFileFormat',
203213
configuration.name('views')('commitFileFormat').value
@@ -207,15 +217,6 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
207217
'explorers.defaultItemLimit',
208218
configuration.name('views')('defaultItemLimit').value
209219
);
210-
await configuration.migrate(
211-
'explorers.files.compact',
212-
configuration.name('views')('files')('compact').value
213-
);
214-
await configuration.migrate('explorers.files.layout', configuration.name('views')('files')('layout').value);
215-
await configuration.migrate(
216-
'explorers.files.threshold',
217-
configuration.name('views')('files')('threshold').value
218-
);
219220
await configuration.migrate(
220221
'explorers.stashFileFormat',
221222
configuration.name('views')('stashFileFormat').value

src/ui/config.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export interface CodeLensLanguageScope {
237237
}
238238

239239
export interface CompareViewConfig {
240+
avatars: boolean;
240241
enabled: boolean;
241242
files: ViewsFilesConfig;
242243
location: 'explorer' | 'gitlens' | 'scm';
@@ -248,7 +249,11 @@ export interface FileHistoryViewConfig {
248249
location: 'explorer' | 'gitlens' | 'scm';
249250
}
250251

251-
export interface LineHistoryViewConfig extends FileHistoryViewConfig {}
252+
export interface LineHistoryViewConfig {
253+
avatars: boolean;
254+
enabled: boolean;
255+
location: 'explorer' | 'gitlens' | 'scm';
256+
}
252257

253258
export interface MenuConfig {
254259
editor:
@@ -336,6 +341,7 @@ export interface RemotesUrlsConfig {
336341
export interface RepositoriesViewConfig {
337342
autoRefresh: boolean;
338343
autoReveal: boolean;
344+
avatars: boolean;
339345
branches: {
340346
layout: ViewBranchesLayout;
341347
};
@@ -348,19 +354,14 @@ export interface RepositoriesViewConfig {
348354
}
349355

350356
export interface SearchViewConfig {
357+
avatars: boolean;
351358
enabled: boolean;
352359
files: ViewsFilesConfig;
353360
location: 'explorer' | 'gitlens' | 'scm';
354361
}
355362

356363
export interface ViewsConfig {
357-
avatars: boolean;
358364
fileHistory: FileHistoryViewConfig;
359-
files: {
360-
layout: ViewFilesLayout;
361-
compact: boolean;
362-
threshold: number;
363-
};
364365
commitFileDescriptionFormat: string;
365366
commitFileFormat: string;
366367
commitDescriptionFormat: string;

0 commit comments

Comments
 (0)