-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for hyper-blame? #413
Comments
@banga @jyavenard Can you provide more details on to how adding hyper-blame support would be useful for GitLens? |
Hyper-blame allows to define commits that must ignored. This is particularly useful for commits that were whitespace changes only, such as reformatting or code style change. For the Mozilla gecko tree we have very recently started to move from the Mozilla coding style to Google's. Plain git blame would make every lines appear to be last modified by the coding style change commit. Making git blame absolutely useless. |
@jyavenard Thanks. How do you define those commits? In a config file or something? Would GitLens need to know about that? I'm trying to both understand the benefit and the work involved. |
There's a .git-blame-ignore-revs file like so Gitlens doesn't need to know about it, only the custom git blame command |
@jyavenard Could you provide me the output of a Here is the command GitLens uses for blaming: |
@eamodio unfortunately There's an example here which illustrates the difference: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html. If you want to try it out, you can follow these steps: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up. |
Another option would be for gitlens to implement git blame in terms of more low-level git operations and take into account |
Since git 2.23 this is supported by default, so no need for hyperblame! https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt |
Just tried this and it works beautifully, thanks! |
@banga Did you set this view the git config setting or did you use the |
Note: It must be entered in gitlens as two separate items, if you enter it as a single line it won't work. Also, you can set this option by setting the file(s) you want to use as the value to the git configuration blame.ignoreRevsFile. |
Since Git now natively supports this and can be used with GitLens I'm going to close this. |
I'm googling around trying to learn exactly how to use this new file, |
Yes, see #413 (comment) |
Thanks for hinting in the right direction, @banga ! 🚀 For some reason I can't get it to work, though, as Any help is greatly appreciated! 🙏🏻 Edit (solved)I figured out that I should just have used Ctrl + Shift + P > Developer: Reload Window to reload the window and force the settings to take effect. For case a) I simply added the file name without any folder specification: |
I noticed a few issues. I had
My repo's .gitconfig file is:
my .vscode/settings.json file:
Other vscode settings people may be interested in:
|
Despite including the .gitconfig file, I had to also get the vscode setting correct to get gitlens to use the .git-blame-ignore-revs file and ignore certain changes. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
We have started using
git hyper-blame
(provided as part of Chrome's Depot Tools) at quip, which supports skipping over commits that are part of mass refactoring:https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html.
Would there be interest in supporting a flag to switch to using
hyper-blame
instead ofblame
? This would make GitLens even more useful for large teams that have to do a lot of refactors.Thanks!
The text was updated successfully, but these errors were encountered: