Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add inline git blame annotations #205424

Closed
deadmeu opened this issue Feb 17, 2024 · 15 comments
Closed

[Feature Request] Add inline git blame annotations #205424

deadmeu opened this issue Feb 17, 2024 · 15 comments
Assignees
Labels
feature-request Request for new features or functionality git GIT issues on-testplan
Milestone

Comments

@deadmeu
Copy link

deadmeu commented Feb 17, 2024

One of the first things I (and I presume many other developers) do when installing a new text editor or IDE is to enable inline git blame annotations (either natively, if the editor supports it, or via an extension).

Inline git blame annotations make it extremely easy to see when a particular line was last modified without requiring the user to perform clicks in order to get that information.

Additionally, the user should be able to interact with this annotation by hovering the cursor over the text, in order to quickly get a more detailed view of the commit.

I think it makes sense to include this feature as a native feature within VS Code, rather than relying on third-party extensions, as VS Code already includes native git tooling and this highly popular feature builds upon existing features to provide a great QOL improvement and make it easier for developers (both new and old) to work with git.

@IllusionMH
Copy link
Contributor

As you've mentioned extensions in first part: have you tried GitLens extension?
I think it supports feature you are looking for and many other.

@deadmeu
Copy link
Author

deadmeu commented Feb 18, 2024

As you've mentioned extensions in first part: have you tried GitLens extension? I think it supports feature you are looking for and many other.

Yes I have. GitLens does have the exact features I'm describing but it also includes many others which I don't want or need. Many of these features get in the way of my editor and I don't think its reasonable to expect users to have to install a large extension like this one (and go through a lengthy configuration process to disable what they don't need) for simple inline blame annotations.

I also don't like how GitKraken advertises their commercial services to users. For example, I have a GitKraken Pro (Trial) message in my status bar, which I can't seem to disable. Additionally, I have received notifications in VS Code from the GitLens extension advertising its subscription services to me, which I don't think is necessary.

The popularity of GitLens and similar extensions has shown that users really value solid git integration within their editor, so I think it makes sense to integrate inline git blame annotations natively into VS Code. Other git enhancements, like #179053, #191693, and #203873, would also be great to see, but this issue is specifically focused on inline blame annotations.

@deadmeu
Copy link
Author

deadmeu commented Feb 18, 2024

It might be worth including that this is a popular idea amongst other editors as well. For example, here's a feature request for this feature to be included in the newly released Zed editor zed-industries/zed#4793.

@lszomoru lszomoru added feature-request Request for new features or functionality git GIT issues labels Feb 18, 2024
@lszomoru lszomoru added this to the Backlog milestone Feb 18, 2024
@Keavon
Copy link

Keavon commented Feb 20, 2024

I found GitLens far too intrusive, but I've really liked the simple Git Blame extension. It shows the blame information in the status bar, rather than inline, which differs from OP's request but I personally find this preferable since it's available at-a-glance but not constantly in the way of my coding.

@jbrodriguez
Copy link

i don't like gitlens/kraken intrusiveness of their commercial offerings either, i switched to Git Blame months ago too, but it was only TODAY i learned that you can turn on inline blames 🤦‍♂️

inline blame

this should be more prominent on the extension docs

even though something native will probably be more efficient, this will do for me

@joaomoreno
Copy link
Member

joaomoreno commented Jul 18, 2024

@lszomoru Dupe of #203841 ?

@lszomoru
Copy link
Member

No. #203841 is git blame for the whole file that is being shown in the gutter.

@gayanper
Copy link
Contributor

Zed editor already has native support for git blame now zed-industries/zed#10398, when are we going to get it natively in vscode ?

As everyone has told, Git Lense is really intrusive, even switching off pro feature, still they try to advertise their pro feature like the git graph. 100s of settings on each feature makes it really hard to get some simple thing done related to git. Recently I got rid of git lens and started to use default vscode support for day to day git operation which proves to be more efficient. what is missing is full repo log view (currently using Git Graph extension) and Git Blame, which doesn't have a very good alternative in market place.

@igorstr
Copy link

igorstr commented Oct 20, 2024

Any updates on this topic?

@lszomoru
Copy link
Member

lszomoru commented Nov 27, 2024

In the latest VS Code Insiders you can enable git blame editor decorations and the git blame status bar entry using the following settings: git.blame.editorDecoration.enabled, git.blame.statusBarItem.enabled. You can also control the format of the message being showing the editor in the status bar using the following settings: git.blame.editorDecoration.template, git.blame.statusBarItem.template.

Please give it a try and let me know if you run into any issues. Thank you!

@sanket-bhalerao
Copy link

this feature is awesome. Kudos @lszomoru 👏

@sanket-bhalerao
Copy link

The feature is working great. The blames come immediately (i felt some lag a couple of days ago, however it is smooth now).
i used the Gitlens extension mostly for the blames (the other thing i used for it was exploring the stashes and the rebase editor. i am hopeful that a stash explorer kind of feature will debut in VSCode sooner or later.)
Great feature.
Thank you.

@boraozgen
Copy link

I don't know if this is the right place to give feedback, but here you go. I'm very glad that this was integrated into the editor and finally I can remove GitLens.

As for an improvement, I was used to the darker color of the decoration from GitLens (I use the Dark Modern theme), so the default color (#777777) was too bright for me. I adjusted it to #555555 and now it's perfect. So maybe the default colors could be adjusted so that the decoration is more subtle.

@lszomoru
Copy link
Member

Thank you very much for the feedback. Yes, we are actively looking at adjusting the color of the editor decoration.

@sanket-bhalerao
Copy link

i have mine set to "git.blame.editorDecorationForeground": "#f8f8ff3f"
i am using dark mode in vscode.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues on-testplan
Projects
None yet
Development

No branches or pull requests

10 participants