IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 14 forks source link

Add .git-blame-ignore-revs file #881

Closed smelc closed 1 week ago

smelc commented 1 week ago

Changelog

- description: |
    Ignore reformatting changes (introduction of fourmolu) in calls to `git blame`
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

https://github.com/IntersectMBO/cardano-cli/pull/835 and in particular commit 9d1fd09 (#835) changed the formatting of all files, erasing the git blame history.

This PR uses .git-blame-ignore-revs to fix that in vscode. You can also set the blame.ignoreRevsFile option in your .git/config for terminal calls to git blame to use this file, like this:

[blame]
        ignoreRevsFile = .git-blame-ignore-revs

How to trust this PR

GitHub

GitHub honors the .git-blame-ignore-revs file, as visible here: https://github.com/IntersectMBO/cardano-cli/blame/ec2fd8de4e123ccb45afc866880171963b82cb5f/cardano-cli/src/Cardano/CLI/EraBased/Run/Query.hs

image

gitlens

Compare the behavior of gitlens in vscode before and after this PR:

blame-before

blame-after

I could not find a reference that gitlens honors the .git-blame-igonre-revs file (I could only find references of people requesting it, and explanations how to setup the corresponding option), but it actually does, as the screenshots above show.

CONTRIBUTING.MD

Please see the rendered version: https://github.com/IntersectMBO/cardano-cli/blob/smelc/git-blame-ignore-reformatting/CONTRIBUTING.md#improving-git-blame