MaskRay wrote:
Tested a few scenarios. git-clang-format should now match clang-format-diff.py.
```
Confirmed — but with one wrinkle worth knowing before review.
The behavioral claim holds. I fed identical scenarios to both tools and
compared:
┌───────────────────────┬─────────────────┬──────────────────────┬──────────────────────────┐
│ Scenario │ Hunk header │ clang-format-diff.py │
git-clang-format (fixed) │
├───────────────────────┼─────────────────┼──────────────────────┼──────────────────────────┤
│ Pure deletion │ @@ -3,3 +2,0 @@ │ no changes │ no changes
│
├───────────────────────┼─────────────────┼──────────────────────┼──────────────────────────┤
│ Modification │ @@ -6 +6 @@ │ changes proposed │ changes
proposed │
├───────────────────────┼─────────────────┼──────────────────────┼──────────────────────────┤
│ Insertion │ @@ -7,0 +8 @@ │ changes proposed │ changes
proposed │
├───────────────────────┼─────────────────┼──────────────────────┼──────────────────────────┤
│ Leading-line deletion │ @@ -1,2 +0,0 @@ │ no changes │ no changes
│
└───────────────────────┴─────────────────┴──────────────────────┴──────────────────────────┘
They agree everywhere. And the divergence the patch closes is real, not
imagined: on the pure-deletion case the unpatched git-clang-format proposes
reflowing the untouched neighbor while clang-format-diff.py proposes nothing,
on byte-identical input.
```
https://github.com/llvm/llvm-project/pull/215946
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits