diff --git a/CHANGELOG.md b/CHANGELOG.md
index d42e536..3bb9f76 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,8 +20,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds new stash behaviors to use the Source Control (commit message) input box — closes [#2081](https://github.com/gitkraken/vscode-gitlens/issues/2081)
- When a stash is applied or popped and the Source Control input is empty, we will now update the Source Control input to the stash message
- When stashing changes and the Source Control input is not empty, we will now default the stash message input to the Source Control input value
-- Adds ability to search (Ctrl+F) for text on the Interactive Rebase Editor — closes [#2050](https://github.com/gitkraken/vscode-gitlens/issues/2050)
+- Adds the ability to search (Ctrl+F) for text on the Interactive Rebase Editor — closes [#2050](https://github.com/gitkraken/vscode-gitlens/issues/2050)
- Adds stats (additions & deletions) to files nodes in comparisons — closes [#2078](https://github.com/gitkraken/vscode-gitlens/issues/2078) thanks to help via [PR #2079](https://github.com/gitkraken/vscode-gitlens/pull/2079) by Nafiur Rahman Khadem ([@ShafinKhadem](https://github.com/ShafinKhadem))
+- Adds the ability to uniquely format uncommitted changes for the current line blame annotations — closes [#1987](https://github.com/gitkraken/vscode-gitlens/issues/1987)
+ - Adds a `gitlens.currentLine.uncommittedChangesFormat` setting to specify the uncommitted changes format of the current line blame annotation. **NOTE**: Setting this to an empty string will disable current line blame annotations for uncommitted changes
### Changed
diff --git a/README.md b/README.md
index 161206e..e9669a9 100644
--- a/README.md
+++ b/README.md
@@ -714,13 +714,14 @@ GitLens is highly customizable and provides many configuration settings to allow
## Current Line Blame Settings [#](#current-line-blame-settings- 'Current Line Blame Settings')
-| Name | Description |
-| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `gitlens.currentLine.dateFormat` | Specifies how to format absolute dates (e.g. using the `${date}` token) for the current line blame annotations. See the [Moment.js docs](https://momentjs.com/docs/#/displaying/format/) for supported formats |
-| `gitlens.currentLine.enabled` | Specifies whether to provide a blame annotation for the current line, by default. Use the _Toggle Line Blame Annotations_ command (`gitlens.toggleLineBlame`) to toggle the annotations on and off for the current window |
-| `gitlens.currentLine.format` | Specifies the format of the current line blame annotation. See [_Commit Tokens_](https://github.com/gitkraken/vscode-gitlens/wiki/Custom-Formatting#commit-tokens) in the GitLens docs. Date formatting is controlled by the `gitlens.currentLine.dateFormat` setting |
-| `gitlens.currentLine.pullRequests.enabled` | Specifies whether to provide information about the Pull Request (if any) that introduced the commit in the current line blame annotation. Requires a connection to a supported remote service (e.g. GitHub) |
-| `gitlens.currentLine.scrollable` | Specifies whether the current line blame annotation can be scrolled into view when it is outside the viewport. **NOTE**: Setting this to `false` will inhibit the hovers from showing over the annotation; Set `gitlens.hovers.currentLine.over` to `line` to enable the hovers to show anywhere over the line. |
+| Name | Description |
+| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `gitlens.currentLine.dateFormat` | Specifies how to format absolute dates (e.g. using the `${date}` token) for the current line blame annotations. See the [Moment.js docs](https://momentjs.com/docs/#/displaying/format/) for supported formats |
+| `gitlens.currentLine.enabled` | Specifies whether to provide a blame annotation for the current line, by default. Use the _Toggle Line Blame Annotations_ command (`gitlens.toggleLineBlame`) to toggle the annotations on and off for the current window |
+| `gitlens.currentLine.format` | Specifies the format of the current line blame annotation. See [_Commit Tokens_](https://github.com/gitkraken/vscode-gitlens/wiki/Custom-Formatting#commit-tokens) in the GitLens docs. Date formatting is controlled by the `gitlens.currentLine.dateFormat` setting |
+| `gitlens.currentLine.uncommittedChangesFormat` | Specifies the uncommitted changes format of the current line blame annotation. See [_Commit Tokens_](https://github.com/gitkraken/vscode-gitlens/wiki/Custom-Formatting#commit-tokens) in the GitLens docs. Date formatting is controlled by the `gitlens.currentLine.dateFormat` setting
**NOTE**: Setting this to an empty string will disable current line blame annotations for uncommitted changes. |
+| `gitlens.currentLine.pullRequests.enabled` | Specifies whether to provide information about the Pull Request (if any) that introduced the commit in the current line blame annotation. Requires a connection to a supported remote service (e.g. GitHub) |
+| `gitlens.currentLine.scrollable` | Specifies whether the current line blame annotation can be scrolled into view when it is outside the viewport. **NOTE**: Setting this to `false` will inhibit the hovers from showing over the annotation; Set `gitlens.hovers.currentLine.over` to `line` to enable the hovers to show anywhere over the line. |
## Git CodeLens Settings [#](#git-codelens-settings- 'Git CodeLens Settings')
diff --git a/package.json b/package.json
index 3f722cb..c6cbc36 100644
--- a/package.json
+++ b/package.json
@@ -250,6 +250,13 @@
"scope": "window",
"order": 30
},
+ "gitlens.currentLine.uncommittedChangesFormat": {
+ "type": "string",
+ "default": null,
+ "markdownDescription": "Specifies the uncommitted changes format of the current line blame annotation. See [_Commit Tokens_](https://github.com/gitkraken/vscode-gitlens/wiki/Custom-Formatting#commit-tokens) in the GitLens docs. Date formatting is controlled by the `#gitlens.currentLine.dateFormat#` setting.\n\n**NOTE**: Setting this to an empty string will disable current line blame annotations for uncommitted changes.",
+ "scope": "window",
+ "order": 31
+ },
"gitlens.currentLine.scrollable": {
"type": "boolean",
"default": true,
diff --git a/src/annotations/lineAnnotationController.ts b/src/annotations/lineAnnotationController.ts
index cde60cb..fd3132a 100644
--- a/src/annotations/lineAnnotationController.ts
+++ b/src/annotations/lineAnnotationController.ts
@@ -297,11 +297,13 @@ export class LineAnnotationController implements Disposable {
const decorations = [];
for (const [l, commit] of commitLines) {
+ if (commit.isUncommitted && cfg.uncommittedChangesFormat === '') continue;
+
const decoration = Annotations.trailing(
commit,
// await GitUri.fromUri(editor.document.uri),
// l,
- cfg.format,
+ commit.isUncommitted ? cfg.uncommittedChangesFormat ?? cfg.format : cfg.format,
{
dateFormat: cfg.dateFormat === null ? configuration.get('defaultDateFormat') : cfg.dateFormat,
getBranchAndTagTips: getBranchAndTagTips,
diff --git a/src/config.ts b/src/config.ts
index 757a71f..e20e2c0 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -28,6 +28,7 @@ export interface Config {
dateFormat: string | null;
enabled: boolean;
format: string;
+ uncommittedChangesFormat: string | null;
pullRequests: {
enabled: boolean;
};
diff --git a/src/webviews/apps/settings/partials/current-line.html b/src/webviews/apps/settings/partials/current-line.html
index d36db4e..740eecc 100644
--- a/src/webviews/apps/settings/partials/current-line.html
+++ b/src/webviews/apps/settings/partials/current-line.html
@@ -87,6 +87,63 @@