←back to thread

Jujutsu for everyone

(jj-for-everyone.github.io)
434 points Bogdanp | 2 comments | | HN request time: 0.504s | source
Show context
thecupisblue ◴[] No.45090993[source]
I still do not understand why use jj.

It is a layer on top of git that adds its own terminology and processes. The DX doesn't come close to git in understandability, what is `jj bookmark move main --to @-` and how is it more understandable than git?

replies(2): >>45091624 #>>45093939 #
1. sgjennings ◴[] No.45091624[source]
I’ll focus only on the syntax of the command. Why you might need it at all is important, of course, but it’s nuanced and specific to how some people work (I never need this command or anything like it, for example).

> jj bookmark move

Presumably, this part is reasonably clear. “I want to move a bookmark.”

> main

Which bookmark to move. I think this is probably clear from context?

> --to @-

And here’s the part that looks foreign to a non-jj user. This syntax is familiar to jj users because the same revset syntax is used across the whole CLI. `@` is the working copy commit (the commit you have “checked out” that you are currently editing), and `@-` specifies its parent.

Because it’s just a revset, you could specify that same command in a number of ways:

- If you know the parent’s commit ID or change ID, you could use that instead: `--to abc123`

- If there happens to be another bookmark already there, you can use its name: `--to other-feature`

- You probably wouldn’t type this in the terminal, but you could do exotic things like `--to 'mutable() & description("foobar2000")'` to assign the bookmark to the work-in-progress commit that has "foobar2000" in the commit message.

Revsets used pervasively are one of the things that make the DX lovely.

replies(1): >>45113833 #
2. thecupisblue ◴[] No.45113833[source]
Thanks! Just this is a 10x better explanation than most things I've seen online.