Open tingerrr opened 1 month ago
If you had some background job (or core.watchman.register_snapshot_trigger
is enabled), the background process might capture intermediate state of jj undo
and create conflicts. In that case, jj op log
should include some snapshot/import operation around the jj undo
record.
The only background process interacting with jj
would've been the aforementioned shell prompt which, core.watchman.register_snapshot_trigger
is not enabled.
I assume that this can't be the culprit since it uses --ignore-working-copy
?
What does the op log look like around that problematic undo
? Are there splits in the graph and "resolving concurrent operations"?
In principle, you can reconstruct a lot of what happened using jj branch list --at-op
and jj log --at-op
.
If you can share the repo (including .jj
), we can all partake in that fun... But also, just looking at the op log might be enough.
It's linear, but I'll upload what I have at work here as a zip archive. dc99c98fed08
is where I fetched, and 0b3dc17efed1
is where I ran into the duplicate branch.
at operation dc99c98fed08 "fetch from git remote(s) origin"
at operation e11bae68416b "point branch stash to commit"
at operation f23af9257a27 "undo operation"
at the next operation c37445898efc
Perhaps, the step 3 is wrong. The "stash" branch in git repo should be deleted because "stash@git" is restored to "absent" state.
That explains why I couldn't reproduce it, I wasn't using a colocated repo when trying to reproduce.
Description
This involves two local copies, and a remote on GitHub, I'll highlight these and the relevant branch names with
...
.Yesterday at
home
, I created or updated astash
branch to keep some unfinished commits away from myfeature-branch
and pushed them toremote
. Today atwork
I fetchedstash
and ended up in with a conflictedstash
branch (see below).jj branch list
showed a normal and a hidden change, so I usedjj branch set
to resolve the conflict and it did as expected. After I ranjj undo
however, I ended up with 3 copies of the local branch pointing to the hidden change once and the normal change twice.According to the op log, I had previously (like a month ago) created, pushed and afterward deleted
stash
atwork
. It turns out that between deleting thestash
atwork
and fetching the new one today, I never actually pushed that deletion since it was never in my default push revset.Steps to Reproduce the Problem
I cannot reproduce this, but here are the rough steps that caused the issue for me:
work
with the following change history:A (main) -> B -> C (stash)
stash
andmain
to theremote
stash
onwork
, don't push this deletionremote
calledhome
main
stash@origin
athome
stash
to point to these new changesremote
remote
atwork
stash
branch to the visible new commitjj undo
As noted above, I can't reproduce this. It was probably some form of race condition, so I'll add whatever info you may find helpful at the end of the issue. I'll see if I find anything in the home op log later today.
Expected Behavior
2 copies of the same
stash
branch, one pointing to the hidden change, the other pointing to the visible change, as it was before runningjj branch set stash -r ...
.Actual Behavior
3 copies of the same branch, 2 of which point to the same visible change, the other pointing to the hidden change.
Specifications
Linux twinkbook 6.9.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 12 Jul 2024 00:06:53 +0000 x86_64 GNU/Linux
ext4
v0.19.0
commit signing
: enabled (GPG, sign all)fsmonitor
: enabled (watchman)jj --ignore-working-copy log ...
on each command