Repository navigation
Skip the rustfmt reformat in git blame - #18
Merged
Merged
Conversation
List the formatting commit from #17 in .git-blame-ignore-revs, which GitHub's blame view reads, and say in CONTRIBUTING.md how to make git blame skip it locally. Signed-off-by: Jim Schreckengast <schreck@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
68a23f1, its hash onmain), so GitHub's blame view skips it and credits each line to the commit that last changed its content.git config blame.ignoreRevsFile .git-blame-ignore-revs.Why
The reformat touched 38 files, and without this, blame would point at it for most of their lines. It couldn't be part of #17, because a rebase merge gives the commit a new hash.
Testing
With the file,
git blameattributes the reformatted lines to their earlier commits; only 38 lines that rustfmt created from scratch (such as lone closing brackets) still point at the reformat.