Re: Kernel headers git tree
- From
David Woodhouse <dwmw2@infradead.org>
- Date
- Jul 14, 2006, 00:56 UTC
- Message-ID
- <1152838562.31372.58.camel@shinybook.infradead.org>
- In-Reply-To
- <7v4pxlt3xg.fsf@assigned-by-dhcp.cox.net>
On Thu, 2006-07-13 at 17:39 -0700, Junio C Hamano wrote:
> With modern enough git, you can rewrite > KBUILDSHA=`git ls-tree $TREE -- Kbuild | cut -f3 -d\ | cut -f1` > with > KBUILDSHA1=`git rev-parse $TREE:Kbuild`
Aha. Thanks.
> I am not sure what function incparent() is trying to do with > this: > > git rev-list --max-count=1 --topo-order $1 -- .
Find the latest ancestor commit which actually changed any files. The first script has a similar line, except that it finds the latest ancestor which changed anything in include/
Consider a kernel tree with commits A-->B-->C-->D, of which only A and C change anything in include/ and in fact only C actually changes the _exported_ headers after the unifdef and sed bits.
The first script (extract-khdrs-git.sh) creates a 'stage1' branch which only contains commits A'-->C', with the _exported_ header tree for each.
The second script (extract-khdrs-stage2.sh) then creates the master branch with the same tree objects, but omitting the commits which don't change anything. So it contains only commit C''
For an example of this, compare http://git.kernel.org/git/?p=linux/kernel/git/dwmw2/kernel-headers.git with http://git.kernel.org/git/?p=linux/kernel/git/dwmw2/kernel-headers.git;a=shortlog;h=stage1
Btw, git-rev-list is _very_ slow at this. Even when the output is actually HEAD, it takes my 2.3GHz G5 a _long_ time to give a result:
pmac /pmac/git/linux-2.6 $ git-rev-parse HEAD ab6cf0d0cb96417ef65cc2c2120c0e879edf7a4a pmac /pmac/git/linux-2.6 $ time git-rev-list --max-count=1 --topo-order HEAD -- include ab6cf0d0cb96417ef65cc2c2120c0e879edf7a4a
real 0m18.840s
Is there a better way to do that step?
-- dwmw2