{"thread":{"id":"1709","subject":"Any plans to make export work?","startedAt":"2005-09-01T14:53:15Z","lastAt":"2005-09-01T21:58:14Z","messageCount":2,"participants":["Michael Ellerman","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7991","messageId":"200509020053.20471.michael@ellerman.id.au","threadId":"1709","inReplyTo":null,"subject":"Any plans to make export work?","fromName":"Michael Ellerman","fromEmail":"michael@ellerman.id.au","sentAt":"2005-09-01T14:53:15Z","receivedAt":"2005-09-01T14:53:15Z","isPatch":false,"sender":{"key":"michael@ellerman.id.au","avatar":"https://gravatar.com/avatar/0134d6385b3929876d6846e01fa7fc58f5dcf0de14269ea10226abdb1f6b2e53?d=mp&s=160"},"body":"Hi Y'all,\n\nI've been playing with export a bit, and it doesn't seem to work. Or at least \nit doesn't do what I think of as \"work\"-ing.\n\nI'm basically doing a git-export and trying to create a quilt series out of \nit.\n\nWhen you do a \"quilt push -a\" I get as far as:\n06f81ea8ca09b880cadf101d7e23b500e9c164bc\n[PATCH] scsi: remove volatile from scsi data\n\nwhich doesn't apply as it (seems to) conflict with: \n152587deb8903c0edf483a5b889f975bc6bea7e0\n[PATCH] fix NMI lockup with CFQ scheduler\n\nThose two commits (and others) were merged by hand in:\nc46f2ffb9e7fce7208c2639790e1ade42e00b146\nmerge by hand (scsi_device.h)\n\nExport gives me a patch for the merge, but it a) appears to contain everything \nthat was merged, not just the fixup-by-hand, and b) export spits it out after \nboth of the commits which the merge merged - which is no good as quilt \ndoesn't even get that far.\n\nI realise I'm trying to represent a DAG as a linear series of patches. But the \nmerge order is a linear sequence of commits, and so it *should* be \nrepresentable as a linear series of patches. I think.\n\nAny thoughts?\n\ncheers\n\n-- \nMichael Ellerman\nIBM OzLabs\n\nemail: michael:ellerman.id.au\ninmsg: mpe:jabber.org\nwwweb: http://michael.ellerman.id.au\nphone: +61 2 6212 1183 (tie line 70 21183)\n\nWe do not inherit the earth from our ancestors,\nwe borrow it from our children. - S.M.A.R.T Person\n"},{"id":"7997","messageId":"7vfysowivd.fsf@assigned-by-dhcp.cox.net","threadId":"1709","inReplyTo":"200509020053.20471.michael@ellerman.id.au","subject":"Re: Any plans to make export work?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-01T21:58:14Z","receivedAt":"2005-09-01T21:58:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Ellerman <michael@ellerman.id.au> writes:\n\n> I realise I'm trying to represent a DAG as a linear series of patches. But the \n> merge order is a linear sequence of commits, and so it *should* be \n> representable as a linear series of patches. I think.\n>\n> Any thoughts?\n\nAll true, and more.  It does not show the initial import so you\ncannot bootstrap from an emptiness.\n\ngit-export is among one of the things that were there before all\nthe modern core features were invented (especially git-rev-list,\nlet alone --merge-order flag to it) and could use an overhaul.\nI would script around rev-list --merge-order and diff-tree\ninstead of hacking on that C code if I were doing it myself.\n\nBut we need to define what we _want_ to see first.\n\nHere is a simple example:\n\n         ---> B --> C --> D\n       /          /\n     O ---> A ---\n\nThe original O forked into branch A and B, merged at C and then\ncontinued on to D.\n\nWhat the current (admittedly ancient) 'git export' gives is:\n\n    commit object O\n    diff between void and O should be given but it doesn't.\n    commit object A\n    diff O A\n    commit object B\n    diff O B\n    commit object C\n    diff A C\n    commit object D\n    diff C D\n\nI just noticed that diff between B and C is not shown.  Come to\nthink of it, this is _not_ a bug (unlike the initial import not\nshowing which I think is just a bug).  The purpose of export is\nto give you everything that lets you recreate each tree\nassociated with all commits and their ancestry information, so\nas long as you know C is a child of A and B, enough information\nto get trees A and B, and diff between A and C, diff between B\nand C is simply redundant.  So, in short, export is perfect if\nwe fix it to show the initial import.  It just is not designed\nfor doing whatever you are trying to do with its output.\n\nTo be usable in your quilt workflow, what output would we want?\n\nOff the top of my head, I can think of this:\n\n    commit object O\n    diff between void and O\n    commit object A\n    diff between O and A\n    commit object B\n    diff between O and B\n    commit object C\n    diff between A and C\n    diff between B and C\n    commit object D\n    diff between C and D\n\nIs this what you can use?  If you can live with something like\nthe above, 'git whatchanged -p -m --merge-order --root' would\ngive you exactly that in a reverse order.  It would give you:\n\n    commit object D\n    diff between C and D\n    commit object C\n    diff between A and C\n    diff between B and C\n    commit object B\n    diff between O and B\n    commit object A\n    diff between O and A\n    commit object O\n    diff between void and O\n\nYou earlier said \"diff between (automerged A+B) and C\", but the\nformer is not something git even records, so you have to compute\nit yourself from the given information, if you really want it.\n"}]}