From 3dd0d626c65fd81f2697389e75efef7aad2aa088 Mon Sep 17 00:00:00 2001 From: Sven van Heugten Date: Fri, 6 Mar 2026 04:29:23 +0100 Subject: [PATCH] Add README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3cbcbe4 --- /dev/null +++ b/README.md @@ -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 ` + +It differs from [grepdiff](https://linux.die.net/man/1/grepdiff) in that it doesn’t 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 doesn’t make the mechanical change everywhere, but only in the lines that your original diff also made it.