#10474

Merging concurrent rebases that form a cycle panics with "graph has cycle"

Openbosopened 6d ago

If two concurrent operations rebase commits onto each other's descendants, merging them panics. Since every command merges op heads on load, every later command in the repo panics too, until one of the operations is abandoned.

Steps to Reproduce the Problem

jj git init repo && cd repo
jj new 'root()' -m X
jj new -m Y
jj new 'root()' -m Z
jj new 'root()'
jj rebase -s 'subject(X)' -o 'subject(Z)'
jj rebase --at-op=@- -s 'subject(Z)' -o 'subject(Y)'
jj log

Actual Behavior

Concurrent modification detected, resolving automatically.

thread 'main' panicked at lib/src/repo.rs:1478:17:
graph has cycle

Specifications

  • Platform: macOS (arm64)
  • Version: jj 0.46.0

Activity

0

No activity yet.