Add README

This commit is contained in:
Sven van Heugten 2026-03-06 04:29:23 +01:00
parent 2aebae7aff
commit 3dd0d626c6
No known key found for this signature in database
GPG key ID: D612F88666F4F660

9
README.md Normal file
View file

@ -0,0 +1,9 @@
# mechanicaldiff
`mechanicaldiff` lets you filter down a diff to _only_ the parts that make a specific mechanical change, so you can commit those changes separately.
Usage: `git diff | mechanicaldiff <pattern> <replacement>`
It differs from [grepdiff](https://linux.die.net/man/1/grepdiff) in that it doesnt just search for the lines that contain the given `pattern`, but also checks that the _only_ change in that line is that `pattern` was replaced with the given `replacement`.
It differs from simply replacing `pattern` with `replacement` in the entire repository in that it filters down an _existing_ diff, which means that the resulting diff doesnt make the mechanical change everywhere, but only in the lines that your original diff also made it.