Also, it seems Gut hasn't had any updates for more than a year, which is even before Pijul's last public patch.
672 karma · joined July 13, 2014
Also, it seems Gut hasn't had any updates for more than a year, which is even before Pijul's last public patch.
But unlike in Darcs, where conflicts are messy and not super well-defined in all cases (and not to mention, sometimes cause Darcs to run for a time exponential in the size of the repo's history), two conflicting edits always commute in Pijul.
The main points of Pijul were (1) to solve the soundness issues with conflicts and (2) to fix the exponential problems.
> Your reply: “conflicts are resolved by patches” - indicates there was a conflict that needed to be resolved by a human or not?
Yes, conflicts need to be resolved by humans indeed (sorry for misunderstanding your question).
Well, but then you can't blame others for using their preferred tools rather than your preferred tools. Also, Git doesn't work for Carnix, because its main author (me) is completely overwhelmed with too many projects and wouldn't want to add the additional project of managing Git branches.
Absolutely, the only difference is the time you'll waste managing your branches (creating, rebasing and merging them).
But hey, everyone should read the answers they want, if someone wants to pick only the ones that are the easiest to dismiss then have fun.
I'm the author of the rewrite. It will almost certainly be open source when it's done, but it is not open right now, because:
- the license of the current version has not been properly observed by other projects in the past.
- this project keeps getting bashed for "corrupting repositories" and "changing formats constantly", even though it is announced as experimental everywhere (also, some corruption claims have been wrong in the past, and we have released converters every time the formats have changed).
Therefore, allowing people to test the new version as it is being debugged would probably not improve this situation.
Not really. If they're not heavily relying on the "darcs replace" feature, it's just the same interface. The dependencies between patches are computed differently.
Be careful though, Pijul is still 0.12, the patch format will change.
> I'd love to see this go further and have a "no conflict" merge take place
This seems possible in a future Pijul. Right now we're just starting to get text files right! Let's see in a few years.
For the sake of completeness, I don't know the full story for the complexity of Darcs "in most cases", but I believe it to be linear in the size of history in the normal case (as it needs to try and commute all the patches with your new patch).
I don't think anyone believes that. The dependencies in Pijul are the minimal dependencies that make the patch application possible, they are by no means semantic (you can totally add dependencies manually, btw).
However, for the particular use case explained above (stable branches, backporting bugs), the default behaviour of Pijul already gives you something really useful.
Oops, we just got a little bit more feature requests for a VCS than "CRUD changesets and files".
But this isn't an answer to my feature request, which was the ability to merge changes.
> Similarly, patches are only relevant as an external interface of the VCS
Why? If they're relevant as the external interface, maybe this means they model the problem better than snapshots, and should therefore be used as the implementation.
Maybe, maybe not, but it comes with actual arguments, whereas that comment doesn't.
> 1. considerably more complex under the sheets, and
Yes it is, which sometimes comforts me when I think of how long it's taken to get a version that works reasonable well.
That said, it's also not the kind of complexity that goes against performance, but rather the kind that makes it hard to process Pijul repositories or patches with independent tools.
> 2. considerably more complex in situations you're going to have to deal with as a user.
I've used it quite a bit, but the biggest repository I've every interacted with is Pijul itself, which is a rather small codebase, so I don't know how the UX scales.
I find it as easy to use as Darcs, with the caveat that patches are not always as intelligible as in Darcs. That said, patches solving conflicts are weird and/or wrong in Darcs, and they are quite simple in Pijul. And I believe conflicts are the situations where you need the most simplicity and clarity.
> It would be nice to read an article from someone familiar with Pijul, [..]
That is a really nice suggestion for a blog post, it's now on my todo list. Thanks!
> For example, accurately representing repository states with files appears difficult
This is unfortunately a difficulty intrinsic to the problem. Git has the same issue, it just doesn't really show it because the conflicts that cause this are shown in a very basic way (there's only so much that diff3 can guess).
> I managed to find a few patches I couldn't understand by looking at them.
There are two issues: one is that the Nest doesn't yet have the best algorithms to render patches (but is likely to improve a lot with the new version of libpijul I'm writing), and the other one is that some patches might have been converted from a previous patch format, which makes them weird.
> I really want to like Pijul, but I'm worried that it's too powerful and requires too much from the user.
The goal is quite the opposite! For starters you can use it just like Git (with branches, and only with better merges). But then when you realise you don't need branches, everything becomes much simpler, and the tool stops getting in your way. For large Git repositories (such as NixOS/nixpkgs on GitHub), I wish it was using Pijul about 100% of the time I contribute or even use my local clone.
The repository of Pijul itself got corrupted several times, but the last time was certainly more than a year ago.
- in Pijul, patches are associative: pulling B and C together after A does the same as pulling just C after pulling A and B. Git doesn't have that property: sometimes diff3 randomly (and silently) decides to shuffle lines around.
- in Pijul, patches commute. Most Git users try to simulate that by rebasing branches, but (1) that can mean a lot of extra work for no fundamental reason and (2) Git runs the same clunky merge algorithms to decide how to do it.
- Pijul knows what a conflict is, whereas Git pretends to know, but then there's "git rerere".
- in Pijul, you can clone one subdirectory of a monorepo by just pulling the patches related to that directory. Git can do partial clones as well, but only with LFS and/or submodules, which are incredibly clunky and unnatural.
That would be the role of a filesystem, and Git is a perfect distributed filesystem. A VCS also allows people to merge their changes and to detect and handle conflicts gracefully.
> who cares how the system is implemented under the hood?
Pijul is not at all about the underlying implementation of commits. Patch commutation is a radically different way of thinking about cooperation, and (1) much simpler and (2) has the potential to scale to much much larger repositories.
Look at nest.pijul.com for example, or the satellite projects such as Thrussh (https://cargo.io/crates/thrussh), which aim at making the UX as smooth as possible.
True, but it's not just the UI: this also requires discipline and constant synchronisation in a team. Pijul achieves the same without much discipline.
> Wouldn’t Pijul require the same too?
If you're talking about my point (1) above, the answer to your question is no, because in Pijul, conflicts are resolved by patches, so if a branch has a patch solving a conflict, the conflict cannot come back. So Pijul doesn't need "rerere".
If you're talking about my point (2), the answer is also no: non-associative merges happen for bad reasons in Git. By design, Pijul doesn't have them at all.
Pijul is meant to model asynchronous work as just that, whereas Git forces it into a unique history. For example, in Pijul, "pull --rebase" and "pull" produce different history, but are guaranteed by design to produce the same result, and strictly equivalent repositories (there's actually just one command for both).
This difference is fundamental.
In Pijul, it is always O(log n + c), where c is the size of the largest conflict between the current repository and the patch you're trying to apply.
So, it is a double-exponential improvement in practical uses, even though you could totally make c = n for the sake of the argument.
The tradeoff is that Pijul doesn't handle the very cool (but rarely usable in practice) "darcs replace".
From an implementation perspective, Pijul is in Rust, relies on less external stuff than Darcs (for example no need for Putty on Windows), is available as a library.
edit: also, Pijul has branches, too, and Darcs doesn't. But branches are far from being as useful as in Git, and in fact most Git workflows use short-lived branches, which are essentially just patches in both Pijul and Darcs.
This is not 100% true (see my answer to the second part below), but the point of Pijul is that you don't need to "do things right" to avoid the potential problems of your version control system. In the end, a version control system is just a tool, not a way of life or a work methodology.
Sure, there are example projects where the Git way is the best, but they are quite rare (one example is Software Heritage [1]).
> If you work this way, you can merge the patch cleanly into all target branches, and this new patch becomes the new merge-base. So you can actually continue to apply new patches without any conflicts.
This is not actually true, and is the whole point of Pijul. In Git, your suggestion works only as long as (1) there is never any conflict, else you need "git rerere", and (2) 3-way merge never runs into a non-associative merge [2].
[1] https://www.softwareheritage.org/ [2] https://tahoe-lafs.org/~zooko/badmerge/simple.html