Hacker News new | ask | show | jobs
by steveklabnik 615 days ago
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...

1 comments

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.