Skip to content

jj file track + jj undo deletes the file #9293

@jakobhellermann

Description

@jakobhellermann

Description

I'm not sure if this is a bug report or a feature request for a warning. But especially if you have snapshot.auto-track = none() you might want to track a folder, notice that you didn't want to track the entire folder, do jj undo, and then your files are gone.

Steps to Reproduce the Problem

  1. jj config set --repo 'snapshot.auto-track' 'none()'
  2. touch foo
  3. jj file track foo
  4. jj undo

Expected Behavior

Multiple options:

  • just untrack the file again, keeping it on disk
  • warn that the file was removed, suggesting jj file untrack for non-destructive revert

Actual Behavior

The file that was tracked is deleted. Restoring it is not too hard if you know your way around the op log and notice it immediately.

Specifications

  • Platform: Linux
  • Version: 0.40.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