Replies: 2 comments 8 replies
-
Mercurial's commit evolution supports distributed rewriting: https://www.mercurial-scm.org/doc/evolution/ jj used to have commit evolution as a feature, but I believe it was removed as it didn't add much beyond what the underlying operation log supports. I don't think it was ever distributed, either. The operation log could conceivably be distributed, though. I think it's less obvious how to do so since it's a DAG (?) rather than a grow-only set of edges. |
Beta Was this translation helpful? Give feedback.
-
JJ makes it very easy to go back to the state before a rebase. You can use |
Beta Was this translation helpful? Give feedback.
-
Please forgive me - I just watched this introduction to JJ and read a bit of documentation. So there's a good chance that I am completely wrong.
I tried to understand the underlying model that JJ uses. I understand that it's very similar to git, with the addition of recording conflicts in a commit (which is nice!)
From the introduction that I watched, it seems to me that the main benefit of JJ, besides having a saner UI than git, is that it makes it much easier to modify history. However, all this has to be local - once you share your work, you shouldn't modify the history. Am I correct?
If I'm correct, I'm a bit disappointed. I personally don't like modifying history. Here's a specific example:
Where I work, the standard way to update a pull request to incorporate changes to master is to rebase it. There's even a button in GitLab to do it. But I don't like it. If I press the "rebase" button in GitLab, and run
git status
in my terminal, it says that my history and the branch have diverged. If instead, I decide to rebase on my machine, I have to usegit push -f
, and if someone else committed something to the branch (or even I did it from a different directory and forgot about it), the change is going to be deleted. Another problem with this rebase is that it's very hard to go back to the state before the rebase. That's one reason why I much prefer adding a merge commit from master to the branch.If I'm correct about JJ, it's not going to fix this issue. It may even make it worse, since it'll be easier to rebase!
I think I have an idea for a solution. Can the model be append-only, with new commits having metadata that describe which old commits they deprecate? A rebase won't remove any commits by default, but instead just add new commits with some metadata. When I view the repository, it will look like a normal rebase, but I would be able to see the state before the rebase. If I rebase from one place (say a web UI) and pull from another place (say the terminal), the system will understand what happened, and if I have added changes, the system could automatically rebase them on top of the updated branch.
In other words: it seems to me that the main new thing that JJ brings to the table isn't currently distributed. The actual history is only kept in the local repository, and if it gets deleted then the history is lost, and if you share the state with others (even with a web UI) then many advantages goes away. Perhaps with some extra metadata, JJ could become really distributed, and also really preserve history?
What do you think?
Cheers,
Noam
Beta Was this translation helpful? Give feedback.
All reactions