-
When using automated code formatters to format a legacy project (read: code not matching an automated code formatter's style) it would be splendid to be able to make sure the commits related to the reformatting wouldn't be taken into account in GitHub's blame page. Here's some background in the docs for Python's popular "black" code formatter: https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html#avoiding-ruining-git-blame
In case anyone wants to spread the call for this feature in their network, feel free to retweet https://twitter.com/jezdez/status/1425467443242221571 🥳 NOTE: Please use the arrow in the top left corner (on Desktop) or below the text (on mobile) to upvote this, in addition to the 👍🏻! |
Beta Was this translation helpful? Give feedback.
Replies: 23 comments 65 replies
-
Linking the 1-year-old github community post here There are 150+ votes from there |
Beta Was this translation helpful? Give feedback.
-
Not only does this matter when updating legacy code bases, but also when updating versions of those formatters. I don't recall if there was a reason, but |
Beta Was this translation helpful? Give feedback.
-
This is a really demanded and useful feature, especially for projects that are formatted after long durations - or formatters being changed. expecting a timely resolution of this :) |
Beta Was this translation helpful? Give feedback.
-
Thank you for suggesting this! It would be such a valuable feature. It's currently on our backlog and we will give it high priority. I can't yet provide a definite date because we're still sizing it and determining how the blame UI should adapt. Current thinking is that if a
Please reply if you will need one of the options above or have other suggestions. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@davidstaheli Thank you for acknowledging this.
TBH that would be a great start. Technically you can merge multi ignores flies into one, so I don't think supporting multiple ignore files should block the initial feature rollout. I am super excited now 😄 |
Beta Was this translation helpful? Give feedback.
-
That would be enough for the WordPress project to list commits with automated code formatting applied at a large scale. We want to include the file in WordPress/gutenberg#37822 with the same name to improve the experience when executing git blame locally. However, it would be phenomenal if it would work out of the box on GitHub seamlessly 😄 |
Beta Was this translation helpful? Give feedback.
-
Trying to understand this... Wouldn't it require the committer to have the discipline to use dedicated commits for changes triggered by automated code formatters? Say in case there are actual changes to the code mixed with reformatting triggered by an automated code formatter. I'm just thinking aloud. Not implying anything, being rhetorical nor sarcastic. |
Beta Was this translation helpful? Give feedback.
-
@dreamyguy For my case, we use auto-formatting in a couple of languages and individual commits often do shuffle things around, but those aren't that problematic from a git blame perspective because they're co-located with actual semantic changes. This feature is intended for large, repo-wide reformatting where modifications to files without behavioral changes break the blame chain. Your question is great one, but it's related to the underlying git feature rather than what this issue is asking of github itself, which is |
Beta Was this translation helpful? Give feedback.
-
Update: implementation of this feature is in progress |
Beta Was this translation helpful? Give feedback.
-
Update: Ignoring commits in the blame view is available as a public beta to anyone now 🎉 For more information see the documentation. Hey everyone 👋 we have an early version available in a private beta and would love to get a few more thoughts. If anyone is interested in trying it out early, please let me know with a comment below and we'll enable it for you or your organization account. Once enabled, you must add a file called |
Beta Was this translation helpful? Give feedback.
-
@dipree @davidstaheli Can we also ignore this commits in "Reviewers suggestions"? 🤔 For example, @django-bot is suggested in Django in almost all PRs: because we used it for Black reformatting. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
27 Oca 2022 Per 14:24 tarihinde Wallace Sidhrée ***@***.***>
şunu yazdı:
… Trying to understand this... Wouldn't it require the committer to have the
discipline to use dedicated commits for changes triggered by automated code
formatters?
I'm just thinking aloud. Not implying anything, being rhetorical nor
sarcastic.
—
Reply to this email directly, view it on GitHub
<#5033 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXMXN5L3AGCUFSSJOKF47CTUYETQTANCNFSM5B6VRYQQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
So after thinking about it for a bit, I'm wondering... Could it be made possible to disable this feature when, for some reason, you would want to include changes from ignored revisions in the blame? The default should most definitely be to hide revisions specified in |
Beta Was this translation helpful? Give feedback.
-
Did this literally just launch to non-private beta? I saw an inconsistency with the "Learn more" url form the notification - could have been cached? |
Beta Was this translation helpful? Give feedback.
-
@dipree This seems to have broken the blame view for one of our files in an internal repo (fully empty blame view). Is there a bug tracker / known list of issues with the feature? |
Beta Was this translation helpful? Give feedback.
-
@dipree Love it! It would be great if this file could also be loaded from |
Beta Was this translation helpful? Give feedback.
-
@dipree I tried it on our repo and it only works partially. The ignored commits still showed up but affected to less lines. Any advice? |
Beta Was this translation helpful? Give feedback.
-
Does this work with the new pull request interface? I have a repo where:
The PR viewer still shows the line ending changes despite the original commit being in |
Beta Was this translation helpful? Give feedback.
-
Is there a way to opt out of ignoring the commits from the GitHub blame UI using a button or something? Folks might still be interested in taking a look at the ignored changes even if the |
Beta Was this translation helpful? Give feedback.
-
as coding standard change we use linters and formatter, which breaks GitHub blame |
Beta Was this translation helpful? Give feedback.
-
Are there any plans to support |
Beta Was this translation helpful? Give feedback.
-
It would be great if the GitHub Insights tab took the |
Beta Was this translation helpful? Give feedback.
Update:
Ignoring commits in the blame view is available as a public beta to anyone now 🎉 For more information see the documentation.
Hey everyone 👋 we have an early version available in a private beta and would love to get a few more thoughts. If anyone is interested in trying it out early, please let me know with a comment below and we'll enable it for you or your organization account.
Once enabled, you must add a file called
.git-blame-ignore-revs
to the root level of your repository. That file must contain the revisions (commit hashes) you want to ignore. The blame view of the repository will then be loaded with the--ignore-revs-file
parameter and ignores the specified revisions.