{"thread":{"id":"4717","subject":"Creating diff from 2.6.16 from cryptodev-2.6 git tree","startedAt":"2006-06-30T01:18:24Z","lastAt":"2006-06-30T06:28:25Z","messageCount":9,"participants":["Michal Ludvig","Herbert Xu","Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"22872","messageId":"44A47BE0.9060504@logix.cz","threadId":"4717","inReplyTo":null,"subject":"Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Michal Ludvig","fromEmail":"michal@logix.cz","sentAt":"2006-06-30T01:18:24Z","receivedAt":"2006-06-30T01:18:24Z","isPatch":false,"sender":{"key":"michal@logix.cz","avatar":null},"body":"Hi Herbert and others,\n\njust a quick question: how can I create a patch with all changes in\ncryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got\ngit://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git\ncloned here and want to extract all your commits in this tree since\n2.6.16. Is there a way to do it in Git/Cogito?\n\nI was playing with cg-mkpatch but that gave me only the last commit\n(Twofish updates). I'm sure I could search for your commits in the log\nand create those patches one by one but that doesn't seem to be too\nefficient. Also tried \"cg-mkpatch -r 6246b61[...]..\" which is your merge\nof v2.6.17-rc1 into cryptodev-2.6 but that extracted _all_ commits since\nthat tag, not only those in your tree.\n\nAny help appreciated :-)\n\nThanks\n\nMichal\n"},{"id":"22874","messageId":"20060630013627.GA27527@gondor.apana.org.au","threadId":"4717","inReplyTo":"44A47BE0.9060504@logix.cz","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2006-06-30T01:36:27Z","receivedAt":"2006-06-30T01:36:27Z","isPatch":false,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Fri, Jun 30, 2006 at 01:18:24PM +1200, Michal Ludvig wrote:\n> \n> just a quick question: how can I create a patch with all changes in\n> cryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got\n> git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git\n> cloned here and want to extract all your commits in this tree since\n> 2.6.16. Is there a way to do it in Git/Cogito?\n\nOK, it's easier if you break this into three problems.\n\nYou start by getting all the changes merged right after 2.6.16.  This\ncan be done by locating the merge changeset in Linus's tree.  It looks\nlike this:\n\ncommit ec1248e70edc5cf7b485efcc7b41e44e10f422e5\nMerge: 3d1f337b3e7378923c89f37afb573a918ef40be5 55e9dce37ddf3ab358ba1d1e9eef4ee4bd8174a6\nAuthor: Linus Torvalds <torvalds@g5.osdl.org>\nDate:   Tue Mar 21 09:33:19 2006 -0800\n\n    Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6\n\n    * master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6:\n      [CRYPTO] aes: Fixed array boundary violation\n      [CRYPTO] tcrypt: Fix key alignment\n      [CRYPTO] all: Add missing cra_alignmask\n      [CRYPTO] all: Use kzalloc where possible\n      [CRYPTO] api: Align tfm context as wide as possible\n      [CRYPTO] twofish: Use rol32/ror32 where appropriate\n\nYou can get the diff for this merge by doing\n\n$ git-diff-tree -p 3d1f337b3e7378923c89f37afb573a918ef40be5 ec1248e70edc5cf7b485efcc7b41e44e10f422e5\n\nYou then repeat this for 2.6.17 where the merge changeset is:\n\ncommit 972d19e837833b93466c6f6a8ef2a7d653000aa3\nMerge: cdf4f383a4b0ffbf458f65380ecffbeee1f79841 b9d0a25a484a90c1d60b974d115eff2fe580ce16\nAuthor: Linus Torvalds <torvalds@g5.osdl.org>\nDate:   Mon Jun 26 11:03:29 2006 -0700\n\nFinally you get the changes since that merge by find the common changeset\nbetween cryptodev-2.6 and Linus's tree and getting all the changes after\nthat.\n\nThis method works because all crypto changes since 2.6.16 were merged\nfrom my tree.  If this wasn't the case, then you'd have to search\nthrough the history since 2.6.16 to identify the crypto patches that\nwere merged from other sources.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"22876","messageId":"Pine.LNX.4.64.0606291904250.12404@g5.osdl.org","threadId":"4717","inReplyTo":"20060630013627.GA27527@gondor.apana.org.au","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-06-30T02:25:01Z","receivedAt":"2006-06-30T02:25:01Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 30 Jun 2006, Herbert Xu wrote:\n>\n> On Fri, Jun 30, 2006 at 01:18:24PM +1200, Michal Ludvig wrote:\n> > \n> > just a quick question: how can I create a patch with all changes in\n> > cryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got\n> > git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git\n> > cloned here and want to extract all your commits in this tree since\n> > 2.6.16. Is there a way to do it in Git/Cogito?\n> \n> OK, it's easier if you break this into three problems.\n> \n> You start by getting all the changes merged right after 2.6.16.  This\n> can be done by locating the merge changeset in Linus's tree.  It looks\n> like this:\n\nActually, there are certainly other, potentially easier, ways to do this.\n\nIt depends a bit on what Michal wants, though. Since the current trees \n(both mine and the cryptodev tree) have been merging things back and \nforth, it's _not_ as easy as just saying \"pick all commits that exist in \none branch but not the other\", but depending on what Michal wants to do, \ngit gives other ways to prune out just the info he wants.\n\nThe easiest by far is if you only care about a certain sub-directory. \nThen, assuming the branch \"crypto\" is the top-most commit of the cryptodev \nrepo, just do\n\n\tgit diff v2.6.16..crypto -- crypto/\n\nand that will give you a diff of all the changes since v2.6.16 inside that \nsubdirectory. That may or may not be sufficient and what Michal wants.\n\nNow, the cryptodev-2.6.git tree doesn't even contain the v2.6.16 tags, but \nyou can fix that by just doing\n\n\tgit fetch --tags git://git.kernel.org//pub/scm/linux/kernel/git/torvalds/linux-2.6\n\neven if your clone is actually from just the cryptodev-2.6 archive.\n\nAlternatively, if you want to see the individual changes, you can just do\n\n\tgit log -p --full-diff v2.6.16..crypto -- crypto/\n\nwhich shows you all the commits that changed the crypto/ subdirectory, AND \nit shows the other changes those same commits did to other subdirectories \ntoo (which is usually something you want in a case like this).\n\nFinally, what you can also do is that instead of matching for stuff that \nchanged the crypto/ subdirectory, you could try to match commits where the \ncommitter is somebody special, eg Herbert Xu. We don't have that kind of \nthing automated, but here's one way to do it:\n\n\tgit-rev-list --header v2.6.16..crypto |\n\t\tgrep -z 'committer Herbert Xu' |\n\t\ttr '\\0' '\\n' |\n\t\tsed -n '/^[a-f0-9][a-f0-9]*$/p' |\n\t\tgit diff-tree --pretty -p --stdin |\n\t\tless -S\n\nwhere the \"git-rev-list --header | grep -z\" part picks out any commits \ncommitted by Herbert, the \"tr '\\0' '\\n' | sed -n\" part then picks up just \nthe commit ID's from those lines, and the \"git-diff-tree\" part then shows \nthose commits as diffs.\n\n(The above should really be quite possible to shorten as\n\n\tgit log -p --committer=\"Herbert Xu\"\n\nbut we don't actually support git-rev-list doing matching on \ncommitter/author names - although it should be easy to do in case somebody \nwants to have a small git project to get their toes wet, hint hint)\n\n\t\t\tLinus\n"},{"id":"22879","messageId":"20060630023228.GA28850@gondor.apana.org.au","threadId":"4717","inReplyTo":"Pine.LNX.4.64.0606291904250.12404@g5.osdl.org","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2006-06-30T02:32:28Z","receivedAt":"2006-06-30T02:32:28Z","isPatch":false,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"On Thu, Jun 29, 2006 at 07:25:01PM -0700, Linus Torvalds wrote:\n> \n> The easiest by far is if you only care about a certain sub-directory. \n> Then, assuming the branch \"crypto\" is the top-most commit of the cryptodev \n> repo, just do\n> \n> \tgit diff v2.6.16..crypto -- crypto/\n\nYes, you should always do something like this when backporting to make\nsure that you haven't missed patches merged in ways that you didn't\nanticipate.\n\nAlthough I'm not aware of any such patches in the time frame that Michal\nhas in mind.\n\nCheers,\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"22880","messageId":"Pine.LNX.4.64.0606291943010.12404@g5.osdl.org","threadId":"4717","inReplyTo":"20060630023228.GA28850@gondor.apana.org.au","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-06-30T02:44:40Z","receivedAt":"2006-06-30T02:44:40Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 30 Jun 2006, Herbert Xu wrote:\n\n> On Thu, Jun 29, 2006 at 07:25:01PM -0700, Linus Torvalds wrote:\n> > \n> > The easiest by far is if you only care about a certain sub-directory. \n> > Then, assuming the branch \"crypto\" is the top-most commit of the cryptodev \n> > repo, just do\n> > \n> > \tgit diff v2.6.16..crypto -- crypto/\n> \n> Yes, you should always do something like this when backporting to make\n> sure that you haven't missed patches merged in ways that you didn't\n> anticipate.\n> \n> Although I'm not aware of any such patches in the time frame that Michal\n> has in mind.\n\nNote that this is why\n\n\tgit log -p --full-diff v2.6.16.. crypto/\n\nis so great. It will show everything that touched that subdirectory, along \nwith the incidentals. I think that in this case, that's exactly what \nMichal wants.\n\n\t\tLinus\n"},{"id":"22881","messageId":"44A49514.2050103@logix.cz","threadId":"4717","inReplyTo":"Pine.LNX.4.64.0606291943010.12404@g5.osdl.org","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Michal Ludvig","fromEmail":"michal@logix.cz","sentAt":"2006-06-30T03:05:56Z","receivedAt":"2006-06-30T03:05:56Z","isPatch":false,"sender":{"key":"michal@logix.cz","avatar":null},"body":"Linus Torvalds wrote:\n\n> Note that this is why\n> \n> \tgit log -p --full-diff v2.6.16.. crypto/\n> \n> is so great. It will show everything that touched that subdirectory, along \n> with the incidentals. I think that in this case, that's exactly what \n> Michal wants.\n\nExactly!\n\nI just want to have the latest greatest CryptoAPI on 2.6.16, it's that\nsimple ;-)\n\nThanks both for a quick response\n\nMichal\n"},{"id":"22889","messageId":"44A4BA6D.5010006@logix.cz","threadId":"4717","inReplyTo":"Pine.LNX.4.64.0606291943010.12404@g5.osdl.org","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Michal Ludvig","fromEmail":"michal@logix.cz","sentAt":"2006-06-30T05:45:17Z","receivedAt":"2006-06-30T05:45:17Z","isPatch":false,"sender":{"key":"michal@logix.cz","avatar":null},"body":"Linus Torvalds wrote:\n\n> \tgit log -p --full-diff v2.6.16.. crypto/\n\nCan I somehow get the result in a reverse order, i.e. oldest commits first?\n\nAs it is the patch conflicts on files that were changed multiple times\nsince 2.6.16 :-(\n\nWill see if patchutils can help me somehow...\n\nMichal\n"},{"id":"22890","messageId":"Pine.LNX.4.64.0606292316070.12404@g5.osdl.org","threadId":"4717","inReplyTo":"44A4BA6D.5010006@logix.cz","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-06-30T06:20:20Z","receivedAt":"2006-06-30T06:20:20Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 30 Jun 2006, Michal Ludvig wrote:\n>\n> Linus Torvalds wrote:\n> \n> > \tgit log -p --full-diff v2.6.16.. crypto/\n> \n> Can I somehow get the result in a reverse order, i.e. oldest commits first?\n\nNot that way, no. \"git log\" generates the data on-the-fly, so a simple \n\"git log\" will always give most recent first.\n\nHowever, you can do this\n\n\tgit log --pretty=oneline v2.6.16.. crypto/\n\nto generate a list of commits, one per line. Then, reverse that list \n(\"tac\" is your friend), and feed it back to \"git-diff-tree --stdin \n--pretty -p\" to get the diffs.\n\nSo\n\n\tgit log --pretty=oneline v2.6.16.. crypto/ |\n\t\ttac |\n\t\tgit-diff-tree --stdin --pretty -p\n\nshould do what you want.\n\nOf course, the patches (to other files than the crypt/ subdirectory) may \nstill clash due to changes that are unrelated to the crypto changes. That \nis unavoidable, and you'll just have to fix that up by hand.\n\n\t\t\tLinus\n"},{"id":"22891","messageId":"7v1wt7ma2e.fsf@assigned-by-dhcp.cox.net","threadId":"4717","inReplyTo":"44A4BA6D.5010006@logix.cz","subject":"Re: Creating diff from 2.6.16 from cryptodev-2.6 git tree","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-30T06:28:25Z","receivedAt":"2006-06-30T06:28:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michal Ludvig <michal@logix.cz> writes:\n\n> Linus Torvalds wrote:\n>\n>> \tgit log -p --full-diff v2.6.16.. crypto/\n>\n> Can I somehow get the result in a reverse order, i.e. oldest commits first?\n\nTwo ways:\n\n\tgit format-patch -o patches-output/ --full-diff v2.6.16.. crypto/\n\nwould give you one file a patch in patches-output directory,\nnumbered.\n\n\tgit format-patch --stdout --full-diff v2.6.16.. crypto/\n\nwould give you a single stream of the above to the standard output.\n"}]}