Commit graph

26 commits

Author SHA1 Message Date
0b3d0d8f46
Ignore leading and trailing blank lines for comparison
```git-check-assertions
run test/mechanicaldiff.bats
assert_success

git checkout HEAD~ bin
run test/mechanicaldiff.bats
assert_failure
assert_output --partial "-- command failed --"
```
2026-03-06 04:25:28 +01:00
3d814b5b15
Get rid of the left_out variable 2026-03-05 21:21:35 +01:00
c103d70078
Add LICENSE 2026-03-05 21:11:29 +01:00
d712a7eea2
Just return empty lists instead of None 2026-03-05 21:09:06 +01:00
72766295c0
Simplify handling of empty diffs 2026-03-05 20:58:51 +01:00
26447c8205
Drop diffs with only mode changes 2026-03-05 20:55:47 +01:00
810ccab884
Show what happens for a diff with only a mode change 2026-03-05 20:53:47 +01:00
b54e8ab235
Get rid of tuple return values 2026-03-05 20:46:28 +01:00
a19a77f105
Add a test where all pairs in a hunk become context 2026-03-05 20:42:13 +01:00
8ebcba623e
Add support for rewriting hunks if only specific lines match 2026-03-05 20:39:52 +01:00
56d1f03c83
Remove unused dependency on bats-file 2026-03-05 20:17:46 +01:00
19fe610eac
Avoid a bunch of duplication 2026-03-05 20:17:13 +01:00
babda9037c
Add a test where only a part of the line is replaced 2026-03-05 20:15:19 +01:00
2d513835dc
Add a test with a more complicated substitution 2026-03-05 20:13:53 +01:00
c1e29682d5
Add a test where multiple files are processed 2026-03-05 20:12:02 +01:00
54bae30e11
Add a test where only one hunk in a file is dropped 2026-03-05 20:08:32 +01:00
048dd09cc2
Return a non-zero error code if anything is left out 2026-03-05 19:52:32 +01:00
ceac602325
Rewrite the tests to use a real diff 2026-03-05 19:50:57 +01:00
d3b3862040
Add devshell and initial bats tests 2026-03-05 19:36:24 +01:00
af8fae68fe
Fix formatting 2026-03-05 19:23:00 +01:00
28e5f45598
Implement the main logic 2026-03-05 17:53:56 +01:00
0aee4d44a5
Split up a change in removed lines and in added lines 2026-03-05 17:44:45 +01:00
4715d9d858
Introduce should_include_change 2026-03-05 17:39:48 +01:00
d7637d1cec
Take the search and replace program arguments 2026-03-05 17:37:59 +01:00
8b45ac3d87
Add main implementation with a placeholder for should_include_hunk 2026-03-05 17:27:58 +01:00
4234866a38
Add boilerplate 2026-03-05 17:26:52 +01:00