4 ms·
> 1) What are the advantages of using native backend as compared to git? Very few. The disadvantages are generally much larger. The main advantage is that you
by martinvonz 5y ago
> 1) What are the advantages of using native backend as compared to git?
Very few. The disadvantages are generally much larger. The main advantage is that you won't run into a (harmless) race that happens once in a while with the git backend (https://github.com/martinvonz/jj/issues/27 https://github.com/martinvonz/jj/issues/27). Disadvantages include not being able to interact with git repo and performance problems (both size and speed).
I should add a note about this to the README.
The backend exists mostly to prove that it's possible and to make sure that the backend API doesn't become tied to Git.
> 2) Are there any potential issues one has to be aware of when using jj contributing to git repository?
The main one is that you should avoid pushing commits with conflicts. It won't corrupt the remote repo, but git clients won't know what to do with the conflicted files. The fix is to fix the conflict and force push the conflict-free commit.
I'll file a bug to prevent pushing commits with conflicts.
- krick 5y agoIf we ignore the UI level stuff, like doing something by default when you switch to another branch, etc — is it in any way "smarter" than git? For example, are there situations, when I couldn't reorder my commits when doing git rebase -i without resolving some conflicts manually, while jj would be able to correctly handle them for me?
- martinvonz 5y agoYes and no. For example, if you reorder two commits, the new child commit will never have conflicts even if the parent had conflicts. That's because the changes from both original commits still apply afterwards. Similarly, if you rebase a commit and it results on conflicts, you can then rebase it back and the conflicts will go away. See the demo at https://asciinema.org/a/HqYA9SL2tzarPAErpYs684GGR https://asciinema.org/a/HqYA9SL2tzarPAErpYs684GGR
- Aeolun 5y ago> git clients won't know what to do with the conflicted files This seems kind of similar to pushing git files with conflicts with the git client? Maybe the Jujutsu formatting is slightly different, but the concept is the same.
- martinvonz 5y agoThese are representations of conflicts that are stored as special files, they are not regular files with conflict markers in. If you look at the commit with regular `git`, you're going to see a weird file with some JSON in it.
- Aeolun 5y agoThat’s arguably better ;) thanks for the explanation.
- hinkley 5y ago> The backend exists mostly to prove that it's possible and to make sure that the backend API doesn't become tied to Git. Do you expect this to always be the case or are you waiting for inspiration/collaboration to make a better go of it?
- martinvonz 5y agoI hope to one day make it better, but it's very low priority right now because the Git backend works well and has the big advantage that it's compatible with Git :) Also see https://news.ycombinator.com/item?id=30403737 https://news.ycombinator.com/item?id=30403737.