Skip to content

Ignore big reformatting commits in GitHub blame UI#4741

Merged
waiting-for-dev merged 1 commit intosolidusio:masterfrom
nebulab:kennyadsl/blame-ignore-reformatting-commits
Nov 29, 2022
Merged

Ignore big reformatting commits in GitHub blame UI#4741
waiting-for-dev merged 1 commit intosolidusio:masterfrom
nebulab:kennyadsl/blame-ignore-reformatting-commits

Conversation

@kennyadsl
Copy link
Copy Markdown
Member

@kennyadsl kennyadsl commented Nov 24, 2022

Summary

By adding a .git-blame-ignore-revs file that contains the commits that git blame will ignore, we are able to remove them from the blame view when using this feature.

See https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view for extra details.

From that link it's worth mentioning that:

If the blame view for a file shows Ignoring revisions in .git-blame-ignore-revs, you can still bypass .git-blame-ignore-revs and see the normal blame view. In the URL, append a ~ to the SHA and the Ignoring revisions in .git-blame-ignore-revs will disappear.

For now, I added just a couple of big commits, but we can add more with time.

This same behavior can be enabled locally with:

git config blame.ignoreRevsFile .git-blame-ignore-revs

This config is not suitable as a global config though, because it will fail on repositories that do not have the file set.

Other resources:

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):

  • I have added automated tests to cover my changes.
  • I have attached screenshots to demo visual changes.
  • I have opened a PR to update the guides.
  • ~I have updated the README to account for my changes.

By adding a .git-blame-ignore-revs file that contains the commits that
git blame will ignore, we are able to remove them from the blame view
when using this feature.

See https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
for extra details.

For now, I added just a couple of big commits, but we can add more with
time.

This same behavior can be enabled locally with:

	git config blame.ignoreRevsFile .git-blame-ignore-revs

This config is not suitable as a global config though, because it will
fail on repositories that do not have the file set.
@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label Nov 24, 2022
@kennyadsl kennyadsl self-assigned this Nov 24, 2022
Copy link
Copy Markdown
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!!

Copy link
Copy Markdown
Member

@jarednorman jarednorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's pretty cool.

@waiting-for-dev waiting-for-dev merged commit 1829fc8 into solidusio:master Nov 29, 2022
@waiting-for-dev waiting-for-dev deleted the kennyadsl/blame-ignore-reformatting-commits branch November 29, 2022 04:09
@waiting-for-dev waiting-for-dev added the changelog:repository Changes to the repository not within any gem label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:repository Changes to the repository not within any gem type:enhancement Proposed or newly added feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants