8000 A crisscross merge leads to losing changes · Issue #6369 · jj-vcs/jj · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
A crisscross merge leads to losing changes #6369
Open
@neongreen

Description

@neongreen

Description

Tested on jj 0.28.2.

Sequence of events:

  • commit A: changes ABC to XYZ
  • commit B: changes ABC to XYZ
  • commit C=merge(A,B): we still have XYZ here
  • commit D=merge(A,B): we still have XYZ here
  • commit E=merge(C,D): now we have ABC again!

See this log:

jj log -p -Tbuiltin_log_comfortable
@    p Emily 24 seconds ago 32f6c26a
├─╮  (empty) file.txt (no change)
│ │
│ ○    nw Emily 24 seconds ago 904b2dfe
│ ├─╮  file.txt s/original/modified
│ │ │
│ │ │  Added regular file merge1:
│ │ │      (empty)
○ │ │  no Emily 24 seconds ago git_head() 1a87c77b
╰─┬─╮  file.txt (no change)
  │ │
  │ │  Added regular file merge2:
  │ │      (empty)
  │ ○  nk Emily 24 seconds ago a45b96c8
  │ │  file.txt s/original/modified
  │ │
  │ │  Modified regular file file.txt:
  │ │     1    1: originalmodified
  ○ │  k Emily 24 seconds ago c74287d5
  ├─╯  file.txt original
  │
  │    Modified regular file file.txt:
  │       1    1: originalmodified
  ○  zt Emily 24 seconds ago 1f494f9b
  │  file.txt original again, but the commit is empty
  │
  │  Added regular file file.txt:
  │          1: original
  ◆  zz root() 00000000

Steps to Reproduce the Problem

jj git init --colocate .
jj b c init -r@; echo original > file.txt
jj new init; jj b c A -r@; echo modified > file.txt
jj new init; jj b c B -r@; echo modified > file.txt
jj new A B; jj b c C -r@
jj new A B; jj b c D -r@
jj new C D; jj b c E -r@

jj file show -rE file.txt

Expected Behavior

"modified"

Actual Behavior

"original"

Specifications

  • Platform: Linux, Windows
  • Version: 0.28.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0