Skip to content

Commit

Permalink
Add .git-blame-ignore-revs
Browse files Browse the repository at this point in the history
The added `.git-blame-ignore-revs` file can be used with `git blame`
to ignore certain commits when blaming, which is useful
when we want to commit large formatting changes without messing up
the output of `git blame`. Also, by adding this file to the repo
`GitHub` will pick it up automatically and ignore the listed commits.

Usage:
`git blame --ignore-revs-file .git-blame-ignore-revs somefile.ext`
However, it is highly recommended that you configure `git blame`
locally to always ignore the commits specified in
`.git-blame-ignore-revs`. You can do this by running the following
from the repository's root:
`git config blame.ignoreRevsFile .git-blame-ignore-revs`.
From then on, you can just run `git blame somefile.ext` and ignoring
will also work for git porcelains and integrations automatically.
  • Loading branch information
Lucsanszky committed Nov 20, 2024
1 parent 9a5ec23 commit f06163b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### NOTE
# Run `git config blame.ignoreRevsFile .git-blame-ignore-revs`
# from the repository's root to tell `git blame` to ignore
# the commits below.

# `fourmolize`
# CommitDate: Wed Nov 20 17:31:16 2024 +0100
14e82fce8c6f5b29b2018a1d4fc68c7d8ada256a
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ to the issue. -->
[versioning process](https://github.com/intersectmbo/cardano-base/blob/master/RELEASING.md#versioning-process).
- [ ] The version bounds in `.cabal` files for all affected packages are updated.
**_If you change the bounds in a cabal file, that package itself must have a version increase._** (See [RELEASING.md](https://github.com/intersectmbo/cardano-base/blob/master/RELEASING.md#versioning-process))
- [ ] Commits that only contain large amounts of formatting changes were added to `.git-blame-ignore-revs`
- [ ] Self-reviewed the diff
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ infrastructure:
We use trunk based developement. Normal development will branch off of master and be
merged back to master.

### Recommended `git` configuration

Once you cloned the repository, it is recommended to run the following
from the repository's root:
```bash
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
This way `git blame` will ignore the commits specified in the `.git-blame-ignore-revs`
file. This can come in handy if you want to exclude large commits
with only formatting changes.
You can ignore the above however, if you tend to look at `git blame`
through GitHub. In that case, you don't have to do anything,
as GitHub will pick up `.git-blame-ignore-revs` automatically and ignore
the specified commits.

If you want to add further revisions to the `ignore-revs` file,
just prepend the full commit hash that you want `git blame` to ignore
and add the commit's title and date as a comment for clarity.

### Releasing and versioning

Packages from `cardano-base` are released to
Expand Down

0 comments on commit f06163b

Please sign in to comment.