|
|
Log in / Subscribe / Register

Raymond: bzr is dying; Emacs needs to move

Raymond: bzr is dying; Emacs needs to move

Posted Jan 14, 2014 18:42 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: Raymond: bzr is dying; Emacs needs to move by eliz
Parent article: Raymond: bzr is dying; Emacs needs to move

> Specifically, what do you mean by "history" that might be rewritten?

Hmm…if I merge remote/mainline into local/mainline, if I look at remote/mainline's commit in my DAG (second parent of local/mainline), does it look the same as if I were to look at the DAG of remote/mainline directly?

I think I'm getting confused where you say the "topology is rewritten" which makes me think that you're relabeling left-parent ancestry when merging or depending on which repository you're in when you query the history. I don't really see how it can be completely rewritten; maybe parents get reordered, but that's about it AFAICS (I can't say the newest commit is an ancestor of the second commit ever made I assume). I guess what I'm looking for are the transformation rules which bzr applies to history when "history is rewritten" (and the situations in which bzr will do so).

When folks blame/criticize/laud git for making it easy to "rewrite history", they're usually just referring to moving from a log of changes in the temporal domain into a log of changes which are incremental, logical, and easier to bisect[1] and review. What I'm hearing from bzr is that it rewrites the arrows between locations in history according to…some rules which (from my reading) tend to depend on which repository/branch I'm working in. Which sounds much weirder and I'm lacking a rationale/use case to adequately justify such behavior.

[1]I guess other tools missing bisect is a reason they're usually so touchy about not squashing typo fixes and such into the commit which introduced them (if they're on the same branch) since they don't have to worry about arbitrary commits being viable. Personally, I'll take bisect any day of the week.


to post comments

Raymond: bzr is dying; Emacs needs to move

Posted Jan 14, 2014 19:13 UTC (Tue) by eliz (guest, #94829) [Link] (3 responses)

> if I merge remote/mainline into local/mainline, if I look at remote/mainline's commit in my DAG (second parent of local/mainline), does it look the same as if I were to look at the DAG of remote/mainline directly?

No, it doesn't look the same. It looks "rotated", such that the commits done locally in local/mainline are always on the left and arranged linearly, while commits from remote/mainline look like a branch that forked from local mainline and then converged with it. Of course, ancestry of each commit is not changed in any way, but the order of the parents does change.

(The above is, of course, assuming that when you merge, these two branches were divergent. Otherwise, bzr will simply do the equivalent of pull and fast-forward, and the resulting DAG will be identical to that on remote.)

There are examples of how the two DAGs will look like in the discussion from 7 years ago whose links I posted earlier, or maybe in some of their followups. If you cannot find an example, I could try digging one out.

Raymond: bzr is dying; Emacs needs to move

Posted Jan 14, 2014 19:27 UTC (Tue) by eliz (guest, #94829) [Link] (2 responses)

Here the example starts:

https://lists.ubuntu.com/archives/bazaar/2006q4/018270.html

And here it is continued to show what happens after a merge in both branches:

https://lists.ubuntu.com/archives/bazaar/2006q4/018307.html

I hope this explains what I meant by "different" and "rotated" DAGs.

Raymond: bzr is dying; Emacs needs to move

Posted Jan 14, 2014 22:35 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (1 responses)

OK, now I understand *what* is happening. Still don't understand the reasoning. I could see some of the reasoning being to keep old numerical IDs the same, but that sounds like the tail wagging the dog to me (numerical IDs don't sound like a good enough upside to have to pay the cost of this history mismatch).

So if A *merges* 'g' back, bzr would see 'e' and 'f' as its parents (and already in the history of the current commit), see that 'f' is on the mainline, rewrite 'g's parent ordering to make 'f' the first parent, then make 'h' as part of A's mainline (with 'g' as a second parent). At least now I see why bzr doesn't do octopus merging (What if 'g' had 'c' and 'f' as parents? Which gets to be "first parent" then?).

As a git user, this is unexpected since now "first parent of e" and "first parent of f" are different based on who you ask.

In any case, we are quite a bit into the weeds for the topic at hand. I do know that if I have to deal with bzr in the future, there will be fewer "WTF‽" moments :) .

Raymond: bzr is dying; Emacs needs to move

Posted Jan 15, 2014 5:43 UTC (Wed) by eliz (guest, #94829) [Link]

> OK, now I understand *what* is happening. Still don't understand the reasoning.

Well, I didn't design that stuff, so I can only try to guess the reasons. If you want the definitive answer, I suggest to ask on the Bazaar mailing list, where bzr's designers still lurk.

My take on the reasoning is that bzr really _wants_ to distinguish between "my" history and "yours", i.e. it wants the history in each branch to reflect the sequence of operations in that branch. Therefore, commits made in the branch and commits merged from another branch are treated differently, and shown as such in the DAG.

IOW, the interpretations of "history" in bzr and in git are subtly, but fundamentally different. For bzr, it is the actual sequence of events that added revisions to the branch, in addition to the ancestry information. For git (IIUC), it is _solely_ the ancestry, i.e. the parent-child relationships between the commits, and the "historic" aspect shows only in the direction of the DAG edges.

> I could see some of the reasoning being to keep old numerical IDs the same, but that sounds like the tail wagging the dog to me

Same here: I think the numerical revnos are the (logical) consequence, not the root cause. But again, this is just my take.

> So if A *merges* 'g' back, bzr would see 'e' and 'f' as its parents (and already in the history of the current commit), see that 'f' is on the mainline, rewrite 'g's parent ordering to make 'f' the first parent, then make 'h' as part of A's mainline

No, I think bzr will just say "nothing to merge" and refuse to merge, because A already has all the commits that are in B. (Merge commits don't count for that purpose.)

> this is unexpected since now "first parent of e" and "first parent of f" are different based on who you ask

Right, and this is very fundamental to how bzr works: the order of parents depends on the branch where you look at a merge commit. This is bzr's branch-centric nature clearly showing.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds