Re: Question on GIT usage.
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Oct 31, 2005, 23:03 UTC
- Message-ID
- <Pine.LNX.4.64.0510311749080.25300@iabervon.org>
- In-Reply-To
- <4362C700.6020901@candelatech.com>
On Fri, 28 Oct 2005, Ben Greear wrote:
Show 7 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). > > 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?
The following is not at all standard; AFAICT, I'm the only person who does it. But...
You can have a single repository shared between multiple working trees, by having the repository somewhere and making .git/{objects,refs,info,remotes} be symlinks to the corresponding directories in the repository. I've got a script to set this up, if you want.
The system will be unhappy if you commit to a branch that is checked out elsewhere (because the head of that branch will change out from under the checked out version), like having someone push to a repository with the branch checked out.
You need to think about this as there only being one repository that has multiple working trees, rather than having working tree/repository pairs, where the repositories are connected as an optimization; anything you do in one of the working trees will automatically affect what the others see.
This isn't official supported, but it actually works quite well, except that things that should be shared are occasionally added to the .git directory (like remotes not too long ago).
-Daniel *This .sig left intentionally blank*