#10478

Git branches lag behind bookmarks moved while reconciling concurrent operations

Openbos-voxelopened 6d ago

Description

When two jj operations run at the same time, the next jj command combines them. Combining them can move bookmarks, for example onto a commit that the other operation rewrote.

In a colocated repo, jj normally copies bookmark moves to the matching Git branches when a command finishes, but this step skips that. So after a read-only command like jj log combines the operations, the Git branches still point at the old commits. jj log shows the bookmark as topic* until some later command changes the repo and updates Git.

Steps to Reproduce the Problem

jj git init --colocate repro && cd repro
echo a > f && jj commit -m base
OP=$(jj op log -n1 --no-graph -T 'id.short()')
jj describe -r 'subject(base)' -m reworded
jj bookmark create topic -r 'subject(base)' --at-op "$OP"
git rev-parse --short topic
jj log -T 'commit_id.short() ++ " " ++ bookmarks ++ "\n"'
git rev-parse --short topic

Expected Behavior

jj log moves topic onto the rewritten commit, and the Git branch topic follows it.

Actual Behavior

The Git branch stays on the old commit:

4b78d3b
Concurrent modification detected, resolving automatically.
@  807410007f16
○  629026996933 topic*
◆  000000000000
4b78d3b

Specifications

  • Platform: macOS
  • Version: jj 0.46.0

Activity

0

No activity yet.