Skip to content

Skip the rustfmt reformat in git blame - #18

Merged
schreck61 merged 1 commit into
mainfrom
blame-ignore-rustfmt
Nov 11, 2026
Merged

schreck61 merged 1 commit into
mainfrom
blame-ignore-rustfmt

Conversation

@schreck61

Copy link
Copy Markdown
Owner

What

  • .git-blame-ignore-revs lists the formatting commit from Adopt rustfmt and check formatting in CI #17 (68a23f1, its hash on main), so GitHub's blame view skips it and credits each line to the commit that last changed its content.
  • CONTRIBUTING.md says how to do the same locally: 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 blame attributes 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.

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>
@schreck61
schreck61 enabled auto-merge (rebase) November 11, 2026 15:14
@schreck61
schreck61 merged commit ac97077 into main Nov 11, 2026
12 checks passed
@schreck61
schreck61 deleted the blame-ignore-rustfmt branch November 11, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant