First parents #269
whatisaphone
started this conversation in
General
Replies: 1 comment
-
Hey, thanks writing this up!
I will have a look at the other ones once I am done with the first one. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Warning: I'm only 90% confident about my knowledge here, so bear with me. With that out of the way:
The "first parent" of a commit is special in git (and jj). When you run
git checkout x; git merge y z
, orjj new x y z
, the resulting commit hasx
as the first parent. There's nothing special about the last parent.I'll deliberately create these commits in a weird order, to show that jj treats topology as more important than timestamps:
jj new main feat1 feat2
merges feat1 and feat2 into main (the first parent). The first parent is semantically the trunk in that operation. jj log prioritizes laying out first parents down the leftmost side of the graph, regardless of commit timestamps.There are 3 places I found that jjui doesn't respect first parents the way I expect:
main
, thenfeat1
, thenfeat2
, then hitn
. jjui will pass the commits tojj new
sorted from newest to oldest (jj new feat1 main feat2
), but I'd expect it to preserve my explicit order (jj new main feat1 feat2
).b
showsmove $bookmark to $current_change
options, sorted by each $bookmark's timestamps from newest to oldest. But I'd expect them to be sorted topologically by parent order. e.g. a bookmark reachable by traversing the first parent should be sorted before a bookmark reachable only from the second parent, etcjj new main feat1 feat2
, main is the trunk and jjui should default to movingmain
rather thanfeat2
. This is afaik always what you wantIs there any reason jjui shouldn't change to behave like I described?
Beta Was this translation helpful? Give feedback.
All reactions