Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
wetneb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
wetneb
2y ago
In Mergiraf, as soon as there is a parsing error in any of the revisions, it falls back on line-based merging, even though tree-sitter is generally good at isolating the error. It felt like the safest thing to do (maybe we detected the lang
2.
▲
by
wetneb
2y ago
Yeah at the moment it just supports whatever the tree-sitter parser accepts, period. A bring-your-own-grammar version could be interesting, I don't see why it couldn't work. Do you have any Rust crates to recommend, to do parsing
3.
▲
by
wetneb
2y ago
Thanks for the details. Concerning matching for diffing vs for merging, the differences I can think of are: - for diffing, the matching of the leaves is what matters the most, for merging the internal nodes are more important, - for diffing
4.
▲
by
wetneb
2y ago
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 w
5.
▲
by
wetneb
2y ago
Thanks for the insightful comments! You surely have a lot more experience than me there, but my impression was that producing visual diffs and merging files are tasks that put different requirements on the tree matching algorithms, and Dijk
6.
▲
by
wetneb
2y ago
It's based on tree-sitter indeed: https://mergiraf.org/adding-a-language.html
7.
▲
by
wetneb
2y ago
Out of curiosity, which languages would you be interested in?
8.
▲
by
wetneb
2y ago
Yes, see this example: https://mergiraf.org/conflicts.html#line-based-merges
9.
▲
by
wetneb
2y ago
There are attempts to do that, such as https://arxiv.org/abs/2111.11904 or https://arxiv.org/abs/2109.00084 . I couldn't find any open source implementation though. I'm personally not so
10.
▲
by
wetneb
2y ago
I tried your example but git does create a conflict in my case - but maybe I misunderstood the scenario. Python support can likely be done (I would be thrilled if someone made a PR for it), but I don't know if there is a lot of potenti
11.
▲
by
wetneb
2y ago
It's definitely something I would recommend in general, but I'm not sure if it would solve this particular problem (reordering blocks is perhaps a bit bold for a prettifier).
12.
▲
by
wetneb
2y ago
For now, you let it reorder every child within a given node type, which felt expressive enough to me in most cases, but I agree it would be good to refine that: https://codeberg.org/mergiraf/mergiraf/issues/6
13.
▲
by
wetneb
2y ago
Yes, that's definitely something that could be refined, for instance by specifying that only children of specific types can be reordered together: https://codeberg.org/mergiraf/mergiraf/issues/6