Farfetched blog

View My GitHub Profile

Jujutsu and one nit

19 Jun 2024

I’m excited about jujutsu as an upgrade to git. It could be a huge simplification.

One of its improvements is that you use your regular checked out files for things which git otherwise needs bespoke UI. So, for example, the repo gets all of your latest changes automatically, without you having to do anything. The version of your files that you are working with always corresponds to a commit in the repo.

To support that, jujutsu previously distinguished between “closed” and “open” commits, to handle working with a historical commit versus the commit that represents the working copy. When working with historical (closed) commits, you generally want a new commit for making extra changes. When resuming in-progress (open) work, you generally want to glom all changes into one commit. Now that distinction is gone, and there is one command for retrieving a commit: “edit”, and a different command for creating an empty child commit and retrieving it: “new”. So you can effectively close a commit by giving it an empty child.

There are now two details that are unfortunately exposed to users:

Instead jujutsu should automatically create a new commit when the user changes the working copy for a commit that has children. The “edit” command should be renamed “get”. The “new” command should be used to create a child for a commit which has no children.

The “new” command should always be used instead of the “commit” command. It’s not worth the remaining @- confusion.

currently:

  1. want to add a new change on tip: jj new
  2. want to add a historical change: jj new <REVISION>
  3. want to switch between in progress changes: jj edit <REVISION>
  4. want to view/build a historical change: jj edit <REVISION> ?

proposed:

  1. want to start a new change on tip: jj new
  2. want to add a historical change: jj get <REVISION>
  3. want to switch between in progress changes: jj get <REVISION>
  4. want to view/build a historical change: jj get <REVISION>

(Might suggest this to them after I start using jujutsu every day myself, want to avoid the bike shedding til then :).)

RSS