Skip to content

Commit

Permalink
FAQ: Add an entry on how Jujutsu saves changes in the working-copy.
Browse files Browse the repository at this point in the history
This was brought up as a common point of confusion in a Discord discussion ~2 
months ago.
  • Loading branch information
PhilipMetzger committed Oct 31, 2023
1 parent 23a0bab commit 8882c41
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ revision visible again.

See [revsets] and [templates] for further guidance.

### `jj` is said to record the working after `jj log` and every other command. Where can I see these automatic "saves"?

Indeed, every `jj` command updates the current "working-copy" revision, marked
with `@` in `jj log`. You can notice this by how the [commit id] of the
working copy revision changes when it's updated. Note that, unless you move to
another revision (with `jj new` or `jj edit`, for example), the [change id] will
not change.

If you expected to see a historical view of your working-copy changes in
`jj log`, as a chain in a parent-child relationship, this is not the case.
Instead each commit gets amended and the commit-id changes.

You can see the history of these changes using `jj obslog`. This will show the
history of the commits that were previously the "working-copy commit", since
the last time the change id of the working copy commit changed. The obsolete
changes will be marked as "hidden". They are still accessible with any `jj`
command (`jj diff`, for example), but you will need to use the commit id to
refer to hidden commits.

You can also use `jj obslog -r` on revisions that were previously the
"working-copy" revisions. Use `jj interdiff` as an easy way to see a commit's
evolution.

### Can I prevent Jujutsu from recording my unfinished work? I'm not ready to commit it.

Jujutsu automatically records new files in the current working-copy commit and
Expand Down Expand Up @@ -110,6 +133,8 @@ to the old state, and `jj restore --from X` to restore the new working-copy
commit to the new state.

[config]: config.md
[change id]: glossary.md#change-id
[commit id]: glossary.md#commit-id

[gitignore]: https://git-scm.com/docs/gitignore

Expand Down

0 comments on commit 8882c41

Please sign in to comment.