Re: Question on GIT usage.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2005-10-29 12:06:22
On Fri, 28 Oct 2005, Ben Greear wrote:
> 
> I have a kernel GIT tree to hold my developing patches...
> 
> I need to build this kernel for 4-5 different processors (c3, p2, p4, p4-smp,
> etc).

Sounds like you just want to use a separate build directory for the 
kernel, which you can do quite independently of git (of course, not too 
many people use it, so the separate-object-directory Kbuild infrastructure 
has bugs every once in a while..)

The way it _should_ work is that you can do something like this:

	.. have a clean source-tree in ~/src/linux ..

	# set up the build tree
	cd
	mkdir build-tree
	cd ~/src/linux
	make O=~/build-tree oldconfig

	# go there and build it
	cd ~/build-tree
	make

and now you can have a build-tree for each of your different 
architectures.

Now, you _can_ certainly do the very same thing with just multiple git 
repositories, and pull between them. That has its own set of advantages 
too: you can have slight differences between the trees. Of course, if you 
know you don't want any differences between the trees, that's not an 
advantage, that's a disadvantage.

You can also have just one single real git repository, and then have that 
one checked out multiple times. Use GIT_OBJECT_DIRECTORY to share the core 
objects, and then you can have ten different git trees without duplicating 
all your objects and pack-files.

> Is there any clever way to have this one git repository keep these
> other source trees in sync so that I can do incremental builds?

If you really want them 100%, the separate build trees is the best option.

That said, a lot of _other_ projects don't do separate build trees that 
well (and as mentioned, sometimes it breaks for the kernel too), and git 
certainly could be set up to be a "poor mans separate build tree".

Right now the easiest way to do that is to just have separate repositories 
(and share at least _some_ objects by just using "git clone -l -s" to 
clone them), but it could be hacked to be more geared explicitly towards 
that..

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Oct 29 12:07:14 2005

This archive was generated by hypermail 2.1.8 : 2005-10-29 12:07:21 EST