New blog post: https://mergiraf.org, a syntax-aware merge driver for #Git.
Supports #Java, #Rust, #Golang, #javascript, #cpp, #csharp, #html, #json, #yaml and #xml so far, and it's quite easy to add support for more thanks to #treesitter.
https://antonin.delpeuch.eu/posts/mergiraf-a-syntax-aware-merge-driver-for-git/
Get it on #Codeberg: https://codeberg.org/mergiraf/mergiraf
=> More informations about this toot | More toots from pintoch
@wilfredh it's very similar to #difftastic in spirit so I'm curious what you think of it :)
=> More informations about this toot | More toots from pintoch
@pintoch this looks super cool, and also omg the illustrations 💖
=> More informations about this toot | More toots from tedted@hachyderm.io
@tedted thanks, I will forward the compliments :)
=> More informations about this toot | More toots from pintoch
@pintoch I love it! I really enjoyed reading the manual, seeing the discussion of the design, and reading your comments on the HN announcement too :)
I've long wondered whether something like this was possible in principle, but I've always been intimidated by the problem. I'm super impressed by your solution.
=> More informations about this toot | More toots from wilfredh@mastodon.social
@pintoch Were you influenced by difftastic at all? Your manual structure feels very similar to mine, and you have 'atomic_nodes' in a pretty similar fashion to difftastic :)
=> More informations about this toot | More toots from wilfredh@mastodon.social
@pintoch I've only lightly skimmed the architecture discussion, I'm looking forward to reading it more deeply.
The only suggestion I'd make is that your home page deserves a few screenshots. The screencasts are nice but screenshots help readers decide to watch the screencast. I'm sure you have some super compelling examples that would make great screenshots.
=> More informations about this toot | More toots from wilfredh@mastodon.social
@wilfredh thanks a lot for the kind words!
Yes, screenshots would be great, but I am not clear on how to present the effect of the tool. For difftastic it's much more direct: you see a screenshot of the diff, and that's it, you're convinced. Showing the outcome of a merge is harder. The best way I found so far is to show difftastic's output, comparing the file with conflicts and the resolved merge, but that's still pretty hard to grasp visually.
=> More informations about this toot | More toots from pintoch
@wilfredh and yes of course difftastic was an inspiration in many ways. One big question I had recently was whether to also immitate you for the vendoring of the parsers. So far I have been trying to stick to official versions for simplicity, but I don't know how viable it is, particularly given some issues in the grammars which don't look very actively maintained either.
=> More informations about this toot | More toots from pintoch
@wilfredh of course it feels like sticking to official versions would be a good way to mutualize work on those grammars - but I don't know how realistic it is, and perhaps we have different requirements…
=> More informations about this toot | More toots from pintoch
@pintoch I regret vendoring using git submodules: GitHub handles them badly, and I now have a git repository that's over 1GiB. It's also contributed to Debian not packaging difftastic I think.
That said, being able to pull in parser bugfixes easily has been helpful for working with upstream.
If I did it over, I'd probably just manually vendor the parsers and write a dumb bash script to check for new versions.
=> More informations about this toot | More toots from wilfredh@mastodon.social
@pintoch The other challenge I have is the large size of the compiled binary (over 50MiB) due to all the parsers.
Even the source tarballs are pretty big. I had to ask crates.io to increase my upload limit (they kindly said yes), I think difftastic is the biggest project on crates.io.
This also makes me less willing to accept new languages. Diffsitter uses dynamic library loading for this, which is an interesting solution.
=> More informations about this toot | More toots from wilfredh@mastodon.social
@wilfredh Interersting! Wouldn't it be feasible to gradually move to pulling the parsers from crates.io? The latest versions of tree-sitter have introduced what looks like a pretty solid method to de-couple grammar versions from the tree-sitter version (in a backwards-compatible way), so it looks like it shouldn't be too hard to stay in sync afterwards (avoiding the previous problem of needing to wait for all of your grammars to update before updating tree-sitter).
=> More informations about this toot | More toots from pintoch
@pintoch FWIW I'd write the first paragraph of the manual like this (see screenshot). Show a conflict with an obvious solution, show how to invoke mergiraf, then show the result.
Also, I've only just realised that "mergiraf" is probably supposed to be pronounced like "giraffe"? That wasn't at all obvious to me.
=> More informations about this toot | More toots from wilfredh@mastodon.social
@pintoch I also hit a bug when trying this, filed as https://codeberg.org/mergiraf/mergiraf/issues/37 :)
=> More informations about this toot | More toots from wilfredh@mastodon.social
@pintoch Also added a link in the difftastic README to mergiraf :)
=> More informations about this toot | More toots from wilfredh@mastodon.social
@pintoch any chance of these concepts coming to Darcs or Pijul to eliminate another class of conflicts?
=> More informations about this toot | More toots from toastal@types.pl
@toastal I would say it's unlikely, because the notion of diff that they use is much more baked into the VCS than in git. So you wouldn't be able to implement it as a plugin - it would need support at the core of the tool, which would make the whole thing very complicated I think. See this discussion about Pijul: https://discourse.pijul.org/t/ast-level-diffs-and-merges/187
=> More informations about this toot | More toots from pintoch
@pintoch :blobhearteyes: I needed this last week for my day job.
=> More informations about this toot | More toots from zwol@hackers.town
@pintoch wow looks really interesting!
=> More informations about this toot | More toots from ljs@social.kernel.org
@pintoch first time I wish I had more conflicts 😉
=> More informations about this toot | More toots from chbug@defcon.social
@pintoch Very cool!
=> More informations about this toot | More toots from dwardoric@chaos.social
@pintoch
Bookmarked.
Bonus points for Codeberg hosting.
@Codeberg
[#]Git #Java #Rust #Golang #javascript #cpp #csharp #html #json #yaml #xml #treesitter #Codeberg
=> More informations about this toot | More toots from chfkch@ruhr.social
@pintoch Nice! I made the switch to Helix from Emacs, and the one thing I really missed was Emacs' killer Git integration (Magit magic!). I gave GitUI and LazyGit a try, both are decent, but they don't quite live up to Magit. As a diff tool, I wasn't impressed with either, so I’ve been using Meld for now. Was looking for a TUI option that could do better than those, so I’ll definitely give this a try 🙂
=> More informations about this toot | More toots from triskelion@floss.social
@triskelion thanks - but Mergiraf isn't really an alternative to those, which I would call "merge tools". Mergiraf is a "merge driver", so it changes the automated merging heuristics used by Git, not the way the results are presented to you.
=> More informations about this toot | More toots from pintoch
@pintoch Gotcha, I don’t usually run into the need for Git merge driver or strategy in my workflow, but when I do, this may come in handy
=> More informations about this toot | More toots from triskelion@floss.social
@pintoch About the installation docs, not sure if you were aware, cargo allows installing crates with a git URL as well.
One can install the latest release from Codeberg with something like this:
TAG="$(curl -H 'accept: application/json' 'https://codeberg.org/api/v1/repos/mergiraf/mergiraf/releases/latest' | jq -r '.tag_name')" cargo install --git 'https://codeberg.org/mergiraf/mergiraf' --tag "${TAG}"
=> More informations about this toot | More toots from sanchithhegde@hachyderm.io
@sanchithhegde really cool, I didn't know! Rust noob here ^^
=> More informations about this toot | More toots from pintoch
@pintoch Sounds neat, thanks for sharing :)
=> More informations about this toot | More toots from aral@mastodon.ar.al This content has been proxied by September (3851b).Proxy Information
text/gemini