Open BatmanAoD opened 3 weeks ago
The import can be undone. For example, lets say you had moved a branch in git, and you then run jj undo
. That will import the moved branch and then immediately undo it. It will also export the changes back to Git. Like this:
$ jj log
@ m martinvonz@google.com 2024-10-11 12:49:07 125bcd2a
│ (empty) (no description set)
○ v martinvonz@google.com 2024-10-11 12:47:30 main HEAD@git f3421f8e
│ bar
○ r martinvonz@google.com 2024-10-11 12:47:06 0dfbd820
│ foo
◆ z root() 00000000
$ git branch -f main 0dfbd820
$ jj undo
Abandoned 1 commits that are no longer reachable.
Rebased 1 descendant commits off of commits rewritten from git
Working copy now at: m c92ce1fb (empty) (no description set)
Parent commit : r 0dfbd820 main | foo
Added 0 files, modified 1 files, removed 0 files
Done importing changes from the underlying Git repo.
Undid operation 4fb019417b7b now, lasted 668 milliseconds import git refs
Working copy now at: m 125bcd2a (empty) (no description set)
Parent commit : v f3421f8e main | bar
Added 0 files, modified 1 files, removed 0 files
$ jj log
@ m martinvonz@google.com 2024-10-11 12:49:07 125bcd2a
│ (empty) (no description set)
○ v martinvonz@google.com 2024-10-11 12:47:30 main HEAD@git f3421f8e
│ bar
○ r martinvonz@google.com 2024-10-11 12:47:06 0dfbd820
│ foo
◆ z root() 00000000
Huh. That's not what I would have expected, but it makes some sense that jj would be able to reverse things you did in git
. But I don't actually know in this case what was being undone; I think it was just a git fetch, but I don't remember intentionally doing anything with git
.
How much "undoing" is possible? If I make five new commits with git, without running any jj commands, and then run jj undo
, does it import and then "hide" all five commits?
Description
According to the
op log
, I ranjj undo
, and it did animport git refs
immediately followed by "undoing" that import, which doesn't make sense.Steps to Reproduce the Problem
jj abandon
)git
that must be importedjj undo
Expected Behavior
Step one is undone.
Actual Behavior
Apparently a no-op.
jj op log
shows:The second
jj undo
node claims to "undo" theimport git refs
node. I'm pretty sure the import is not reversible, though.Specifications
0.22.0-67c2ae0a9e3e445f034a456b299e3f37c4dc4b93