diff --git a/README.md b/README.md index a037e06..4acf37d 100644 --- a/README.md +++ b/README.md @@ -820,6 +820,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings') | `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

Available tokens
`${id}`— commit id
`${author}` — commit author
`${message}`— commit message
`${ago}` — relative commit date (e.g. 1 day ago)
`${date}`— formatted commit date (format specified by`gitlens.statusBar.dateFormat`)
`${agoOrDate}` — commit date specified by `gitlens.defaultDateStyle`
`${authorAgo}`— commit author, relative commit date
`${authorAgoOrDate}` — commit author, commit date specified by `gitlens.defaultDateStyle` | | `gitlens.views.commitDescriptionFormat` | 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

Available tokens
`${id}`— commit id
`${author}` — commit author
`${message}`— commit message
`${ago}` — relative commit date (e.g. 1 day ago)
`${date}`— formatted commit date (format specified by`gitlens.statusBar.dateFormat`)
`${agoOrDate}` — commit date specified by `gitlens.defaultDateStyle`
`${authorAgo}`— commit author, relative commit date
`${authorAgoOrDate}` — commit author, commit date specified by `gitlens.defaultDateStyle` | | `gitlens.views.defaultItemLimit` | Specifies the default number of items to show in a view list. Use 0 to specify no limit | +| `gitlens.views.showRelativeDateMarkers` | Specifies whether to show relative date markers (_Less than a week ago_, _Over a week ago_, _Over a month ago_, etc) on revision (commit) histories in the views | | `gitlens.views.stashFileFormat` | Specifies the format of a stashed file in the views

Available tokens
`${directory}` — directory name
`${file}` — file name
`${filePath}` — formatted file name and path
`${path}` — full file path | | `gitlens.views.stashFileDescriptionFormat` | Specifies the description format of a stashed file in the views

Available tokens
`${directory}` — directory name
`${file}` — file name
`${filePath}` — formatted file name and path
`${path}` — full file path | | `gitlens.views.stashFormat` | Specifies the format of stashed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting

Available tokens
`${id}` — commit id
`${author}` — commit author
`${message}` — commit message
`${ago}` — relative commit date (e.g. 1 day ago)
`${date}`— formatted commit date (format specified by `gitlens.statusBar.dateFormat`)
`${agoOrDate}` — commit date specified by `gitlens.defaultDateStyle`
`${authorAgo}` — commit author, relative commit date
`${authorAgoOrDate}` — commit author, commit date specified by `gitlens.defaultDateStyle` | diff --git a/package.json b/package.json index dc2f19e..d34e789 100644 --- a/package.json +++ b/package.json @@ -1497,6 +1497,12 @@ "markdownDescription": "Specifies where to show the _Search Commits_ view", "scope": "window" }, + "gitlens.views.showRelativeDateMarkers": { + "type": "boolean", + "default": true, + "markdownDescription": "Specifies whether to show relative date markers (_Less than a week ago_, _Over a week ago_, _Over a month ago_, etc) on revision (commit) histories in the views", + "scope": "window" + }, "gitlens.views.stashFileFormat": { "type": "string", "default": "${file}", diff --git a/src/ui/config.ts b/src/ui/config.ts index 9faec72..5e76c97 100644 --- a/src/ui/config.ts +++ b/src/ui/config.ts @@ -372,6 +372,7 @@ export interface ViewsConfig { lineHistory: LineHistoryViewConfig; repositories: RepositoriesViewConfig; search: SearchViewConfig; + showRelativeDateMarkers: boolean; stashFileDescriptionFormat: string; stashFileFormat: string; stashDescriptionFormat: string; diff --git a/src/views/nodes/helpers.ts b/src/views/nodes/helpers.ts index 4b553c1..532bdc3 100644 --- a/src/views/nodes/helpers.ts +++ b/src/views/nodes/helpers.ts @@ -36,6 +36,10 @@ export function* insertDateMarkers { + if (!parent.view.config.showRelativeDateMarkers) { + return yield* iterable; + } + let index = skip || 0; let time = undefined; const now = Date.now();