Better HN
topnewbestaskshowjobs
Log inSign up

waterofclear

5 karma · joined Aug 1, 2018 (8y ago) · 7 submissions

Submissions

comment 6y ago · link · parent

Which part of my reply do you object to? Maybe you object to my first sentence but I am trying to make sure my understanding is correct with the scanario I laid out at the end. Would that require 1 or 2 conflict resolutions? I actually tried to use Pijul directly to see what would happen but I couldn't figure out how to do it with the 1.0 alpha. I thought I'd use branches or unrecord to simulate the scenario I laid out but I could only figure out how to create branches but not switch between them (the checkout command seems to have been removed) and unrecord seemed to not only not revert files to their former state but I could not reapply the patches later with pijul apply. Also all documentation is 404. The non-alpha version of Pijul was uninstallable through cargo and the snap version segfaulted when trying to record. I really have invested time into this to try to get a proper understanding.

comment 6y ago · link · parent

> That's actually the case, because you can totally simulate Git using Pijul if you want, except for the weird merges where Git shuffles up lines randomly.

I don't think this is true. The snapshot model is fundamentally different and doesn't require resolving conflicts in the same way.

> It is not a drawback at all, there are no downsides to it

It's a much more complicated model to implement, performance isn't as good, and your model is closely tied to your diffing algorithm. Contrast this to git where you can merge however you want and no one else needs to know the details.

> You can totally do that in Pijul by adding extra dependencies, and moreover, this is like saying `git rebase` adds very little value to Git.

Can do that and will happen in practice are very different things. It's not something likely possible to do automatically and doing it manually is just extra work that is probably for nothing.

> It is actually the exact opposite: Git forces you to reconsider those conflicts (there's even `git rerere`), whereas Pijul only shows you the unresolved conflicts. Once a conflict is solved in Pijul, it's solved by a patch, and solved forever.

I'm comparing git merge to adding a patch to a set in Pijul.

Let's say I have a patch A that adds a line: return 1 + 1 + 1 + 1;

and a patch B based upon A changes it to: return 1 + 1 + 2;

and a patch C based upon B changes that to: return 1 + 3;

and a patch D based upon the original A changes it to: return 4;

So we now have:

  A
  |\
  B D
  |
  C
Now lets say we add them all to the same set of patches. Will I have to resolve the conflict in B and D and then also the conflict in (the resolution of B and D) and C?

comment 6y ago · link · parent

I'm not sure what you mean. Git is snapshot based. There is nothing to fix when committing, you just commit the result of the merge. Any diff you see is just for display purposes or for input to the three-way merge algorithm. Other users might see a different result if they "git show" your commit if they have a different diff algorithm configured. Pijul is not immune from diff algorithm problems you are talking about except with Pijul it is part of the repo encoding unlike Git. IOW, git already has the freedom to use a merging strategy that understands tokens or AST since it is not hard-coded into the repo encoding.

comment 6y ago · link · parent

Note that you could implement a Token or AST aware merging strategy for git as how you merge is an implementation detail that is not encoded into the repo.

comment 6y ago · link · parent

I looked into Pijul in the past but in the end the model seemed worse than git to me.

Git is a snapshot based model and so doesn't leak any implementation details about patches themselves. Every user can use whatever diffing algorithm they want when generating patches for use in three way merge and then only the results are stored. In fact with git you don't even need to use three way merge, the only thing that matters is that you say "I merged A and B and this is what the tree looks like as a result".

Pijul being based on patches encodes patch information into the repo. Each line belongs to a patch and it can depend on the diffing algorithm which patch owns a particular line. This is a big drawback and so we should hope to get some serious benefits to make up for it, but I don't think we do.

One of Pijul's main selling points is the ease of cherry-picking. They make the claim that cherry picking "just works" but I think this misses the big picture. Pijul's cherry picking only "just works" with respect to merging lines of code. It can automatically pull in patches that the lines of code you are merging depend on for the merging algorithm, but it can not track things like "This calls a function introduced in patch X" which makes the cherry-picking functionality of very little value.

The biggest problem IMO is that Pijul is more similar to git rebase than git merge. What I mean is that it forces you to resolve conflicts that you probably wont ever care about. Let's say I have a local git branch with 10 commits on top of master. Now if I update my master and do "git rebase master" I must make sure that each one of those 10 commits resolves cleanly on top of the new master. It's common to get into situations where you would have to resolve conflicts in several of those rebase steps but a merge which did a three way merge of the tops of both branches would result in few or no conflicts. Pijul is like rebase in that it forces you to consider the full history of all the patches in a set which requires to resolve arbitrary conflicts. The benefit of resolving those conflicts is that it can help with cherry-picking, but I don't want to be doing this work all the time for an incomplete solution to a rare operation. I even made some test repos in both Git and Pijul to verify that Pijul forces you to resolve conflicts that three-way merge doesn't care about.

It's certainly possibly I got some information wrong about Pijul. Please correct me if I have!

comment 6y ago · link · parent

This wing was donated by "anonymous". All eyes look at Ted Danson