Most active commenters

    ←back to thread

    Jujutsu for everyone

    (jj-for-everyone.github.io)
    434 points Bogdanp | 11 comments | | HN request time: 0.965s | source | bottom
    1. ivanb ◴[] No.45085317[source]
    I haven't yet given jj a proper trial, so pardon the ignorance. All I've seen are conveniences regarding the working the copy. Besides the subjectively terrible UI, my biggest gripes with Git have to do with collaboration. A rebase may unintentionally overwrite someone's work. A force-push to trunk breaks every other developer's working copy. With "distributed" being in the name of this whole class of VCSes, I would expect that such things just wouldn't happen, but here we are. As I understand it, jj inherits all of these problems and adds better concepts and UI for manipulating the working copy. I'm not sure this alone is a good enough justification for a switch. Of all the Git's features I use a tiny, proven subset and stay on the beaten path. It makes it bearable enough.
    replies(5): >>45085462 #>>45085736 #>>45085741 #>>45086030 #>>45090001 #
    2. dzaima ◴[] No.45085462[source]
    Working copy handling differences is certainly an aspect of jj, but, at least for me personally (esp. given me having grown up with git), it's probably my least favorite difference from git. And yet I've moved most of my personal things from git to jj (albeit with a bunch of custom scripts to make the working copy stuff more git-y).

    A significant other thing jj does is introduce change IDs (i.e. a (randomly-generated) ID that stays stable even as a commit is amended), with which it should be easier to track changed commits across forks/rebases/edits/pulls/fetches, though I've yet to use jj for collaborative projects to see how much that pans out.

    Generally jj makes rebasing things, and generally editing history so much more easy than git, so force-pushes messing with branches is much nicer to "fix" however needed. Being able to leave commits in a conflicted state and resolving only when actually needed also should help.

    replies(1): >>45085962 #
    3. trueismywork ◴[] No.45085736[source]
    The ability to resolve merge conflicts one part at a time is a game changer itself.

    > A force-push to trunk breaks every other developer's working copy.

    Only if they pull your broken trunk as well. Otherwise you're just wrong.

    > A rebase may unintentionally overwrite someone's work.

    No only your copy of someone's work.

    4. paradox460 ◴[] No.45085741[source]
    JJ let's you have multiple "versions" of the same branch, although not directly. Typically it comes about when you've made changes and someone else has made changes, and the conflict resolution can't happen cleanly, due to each path taking a difference, unreconcilible approach. You'll have to resolve those and unify the different "branches", but it's no harder than any rebase in git land (generally easier because jj's conflict markers are even better than git's 3 part system)
    5. paradox460 ◴[] No.45085962[source]
    One of the quiet bit of genius is that JJ change ids use a different set of characters for base16. Instead of 0-9A-F they use k-z
    replies(1): >>45089573 #
    6. boltzmann64 ◴[] No.45086030[source]
    I am think you are misunderstanding the entire premise of git. There is no "force push to trunk breaks every other developers' working copy." There is no central repo/trunk where all the commits are pushed. You are probably thinking of svn.

    In git, your repo is the canonical repo and that is where you work. You work on a new feature and when you are ready, you "git format-patch" and "git send-email" to the community via the mailing list or other developers. A discussion may happen and people may or may not decide to apply the patch to their own repositories, with "git am." This doesn't break every other developers' working copy because they decide how to apply the patches they got in their email. No central repo, no trunk, guaranteed by the d in git dvcs.

    replies(2): >>45086511 #>>45087314 #
    7. baq ◴[] No.45086511[source]
    Not sure if you’re trolling, but with the benefit of doubt: that isn’t how almost everyone works, though. Almost everyone treats the repository which runs CICD as the central hub repo and everything else is a spoke.
    8. IshKebab ◴[] No.45087314[source]
    I don't think they are misunderstanding the premise. They're just thinking at a higher level than you are. It's not too hard to imagine a VCS where rebases can't unintentionally overwrite someone else's work. In fact, Git has flags to avoid that! They're just off by default.
    9. sfink ◴[] No.45089573{3}[source]
    Technically, it's z-k (z=0, k=15). It makes for a nice root change ID: zzzzzzzz. Less choking than kkkkkkkk.

    The relevance, btw, is that you can use git commit IDs in place of change IDs anywhere and they won't conflict; jj knows which you mean by the character set. (They could still conflict with bookmark names, sadly. But I haven't heard of that being an issue in practice.)

    replies(1): >>45090215 #
    10. Cthulhu_ ◴[] No.45090001[source]
    > A rebase may unintentionally overwrite someone's work

    Since you're rebasing, you're intending stuff; nothing is lost until you force-push.

    > A force-push to trunk breaks every other developer's working copy.

    Which is why you avoid it and set the remote main branch to protected. You can't force push by accident, you intend to forcibly overwrite the remote branch.

    11. dzaima ◴[] No.45090215{4}[source]
    Bookmarks take precedence over change ID prefixes. And indeed if you add a bookmark "xyz" and a change had a unique prefix "xyz", the change's unique prefix will grow by one. (the unique prefixes can already grow or shrink semi-arbitrarily so this doesn't "break" anything more)