You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given parents a and b, create a merge commit by doing jj new a b -m "merge b into a".
Create a new commit (it can be empty!) and rebase it, jj rebase -r c -d a -d b, providing the two destinations in the same order as given in the jj new (i.e. in step 1).
Note that the merge topology is inverted between the two.
Expected Behavior
The graph produced by passing changes in the same order to the new and rebase operations should be the same.
Actual Behavior
The resulting graphs have the inverse orders.
Working history to create the problem
$ jj git init --colocate
Initialized repo in"."
$ jj desc -m "base (don't want separate histories in Git)"
Working copy now at: q 5b8eccb1 (empty) base (don't want separate histories in Git)Parent commit : z 00000000 (empty) (no description set)$ jj new -m "a"Working copy now at: s 30db9a96 (empty) aParent commit : q 5b8eccb1 (empty) base (don't want separate histories in Git)
$ jj new q -m "b"
Working copy now at: x 93a82b0e (empty) b
Parent commit : q 5b8eccb1 (empty) base (don't want separate histories in Git)$ jj l@ x [email protected] 2024-09-17 19:36:13 93a82b0e│ (empty) b│ ○ s [email protected] 2024-09-17 19:36:08 30db9a96├─┘ (empty) a○ q [email protected] 2024-09-17 19:35:56 HEAD@git 5b8eccb1│ (empty) base (don't want separate histories in Git)
◆ z root() 00000000
$ jj new s x -m "merge s into x ('a' into 'b')"
Working copy now at: t 1d8c9d26 (empty) merge s into x ('a' into 'b')
Parent commit : s 30db9a96 (empty) a
Parent commit : x 93a82b0e (empty) b
$ jj l
@ t [email protected] 2024-09-17 19:36:38 1d8c9d26
├─┐ (empty) merge s into x ('a' into 'b')
│ ○ x [email protected] 2024-09-17 19:36:13 93a82b0e
│ │ (empty) b
○ │ s [email protected] 2024-09-17 19:36:08 HEAD@git 30db9a96
├─┘ (empty) a
○ q [email protected] 2024-09-17 19:35:56 5b8eccb1
│ (empty) base (don't want separate histories in Git)◆ z root() 00000000$ jj new q -m "c"Working copy now at: m 7fd996e5 (empty) cParent commit : q 5b8eccb1 (empty) base (don't want separate histories in Git)
$ jj rebase -r m -d s -d x
Rebased 1 commits onto destination
Working copy now at: m 2e53189b (empty) c
Parent commit : s 30db9a96 (empty) a
Parent commit : x 93a82b0e (empty) b
$ jj desc -m "The commit once described as 'c' (now a merge) This *should* have the same merge semantics as the `jj new` output"
Working copy now at: m f96adeaa (empty) The commit once described as 'c' (now a merge)
Parent commit : s 30db9a96 (empty) a
Parent commit : x 93a82b0e (empty) b
$ jj l
@ m [email protected] 2024-09-17 19:40:45 f96adeaa
├─┐ (empty) The commit once described as 'c' (now a merge)
│ │ ○ t [email protected] 2024-09-17 19:36:38 1d8c9d26
┌─┬─┘ (empty) merge s into x ('a' into 'b')
│ ○ x [email protected] 2024-09-17 19:36:13 93a82b0e
│ │ (empty) b
○ │ s [email protected] 2024-09-17 19:36:08 HEAD@git 30db9a96
├─┘ (empty) a
○ q [email protected] 2024-09-17 19:35:56 5b8eccb1
│ (empty) base (don't want separate histories in Git)◆ z root() 00000000$ jj bookmark create a -r sCreated 1 bookmarks pointing to s 30db9a96 a | (empty) a$ jj bookmark create b -r xCreated 1 bookmarks pointing to x 93a82b0e b | (empty) b$ jj bookmark create c -r mCreated 1 bookmarks pointing to m f96adeaa c | (empty) The commit once described as 'c' (now a merge)$ jj new -m "just for the sake of Git"Working copy now at: mz adbe5ab1 (empty) just for the sake of GitParent commit : mn f96adeaa c | (empty) The commit once described as 'c' (now a merge)$ jj l@ mz [email protected] 2024-09-17 19:42:01 adbe5ab1│ (empty) just for the sake of Git○ mn [email protected] 2024-09-17 19:40:45 c HEAD@git f96adeaa├─┐ (empty) The commit once described as 'c' (now a merge)│ │ ○ t [email protected] 2024-09-17 19:36:38 1d8c9d26┌─┬─┘ (empty) merge s into x ('a' into 'b')│ ○ x [email protected] 2024-09-17 19:36:13 b 93a82b0e│ │ (empty) b○ │ s [email protected] 2024-09-17 19:36:08 a 30db9a96├─┘ (empty) a○ q [email protected] 2024-09-17 19:35:56 5b8eccb1│ (empty) base (don't want separate histories in Git)
◆ z root() 00000000
The order of the rebased commit parents looks correct. Maybe it's a rendering issue of the tooling?
$ jj rebase -r m -d s -d x
Rebased 1 commits onto destination
Working copy now at: m 2e53189b (empty) c
Parent commit : s 30db9a96 (empty) a
Parent commit : x 93a82b0e (empty) b
You can use -Tparents.map(|c| c.commit_id()) to print parent commit ids in stored order.
Description
Steps to Reproduce the Problem
a
andb
, create a merge commit by doingjj new a b -m "merge b into a"
.jj rebase -r c -d a -d b
, providing the two destinations in the same order as given in thejj new
(i.e. in step 1).Expected Behavior
The graph produced by passing changes in the same order to the
new
andrebase
operations should be the same.Actual Behavior
The resulting graphs have the inverse orders.
Working history to create the problem
Specifications
0.21.0-d9c68e08b1a575e63443cacb130806536de06e8a
The text was updated successfully, but these errors were encountered: