Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

chore: set up git-blame-ignore-revs #974

Merged
merged 6 commits into from
Aug 15, 2022
Merged

Conversation

0xApotheosis
Copy link
Member

This PR sets up a .git-blame-ignore-revs so that formatting commits are ignored in git blame on both GibHub, locally, and in IDEs.

We already have this set up in web, introduced here: shapeshift/web#1438

  • A .git-blame-ignore-revs file has been implemented, which allows us to prevent lint commits showing up when using git blame on GitHub.
  • A .gitconfig file is added which allows IDEs (tested on WebStorm and VSCode) to respect all skipped commits
  • postinstall.sh has been updated to automatically use the .gitconfig locally once yarn / yarn install is run

It also works locally by using git blame --ignore-revs-file .git-blame-ignore-revs.

For more information on this feature, please see here: https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view

@0xApotheosis 0xApotheosis requested a review from a team as a code owner August 15, 2022 04:42
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

LGTM, added the trailing commas lint hash to .git-blame-ignore-revs in 999a58f:

  • Good ol' git blame with no flags:

image

  • git blame with --ignore-revs-file flag:

image

Note that vscode gitlens users can automagically have hyper-blame by configuring it like so:

gitkraken/vscode-gitlens#413 (comment)

Alternatively, or if not using VSCode, setting the blame.ignoreRevsFile option globally will automagically apply the --ignore-revs-file:

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

@gomesalexandre gomesalexandre enabled auto-merge (squash) August 15, 2022 10:59
@gomesalexandre gomesalexandre merged commit a89a226 into main Aug 15, 2022
@gomesalexandre gomesalexandre deleted the set-up-post-install branch August 15, 2022 11:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants