No description
Find a file
2026-03-06 17:31:27 +01:00
bin Fix changes sometimes disappearing entirely 2026-03-06 17:30:41 +01:00
test Fix order of arguments to assert_equal 2026-03-06 17:30:58 +01:00
.editorconfig Add devshell and initial bats tests 2026-03-05 19:36:24 +01:00
.gitignore Add boilerplate 2026-03-05 17:26:52 +01:00
default.nix Fix changes sometimes disappearing entirely 2026-03-06 17:30:41 +01:00
flake.lock Add boilerplate 2026-03-05 17:26:52 +01:00
flake.nix Fix changes sometimes disappearing entirely 2026-03-06 17:30:41 +01:00
LICENSE Add LICENSE 2026-03-05 21:11:29 +01:00
README.md Document the need to use recountdiff 2026-03-06 17:31:27 +01:00

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> | recountdiff

It differs from 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.