Skip to content

jj undo restoring to root operation puts repo in unusable state #8153

@Velociraptor115

Description

@Velociraptor115

Description

Running jj undo that restores to the root operation puts the repo in a state where there is no working copy
In this state, many jj commands do not work, like jj new
The error message is

Error: This command requires a working copy

jj redo does work, but there is no hint in the error message that it will

Steps to Reproduce the Problem

jj git init --no-colocate
jj undo
jj commit -m "A"

Expected Behavior

A better error message, with a hint that jj redo can be used to put the repo back to a working state
Or, better yet, prevent undo that restores to root operation

Actual Behavior

Error: This command requires a working copy

Specifications

  • Platform: macOS Sequoia 15.6.1
  • Version: 0.35.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions