Hacker News new | ask | show | jobs
by 38 615 days 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
1 comments

I 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-w...

OK 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
Actually, `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.

You need to think commits as of a non-depleting commodity. And named-branches (bookmarks) as something that is explicitly set to newer commits/changes.
You 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.