Cache successful commits

```git-check-assertions
run test/git-check-assertions.bats
assert_success

git checkout HEAD~1 bin
run test/git-check-assertions.bats
assert_failure
assert_output --partial "file exists, but it was expected to be absent"
```
This commit is contained in:
Sven van Heugten 2026-03-10 06:38:45 +01:00
parent fea90637e3
commit e647b2599b
No known key found for this signature in database
GPG key ID: D612F88666F4F660
4 changed files with 80 additions and 1 deletions

View file

@ -73,6 +73,12 @@ You can technically assert that a command fails by writing `! ... || exit 1`, or
I'm considering taking `bats-assert` as a dependency, but for now, this very minimal set of functions with a similar interface should get you on your way.
## Cache of successful commits
After a commit's assertions run successfully, `git-check-assertions` appends the commit hash to `.git-check-assertions-cache` in the repo root. On the next run, any commit listed there is skipped.
Be sure to add `.git-check-assertions-cache` to your `.gitignore`.
## Examples of commit messages
Assert that a commit builds: