Live data from Hacker News

Pijul: a distributed version control system, written in Rust (2019)

nest.pijul.com

111–120 of 125 posts

Re: Pijul: a distributed version control system, written in Rust (2019)

#111
post #90

Earlier quoted context omitted.

What's the value proposition of Pijul? I mean, not being Git is not a good reason to convince anyone to adopt it as a VCS. A tool needs to actually be better at something and add tangible value where others may not have. What's the absolute best reason to convince anyone to adopt Pijul?

About half a year ago, I tried to merge two forks of a single program which had diverged by several years. I tried a Git merge, got halfway through conflict resolution, stashed my current changes and reset my repository, and could not reapply my partial resolution. (The proper approach would've been to manually run `git rerere` without arguments to save the current partial resolution, but I didn't know that). I redid…

I suggest you check out git-imerge, it's a quite handy tool for making complex/big merges simple.

Re: Pijul: a distributed version control system, written in Rust (2019)

#112

Earlier quoted context omitted.

> 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]. Sure, if the two branches have diverged around the location of the patch, there will need to be a merge resolution. Wouldn’t Pijul require the same too?

First, even though Pijul has branches, patch commutation means that most Git branches are just regular patches in Pijul. > 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…

> 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".

No, that’s not what I was asking. Conflicts don’t come back in git either, if you base the change off the merge-base.

As I said, if the area around the patch has diverged between the release and development branches, you will need to manually resolve the conflict as you merge from the patch branch (based off the merge-base). That’s nothing to do with git, these tools do not have semantic understanding of your business problem so obviously require human input.

My question was, in that case wouldn’t Pujil need assistance too?

Your reply: “conflicts are resolved by patches” - indicates there was a conflict that needed to be resolved by a human or not?

Re: Pijul: a distributed version control system, written in Rust (2019)

#113

Earlier quoted context omitted.

First, even though Pijul has branches, patch commutation means that most Git branches are just regular patches in Pijul. > 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…

> 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". No, that’s not what I was asking. Conflicts don’t come back in git either, if you base the change off the merge-base. As I said, if the area around the patch has diverged betwe…

> My question was, in that case wouldn’t Pujil need assistance too?

> 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).

Re: Pijul: a distributed version control system, written in Rust (2019)

#114

Earlier quoted context omitted.

Because a DVCS has to be distributed. If Alice writes patch p, Bob reverts it, and Charlie unreverts it, you might (without contexts) have three people with different states of the repo: Alice: {p} Bob: {p, !p} (or do you write this as {}?) Charlie: {p, !p, p} = {p, !p}? So I guess this has to be {p} Suppose these people are pushing and merge if in patches to the master. Then it has no way to distinguish these scenar…

CRDTs have to tackle this sort of problem as well.

Right. And a CRDT for a set you can add and remove from is either hard or weird for this reason.

Also I think you don’t actually want your repo to be a CRDT because a CRDT resolves all conflicts and that would mean merge conflicts get resolved in an arbitrary way (leading to unexpected results and bad code). Maybe you could say that merge conflicts don’t count as conflicts in the CRDT sense of the word but that just feels like you’re abusing the notion of what a CRDT is.

Re: Pijul: a distributed version control system, written in Rust (2019)

#115

I'm glad this made the front page. I and other of my friends have tried a few times now with varying degrees of success. For those of us pining for the days of darcs or wanting to escape the git monoculture, Pijul is really great.

What's the value proposition of Pijul? I mean, not being Git is not a good reason to convince anyone to adopt it as a VCS. A tool needs to actually be better at something and add tangible value where others may not have. What's the absolute best reason to convince anyone to adopt Pijul?

> What's the value proposition of Pijul ?

A faster patch-based DVCS. Folks have done a good job explaining it below.

> I mean, not being Git is not a good reason to convince anyone to adopt it as a VCS.

I dunno if I agree with this, but even if we dismiss that folks should be willing to try new things. When I was teaching folks about dcvs's back in around 2009-2010 folks were also unnecessarily skeptical of any sort of change.

> A tool needs to actually be better at something and add tangible value where others may not have

Not really though? It just needs to be different.

Re: Pijul: a distributed version control system, written in Rust (2019)

#116

Earlier quoted context omitted.

Are we talking about the Darcs version < 2 merge algorithm or the merge algorithm in current darcs?

The current darcs. Conflict fights are still exponential, and happen sometimes. I'm a really happy darcs user, but I was talking about complexity theory here, which considers worst cases. 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…

"Current" might mean the latest release or the current darcs.net repo with v3 patches, which I can't claim to have followed.

Re: Pijul: a distributed version control system, written in Rust (2019)

#117
post #3

How does it compare to Darcs? https://hackage.haskell.org/package/darcs Edit: Better link is http://darcs.net/ , darcs has been around for more than 10 years and is still actively maintained.

The problem with Darcs, which I've seen in use, is that the tooling around it is atrocious. Compared to something like Bitbucket or GHE, it's a huge pain for a bigger team, and requires a very oldschool workflow. There's a Jenkins plugin that barely works, you have to build your own new version because distro packages are old, etc. Not sure whether there's any actual advantage at all.

I'd hope my revision control didn't need a lot of tooling, personally. I have Emacs darcsum and vc-darcs, and Trac integration, with hooks to use on commits etc. I guess darcsden (hub.darcs.net) is similar to pijul nest. There doesn't seem to be any real problem integrating it with things (that don't insist on a CVS-ish model) if people want to do it, it's just that few do, unfortunately. I haven't had time to see how easy it would be to provide darcs support for sourcehut, which might be useful.

I don't know what GHE is, but making me interact with github or bitbucket isn't a good way to encourage me to contribute to projects, especially fixing incidental bugs in things I use. Each to their own, after some decades' experience of effective distributed development.

Re: Pijul: a distributed version control system, written in Rust (2019)

#118
post #3

How does it compare to Darcs? https://hackage.haskell.org/package/darcs Edit: Better link is http://darcs.net/ , darcs has been around for more than 10 years and is still actively maintained.

From a complexity theory perspective, the Darcs patch application algorithm runs in time O(2^n) in the worst case, where n is the number of patches since the beginning of the repository. That exponential merge happens in practice. 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 improvem…

I can't find the details off-hand, but doesn't Darcs actually have the facility to define different types of patches as well as normal ones and "replace"? I don't know whether that's ever been done, but it could be useful, whether or not it's a worthwhile trade-off.

Re: Pijul: a distributed version control system, written in Rust (2019)

#119

Earlier quoted context omitted.

Rust or any procedural language seems not to be the most apt lang to do a first implementation / rewrite of a patch theory. Patches themselves have already been generalized to paths using HOTT ref: https://www.cs.cmu.edu/~rwh/papers/htpt/paper.pdf . The takeaway from https://arxiv.org/abs/1311.3903 is the use of commutation to allow for push out while the HOT ref discusses pseudocommutation regarding merges. See the…

I tried to read that HOTT paper. I should preface this by saying that my homotopy type theory knowledge is basically 0 and my topology/homotopy/algebra knowledge is limited and rusty. Here are some notes I took as I read it: 1. I guess I’m starting off not understanding the relevance of this paper to distributed version control. If you have a type R for states of your repository and patches are then paths of type a =…

1. "not understanding the relevance of this paper to distributed version control"; 18. "what the point is.": On page 11: Our contribution [..] is to present patch theory in a categorical setting that is also a programming formalism, so it directly leads to an implementation.

2.: Patches are (homotopically) equivalent to paths and form inductive groupoids. (pg 11) "In homotopy type theory the path space of every type is symmetric, and to fit patch theories into this symmetric setting, we either considered a language where all patches were naturally total bijections on any repository (Section 4 and 5), or used types to restrict patches to repositories where they are bijections" Inverses of patches arise due to these considerations. The use of the term distributed seems to be used in the sense of dependence that arises with pseudocommutation (pcom).

3. It might be inferred that apd = Action on Paths for Dependent function (f) Action on inductive groupoids. (https://ncatlab.org/nlab/show/fiber+sequence#ActionGroupoid) So, a fiber sequence? Not sure where it is stated that PathOver does not depend on f (along with p and B)?

7. section 6 uses histories that are a quotient higher inductive type to equate sequences of patches, which result in the same changes to a file.

11. "Pseudocommutation gives us a merge operation that is well-defined, symmetric [..], and reunites the two branches of a span, but this is not enough to guarantee that we get the merges that we might expect" ..

12. "the correctness of pseudocommutation follows from the induction principles for paths that are proved for each type from the basic induction principles for the higher inductive types—roughly analogously to how, for the natural numbers, course-of-values induction is derived from mathematical induction. Moreover, proving these induction principles is sometimes a significant mathematical theorem. In homotopy theory, it is called calculating the homotopy groups of a space, and even for spaces as simple as the spheres some homotopy groups are unknown."

15.; 16. see section 6 for a patch language with add and remove, not just swap. Unfortunately, the authors were unable to provide a proof of the correctness of the proposed pcom (p,q) definition for it. If it is correct, it would be a more general patch language than the merges as pushout with ojo pseudo-edge proposal along with its assumptions / restrictions on deletions that computes patch application by having [multiple] Tarjan (2-SAT) run(s). Even so, not sure how efficiently the "length-2 suffix" pcom would work out. Reminder that dependency resolution is NP complete.

17. "In homotopy type theory the path space of every type is symmetric"

18. If merges could be assumed to be push outs or proved to be that would remove the ambiguity arising from pcom -> imply its correctness. pcom is defined for each patch language. Section 6.4 gives an outline on how to use patch laws to prove the correctness of the assumed pcom definition. The references also provide further details [18], [19], etc. The "category" paper ref treats merge as a pushout not as pcom based. pcom may be seen as a generalization of merges as pushouts. For another perspective on what is the same mathematical structure regarding Darcs see the Jacobson [15] reference that interprets patches as inverse semigroups, which are essentially partial bijections. Additionally, the Ehresmann-Schein-Nambooripad theorem states that inverse semigroups are equivalent to inductive groupoids.

NB I am not an author of any of the papers.

Re: Pijul: a distributed version control system, written in Rust (2019)

#120
post #77

Earlier quoted context omitted.

Maybe I’m “doing it wrong,” but I have certainly experienced pain cherry-picking fixes and features between dev release branches! Pijul seems to me like it could be a fundamentally better model for VCS, a jump similar to svn -> git.

I guess it's a matter of personal opinion but as a git and svn user I simply fail to see any relevance or value in Pijul's selling point regarding cherry picking. It feels that the argument for Pijul starts from a problem that never existed, and even so the selling points fail to present a case for the alternative. And to be honest, if the worse pain point of git that the Pijul team addressed was git's cherry-picking…

Let me try to present one problem relating to cherry-picking. I don't know Pijul so I'm not sure it illustrates its strength clearly, but at the very least it should address the idea that there is no problem with cherry-picking.

Using git terminology here.

Say you have a release branch and a master branch, and you normally fix bugs on the release branch and then merge the release branch into master.

Now it happens that a bug was fixed in master, and later it turns out that it's actually a critical thing that should be fixed on the release branch, too. So you cherry-pick that fix into the release branch.

Now the next time you merge from release into master, you attempt to merge this commit that was originally cherry-picked from master, so it's already present in master. But git doesn't know.

With some luck, git sees that the textual change is already present, but I believe that can also fail sometimes.

With Pijul, you would have applied the patch from the release branch onto the master branch, and Pijul would have recorded that, and on the next merge from release to master, Pijul knows to skip this patch.

Another place where Pijul helps is when cherry-picking the bugfix in the first place: Suppose the bugfix includes calling some function (procedure, method), but another (earlier) change on master has renamed that function. Then Pijul can alert you to this fact and tell you which other commit (patch) from master is needed to cleanly apply the bugfix.

Does this help?

Post reply on HN