{"thread":{"id":"2405","subject":"Diff between the non-head git work dir and non-git kernel sources","startedAt":"2005-11-08T20:54:32Z","lastAt":"2005-11-08T23:52:42Z","messageCount":3,"participants":["lamikr","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11345","messageId":"43711088.6070701@cc.jyu.fi","threadId":"2405","inReplyTo":null,"subject":"Diff between the non-head git work dir and non-git kernel sources","fromName":"lamikr","fromEmail":"lamikr@cc.jyu.fi","sentAt":"2005-11-08T20:54:32Z","receivedAt":"2005-11-08T20:54:32Z","isPatch":false,"sender":{"key":"lamikr@cc.jyu.fi","avatar":null},"body":"Hi\n\nI am sorry if this a newbie question, but I have tried to read howtos \nfrom the web without finding clear documentation or howto to following \nkind of problem.\n\nI have checked out the omap git tree with command\n\n    git-clone rsync://source.mvista.com/git/linux-omap-2.6.git \nlinux-omap-2.6\n\nand now I am obviously having the omap kernel head in the linux-omap-2.6 \nworking directory + hidden \".git\" with commit history. In addition I \nhave my own \"non git\" development tree that is made on top of \ntraditional kernel snapshots. I however know that the sources in this \ndir reflects to state in git history when following patch was committed\n\n    \nhttp://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=commitdiff;h=d24aff0bd3e788d69a45a9d1b1eecda88d847a41\n\nI would now like to revert the sources in git working dir to state that \nwas after this d24aff0bd3e788d69a45a9d1b1eecda88d847a41 commit\nand then make the diff between that kernel source version and my non-git \nsource version and I am now trying to find out what is the \"correct\" way \nof doing this.\n\n1) If understood the documentation correctly I could move the working \ndir to contain the state after\nd24aff0bd3e788d69a45a9d1b1eecda88d847a41 commit in a following way\na) open qgit and mark correct commit with \"make tag mytag\" command\nb) change the files in working dir to be same than during the \"mytag\" \ncommit time by using command git checkout -f mytag\n   \nAre there simpler method for doing this that uses commit id \nd24aff0bd3e788d69a45a9d1b1eecda88d847a41 directly without need to make \ntag or branch?\n\n2) Does git-diff support making the diff between git's working dir and \n\"my non\" git kernel source dir.\nOr should I just just use normal diff and order that to ignore .git dir \nand .gitignore files?\n\nMika\n"},{"id":"11352","messageId":"7vacgeeqb3.fsf@assigned-by-dhcp.cox.net","threadId":"2405","inReplyTo":"43711088.6070701@cc.jyu.fi","subject":"Re: Diff between the non-head git work dir and non-git kernel sources","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-08T22:18:56Z","receivedAt":"2005-11-08T22:18:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"lamikr <lamikr@cc.jyu.fi> writes:\n\nLet me understand what trees are involved.  I am not sure from\nyour description.\n\n 1. You based your own development on some kernel snapshot.\n\n 2. The kernel snapshot you based 1. is \"some version\".\n\n 3. Mvista has d24aff0b commit that contains their changes to\n    a kernel snapshot (the same \"some version\" as 2).\n\n 4. Mvista now has different version, descendant of 3.  This is\n    the top of omap tree you cloned.\n\n         --------------------------->[2] yours\n        /\n     [1]------------->[3]----------->[4] omap tip\n\nIs this the commit history graph you have?\n\n> I would now like to revert the sources in git working dir to state that \n> was after this d24aff0bd3e788d69a45a9d1b1eecda88d847a41 commit\n> and then make the diff between that kernel source version and my non-git \n> source version.\n\nYou lost me here.  Presumably the ultimate goal of what you are\ndoing is either one of the following:\n\n(1) port your good changes between [1] and [2] on top of [4], or\n\n(2) port progresses in omap tree between [3] and [4] (or perhaps\n    [1] and [4], including changes betwen [1] and [3]) on top of\n    your tree [2].\n\nBut I am not sure what you mean by the above paragraph.  You\nsound as if you want to find out the differences between [3]\n(\"revert it to d24aff\") and [2] (\"your non-git source\").\n\nIf that is what you want instead, assuming you have your kernel\ntree in linux-lamikr and omap tree in linux-omap:\n\n\t$ cd linux-omap\n        $ git checkout -b snapshot-d24aff0b d24aff0b\n\t$ cd ..\n\t$ diff -ru -X linux-lamikr/Documentation/dontdiff \\\n        \tlinux-omap linux-lamikr\n\nwould give you the diff between [3] and [2]; if the difference\nbetween [1] and [3] is insignificant, then that diff can be\napplied to [4].  However, if you have much stuff going on\nbetween [1] and [2], applying \"single diff containing\neverything\" may turn out to be not so useful.\n\n> 2) Does git-diff support making the diff between git's working dir and \n> \"my non\" git kernel source dir.\n> Or should I just just use normal diff and order that to ignore .git dir \n> and .gitignore files?\n\nAnother possibility would be to move your development to .git;\nif you know the commit id of [1], then you can branch from that\ncommit and replay your development trail step by step up to [2].\nThis obviously requires that you used some SCM to keep track\nyour development trail between [1] and [2].\n\nOnce you have done that (and assuming your branch is called\nlamikr), you could compare omap and your tip with:\n\n\t$ git checkout lamikr\n\t$ git diff lamikr origin\n\nOr even merge omap tip into your branch:\n\n\t$ git checkout lamikr\n\t$ git pull . origin\n\nall inside linux-omap/ directory.\n"},{"id":"11360","messageId":"43713A4A.9000101@cc.jyu.fi","threadId":"2405","inReplyTo":"7vacgeeqb3.fsf@assigned-by-dhcp.cox.net","subject":"Re: Diff between the non-head git work dir and non-git kernel sources","fromName":"lamikr","fromEmail":"lamikr@cc.jyu.fi","sentAt":"2005-11-08T23:52:42Z","receivedAt":"2005-11-08T23:52:42Z","isPatch":false,"sender":{"key":"lamikr@cc.jyu.fi","avatar":null},"body":"Junio, thanks for the help, I think the problems are now vanished :-)\n\nJunio C Hamano wrote:\n\n>lamikr <lamikr@cc.jyu.fi> writes:\n>\n>Let me understand what trees are involved.  I am not sure from\n>your description.\n>\n> 1. You based your own development on some kernel snapshot.\n>\n> 2. The kernel snapshot you based 1. is \"some version\".\n>\n> 3. Mvista has d24aff0b commit that contains their changes to\n>    a kernel snapshot (the same \"some version\" as 2).\n>\n> 4. Mvista now has different version, descendant of 3.  This is\n>    the top of omap tree you cloned.\n>\n>         --------------------------->[2] yours\n>        /\n>     [1]------------->[3]----------->[4] omap tip\n>\n>Is this the commit history graph you have?\n>  \n>\nAlmost like this.\na) I used 2.6.14-rc5.tar.bz2 as a base\nb) Then I applied\n       2.6.14-rc5.tar.bz2 and \nhttp://www.muru.com/linux/omap/patches/patch-2.6.14-rc5-omap1.bz2\n    on top of that. This is a snapshot from the OMAP git tree.   [1]\nc) I merged my own development to these sources --> [2]\nd) I manually applied all patches released to omap tree between \npatch-2.6.14-rc5-omap1.bz2 and\ncommit-id d24aff0bd3e788d69a45a9d1b1eecda88d847a41   --> [5]\n\nSo the relation between kernel version [5] that I have in non git tree \nis basically following and current omap git tree is\nfollowing kind.\n\n         ---my changes-->[2]----->[5] my source tree (non git)\n        /                         /\n     [1]----------------------->[3]---------->[4] omap git (currently in 2.6.14 level)\n\n\n\nI needed to change git working directory from state [4] to state [3] so \nthat I could create the\ndiff between [3] and [5].  (And then try to merge it back on top of [4]...)\n\n>>I would now like to revert the sources in git working dir to state that \n>>was after this d24aff0bd3e788d69a45a9d1b1eecda88d847a41 commit\n>>and then make the diff between that kernel source version and my non-git \n>>source version.\n>>    \n>>\n>\n>You lost me here.  Presumably the ultimate goal of what you are\n>doing is either one of the following:\n>\n>(1) port your good changes between [1] and [2] on top of [4], or\n>  \n>\nYes, my goal is to have in future a own local git branch that follows \nmvistas git tree.\n(and mvistas tree follows mainline) For this I have found good looking \ndocumentation.\n\n>(2) port progresses in omap tree between [3] and [4] (or perhaps\n>    [1] and [4], including changes betwen [1] and [3]) on top of\n>    your tree [2].\n>\n>But I am not sure what you mean by the above paragraph.  You\n>sound as if you want to find out the differences between [3]\n>(\"revert it to d24aff\") and [2] (\"your non-git source\").\n>\n>If that is what you want instead, assuming you have your kernel\n>tree in linux-lamikr and omap tree in linux-omap:\n>\n>\t$ cd linux-omap\n>        $ git checkout -b snapshot-d24aff0b d24aff0b\n>  \n>\nThis was the thing I wanted to know and it worked. I made something \nwrong in my own attempts and I always failed to revert to own version. \n(Propaply because I tried to create tag names)\n\n>Another possibility would be to move your development to .git;\n>if you know the commit id of [1], then you can branch from that\n>commit and replay your development trail step by step up to [2].\n>This obviously requires that you used some SCM to keep track\n>your development trail between [1] and [2].\n>\n>Once you have done that (and assuming your branch is called\n>lamikr), you could compare omap and your tip with:\n>\n>\t$ git checkout lamikr\n>\t$ git diff lamikr origin\n>\n>Or even merge omap tip into your branch:\n>\n>\t$ git checkout lamikr\n>\t$ git pull . origin\n>\n>all inside linux-omap/ directory.\n>  \n>\nWell, I already started diff running in the background by using the \nfirst solution but I will also try this one for the comparison.\n\nMika\n"}]}