News for hackers. Stuff that matters.
Re:Mergiraf: a syntax-aware merge driver for Git by chrismorgan on Saturday November 09, 2024 @09:04AM (#42094483)
I want to add another problem here. <https://mergiraf.org/adding-a-language.html#add-commutative-...>:

> To let Mergiraf reorder using statements to fix conflicts, we actually need to specify that they can be reordered with any of their siblings (any other child of their parent in the syntax tree).

That’s too coarse-grained. No idea about C♯, but languages could impose a rule that imports must come before anything else—long ago Rust had such a rule, for example. So it might be that within your compilation_unit node, only its using_directive children are commutative, and only among themselves.

Otherwise (lapsing into Rust syntax for convenience), with Base `use A; struct X…`, Left `use A; use B; struct X…` and Right `use A; struct Y; struct X…`, you could end up with the invalid `use A; struct Y; use B; struct X…`.

Re:Mergiraf: a syntax-aware merge driver for Git by tokinonagare on Saturday November 09, 2024 @09:37AM (#42094644)
> No idea about C♯

C#'s using aren't imports, and order indeed doesn't matter.