Skip to content

Support .git-blame-ignore-revs, so a reformatting commit does not steal ownership #9

Description

@Bubblegunn

The most common objection to a blame-based measurement is that one reformatting commit hands a file to whoever ran the formatter. The tool already answers part of that: -w ignores whitespace-only changes, -M follows moved lines, and --copies adds -C. The remaining piece is the mechanism git itself provides for exactly this, a file of revisions to skip, which projects already keep as .git-blame-ignore-revs for their big reformat commits.

This tool has no support for it. The sibling workproof already has --ignore-revs-file, so the two tools disagree about the same question today.

Done when

  • A flag passes an ignore-revs file through to git blame, named the same as workproof's so somebody using both does not have to remember two spellings.
  • A repository's .git-blame-ignore-revs is picked up by default if it exists, or there is a stated reason in the pull request why it should not be.
  • The chosen file is named in the run's output and in the JSON, because it changes the numbers and a reader must be able to see that it was used.
  • The deterministic sample is unaffected: the same seed and sample rate must still pick the same files. A test should pin that.
  • The README's answer to "reformatting commits steal ownership" is updated; it currently says this is on the roadmap.

Out of scope. Deciding which revisions belong in the file. That is the repository's judgement, not this tool's.


Taking this on: comment and it is yours, so two people do not write the same patch. No design document needed unless the issue asks for one.

What gets a pull request rejected here: a change with no test; a new runtime dependency; or a number written into a README or a document that did not come from a run somebody else can repeat. CONTRIBUTING.md has the rest.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions