4 ms·
Jujutsu is terrible in my opinion. people hate the index, but I think they just dont get it. to me a commit is something that is ready to push, and the index is
by 38 2y ago
Jujutsu is terrible in my opinion. people hate the index, but I think they just dont get it. to me a commit is something that is ready to push, and the index is for stuff that is done but not ready to push. just because I wrote one line that I am happy with, doesn't mean I am ready to commit and push that. I prefer to add stuff thats done, then when enough is done I can commit and push. if you remove the index it makes it too easy to push half done stuff
- steveklabnik 2y agoI like jj because I like git's index so much. JJ lets me do what git's index does, but in a much more powerful way. What you do is, you treat @ like the index, and you work on @-. This is the "squash workflow" https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-squash-workflow.html https://steveklabnik.github.io/jujutsu-tutorial/real-world-w...
- 38 2y ago[flagged]
- steveklabnik 2y agohttps://steveklabnik.github.io/jujutsu-tutorial/hello-world/viewing-contents.html https://steveklabnik.github.io/jujutsu-tutorial/hello-world/... > The very first character at the top left is an @. @ is a special name for "whichever commit the working copy reflects." At first I kind of thought about it like HEAD in git, but that's not correct: HEAD is the most recent commit, but @ represents the working copy, which may be "dirty" from git's point of view. This is our first glimpse into the power of the index-less workflow, though we'll explore that fully in the next chapter. For this moment, just realize that we have one less concept, but haven't actually lost any of its power.
- 38 2y agoOK but again thats awful, because @ IS A COMMIT, so you are only a "git push" away from accidentally pushing arbitrary garbage instead of proper changes
- jolux 2y agoNo, because `jj git push` only pushes bookmarks. If you `jj git push -c @` or create a bookmark, yeah, you will push the current commit, but then you're asking for that pretty explicitly.
- phildenhoff 2y agoBookmarks in JJ are closer to tags than branches. They aren’t updated whenever you add new commits on top of the bookmark. If you assign your bookmark to the current commit, yes, and I have done that before. But it’s very easy to not do that, and if you push the wrong commit (a WIP commit, let’s say) you can reassign the bookmark and then push again. It’s not a big deal to push arbitrary garbage to the remote if you do, and it’s not common that I do. On the flip side, jj has been remarkably useful at ensuring I never ever, ever lose any of my work. Ever. It’s not an issue that often, but when it is, oh thank god
- sunshowers 2y agoPlease try out Jujutsu.
- 38 2y agoOK but again thats awful, because @ IS A COMMIT, so you are only a "git push" away from accidentally pushing arbitrary garbage instead of proper changes
- nasso_dev 2y agoActually, `jj git push` will only push named branches, which are now called "bookmarks". You simply don't attach a bookmark to @, and `jj git push` will NEVER push it (to what branch would it push?) The branch you're working on is instead on @-. So when you squash, it updates the branch.
- abhinavk 2y agoYou need to think commits as of a non-depleting commodity. And named-branches (bookmarks) as something that is explicitly set to newer commits/changes.
- aseipp 2y agoYou are simply misinformed. `git push` always pushes the HEAD by default without question, but jj does not. @ is not special in any way, so it does not get special treatment from push. It will only push branches you tell it to or that have been amended/updated and are not immutable. jj also does not update any branch pointers (or "bookmarks" as we call them) unless you explicitly ask it to. You have to explicitly run `jj branch set ...` and then run `jj git push` to get the behavior you are describing, which is much more explicit.