Michael Ellerman <[EMAIL PROTECTED]> writes: > I realise I'm trying to represent a DAG as a linear series of patches. But > the > merge order is a linear sequence of commits, and so it *should* be > representable as a linear series of patches. I think. > > Any thoughts?
All true, and more. It does not show the initial import so you cannot bootstrap from an emptiness. git-export is among one of the things that were there before all the modern core features were invented (especially git-rev-list, let alone --merge-order flag to it) and could use an overhaul. I would script around rev-list --merge-order and diff-tree instead of hacking on that C code if I were doing it myself. But we need to define what we _want_ to see first. Here is a simple example: ---> B --> C --> D / / O ---> A --- The original O forked into branch A and B, merged at C and then continued on to D. What the current (admittedly ancient) 'git export' gives is: commit object O diff between void and O should be given but it doesn't. commit object A diff O A commit object B diff O B commit object C diff A C commit object D diff C D I just noticed that diff between B and C is not shown. Come to think of it, this is _not_ a bug (unlike the initial import not showing which I think is just a bug). The purpose of export is to give you everything that lets you recreate each tree associated with all commits and their ancestry information, so as long as you know C is a child of A and B, enough information to get trees A and B, and diff between A and C, diff between B and C is simply redundant. So, in short, export is perfect if we fix it to show the initial import. It just is not designed for doing whatever you are trying to do with its output. To be usable in your quilt workflow, what output would we want? Off the top of my head, I can think of this: commit object O diff between void and O commit object A diff between O and A commit object B diff between O and B commit object C diff between A and C diff between B and C commit object D diff between C and D Is this what you can use? If you can live with something like the above, 'git whatchanged -p -m --merge-order --root' would give you exactly that in a reverse order. It would give you: commit object D diff between C and D commit object C diff between A and C diff between B and C commit object B diff between O and B commit object A diff between O and A commit object O diff between void and O You earlier said "diff between (automerged A+B) and C", but the former is not something git even records, so you have to compute it yourself from the given information, if you really want it. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html