git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Question on GIT usage.

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 29, 2005, 02:06 UTC
Message-ID
<Pine.LNX.4.64.0510281847220.3348@g5.osdl.org>
In-Reply-To
<4362C700.6020901@candelatech.com>
On Fri, 28 Oct 2005, Ben Greear wrote:
Show 5 quoted lines
> 
> 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
Previous: Ryan AndersonNext: Daniel Barkalow
Message 3 of 9 in “Question on GIT usage.”
  1. Ben GreearOct 29, 2005
  2. Ryan AndersonOct 29, 2005
  3. Linus TorvaldsOct 29, 2005
  4. Daniel BarkalowOct 31, 2005
  5. Linus TorvaldsOct 31, 2005
  6. Daniel BarkalowOct 31, 2005
  7. Linus TorvaldsOct 31, 2005
  8. Daniel BarkalowOct 31, 2005
  9. Junio C HamanoNov 1, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.