<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: wetneb</title><link>https://news.ycombinator.com/user?id=wetneb</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 18 Jun 2026 07:36:50 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=wetneb" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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 language wrong), but I'm definitely open to reconsidering…</p>
]]></description><pubDate>Sat, 09 Nov 2024 20:01:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=42096527</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42096527</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42096527</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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 according to a grammar supplied by the user at run time? It's likely to be slower, but maybe not prohibitively so…<p>Another approach would be for the tool to accept doing structured merging even if there are error nodes in the parsed tree. If those error span the parts of the file where the extended language is used, then the tool could still help with merging the other parts, treating the errors as atomic blocks. I'd be a bit reluctant to do that, because there could be errors for all sorts of other reasons.</p>
]]></description><pubDate>Sat, 09 Nov 2024 19:02:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=42096193</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42096193</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42096193</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>Thanks for the details.
Concerning matching for diffing vs for merging, the differences I can think of are:<p>- for diffing, the matching of the leaves is what matters the most, for merging the internal nodes are more important,<p>- for diffing, it feels more acceptable to restrict the matching to be monotonous on the leaves since it's difficult to visually represent moves if you can detect them. For merging, supporting moves is more interesting as it lets you replay changes on the moved element,<p>- diffing needs to be faster than merging, so the accuracy/speed tradeoffs can be different.<p>Packaging parsers into separate executables seems like hard work indeed! I assume you also considered fixing the tree-sitter grammars (vendoring them as needed, if the fixes can't be upstreamed)? Tree-sitter parsers are being used for a lot more than syntax highlighting these days (for instance GitHub's "Symbols" panel) so I would imagine maintainers should be open to making grammars more faithful to the official specs. I'm not particularly looking forward to maintaining dozens of forked grammars but it still feels a lot easier than writing parsers in different languages. I guess you have different distribution constraints also.</p>
]]></description><pubDate>Sat, 09 Nov 2024 17:13:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=42095514</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42095514</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42095514</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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?</p>
]]></description><pubDate>Sat, 09 Nov 2024 16:00:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=42095090</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42095090</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42095090</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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 Dijkstra-style approaches felt more fitting for diffs than for merging, so that's why I went for GumTree as it seemed to be the state of the art for merging. Does SemanticDiff offer a merge driver? I could only find documentation about diffing on the website.<p>As to mismatches: yes, they are bound to happen in some cases. Even for line-based diffing, Git uses rather convoluted heuristics to avoid them (with the "histogram" diff algorithm), but they can't be completely ruled out there either. I hope that with enough safeguards (helper to review merges, downstream consistency checks with local fall-back to line-based diffing) they can be lived with. I'm happy to try other matching algorithms if they are more promising though (there isn't much coupling with the rest of the pipeline).<p>Concerning tree-sitter, I have noticed some small issues, but nothing that was a show-stopper so far. I actually like it that it's designed for syntax highlighting, because it's really helpful that the representations it gives stay faithful to the original source, to avoid introducing reformatting noise in the merging process. Parsers written for a specific language can sometimes be too zealous (stripping comments out, doing some normalizations behind your back). That's a problem in Spork (which uses Spoon, a pretty advanced Java parser). And the uniform API tree-sitter offers over all those parsers is just too good to give up, in my opinion.</p>
]]></description><pubDate>Sat, 09 Nov 2024 15:41:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094979</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094979</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094979</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>It's based on tree-sitter indeed: <a href="https://mergiraf.org/adding-a-language.html" rel="nofollow">https://mergiraf.org/adding-a-language.html</a></p>
]]></description><pubDate>Sat, 09 Nov 2024 14:39:52 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094653</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094653</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094653</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>Out of curiosity, which languages would you be interested in?</p>
]]></description><pubDate>Sat, 09 Nov 2024 14:26:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094604</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094604</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094604</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>Yes, see this example: <a href="https://mergiraf.org/conflicts.html#line-based-merges" rel="nofollow">https://mergiraf.org/conflicts.html#line-based-merges</a></p>
]]></description><pubDate>Sat, 09 Nov 2024 13:47:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094394</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094394</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094394</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>There are attempts to do that, such as <a href="https://arxiv.org/abs/2111.11904" rel="nofollow">https://arxiv.org/abs/2111.11904</a> or <a href="https://arxiv.org/abs/2109.00084" rel="nofollow">https://arxiv.org/abs/2109.00084</a>. I couldn't find any open source implementation though. I'm personally not so keen to use LLMs for merging: I want it to be quick and predictable.</p>
]]></description><pubDate>Sat, 09 Nov 2024 13:40:15 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094354</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094354</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094354</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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 potential for solving conflicts there: imports can have side effects, function arguments are complicated with the mixture of positional and keyword arguments, decorators are effectful… it seems to me that there is a lot of sensitivity to order in many places.</p>
]]></description><pubDate>Sat, 09 Nov 2024 13:04:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094209</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094209</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094209</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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).</p>
]]></description><pubDate>Sat, 09 Nov 2024 12:35:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094083</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094083</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094083</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>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: <a href="https://codeberg.org/mergiraf/mergiraf/issues/6" rel="nofollow">https://codeberg.org/mergiraf/mergiraf/issues/6</a></p>
]]></description><pubDate>Sat, 09 Nov 2024 12:32:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094071</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094071</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094071</guid></item><item><title><![CDATA[New comment by wetneb in "Mergiraf: a syntax-aware merge driver for Git"]]></title><description><![CDATA[
<p>Yes, that's definitely something that could be refined, for instance by specifying that only children of specific types can be reordered together: <a href="https://codeberg.org/mergiraf/mergiraf/issues/6" rel="nofollow">https://codeberg.org/mergiraf/mergiraf/issues/6</a></p>
]]></description><pubDate>Sat, 09 Nov 2024 12:29:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=42094052</link><dc:creator>wetneb</dc:creator><comments>https://news.ycombinator.com/item?id=42094052</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42094052</guid></item></channel></rss>