News for hackers. Stuff that matters.
Re:Mergiraf: a syntax-aware merge driver for Git by soraminazuki on Saturday November 09, 2024 @10:03AM (#42094758)
Not only that, the order of fields in a Java class does matter despite what that link claims. It's common to use Lombok to automatically generate constructors, and "the order of the parameters match the order in which the fields appear in your class."

https://projectlombok.org/features/constructor

The first two kinds of conflicts that Mergiraf handles looks somewhat dangerous to me when handled by a computer.

https://mergiraf.org/conflicts.html

Re:Mergiraf: a syntax-aware merge driver for Git by wetneb on Saturday November 09, 2024 @11:00AM (#42095090)
Lombok is an interesting example, but yes, just with reflection you can already get order-dependent behaviors as the docs note. I've been thinking about giving users more control over this commutativity, but it's not clear to me what it should look like. A strict mode where commutativity is disabled entirely? The ability to disable certain commutative parents?
Re:Mergiraf: a syntax-aware merge driver for Git by andrewaylett on Saturday November 09, 2024 @01:07PM (#42095826)
Code that uses Lombok features which change classes (rather than subclassing them) might have a high degree of similarity to Java, but it's not Java.