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

Re: updating only changed files source directory?

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Oct 24, 2006, 19:12 UTC
Message-ID
<Pine.LNX.4.64.0610241435420.9789@iabervon.org>
In-Reply-To
<ehjqgf$ggb$1@sea.gmane.org>
On Tue, 24 Oct 2006, Han-Wen Nienhuys wrote:
Show 16 quoted lines
> 
> Hello there,
> 
> I'm just starting out with GIT.  Initially, I want to use experiment with
> integrating it into our binary builder structure for LilyPond.
> 
> The binary builder roughly does this:
> 
>  1. get source code updates from a server to a single, local
>     repository. This is currently a git repository that is that
>     tracks our CVS server.
> 
>  2. copy latest commit from a branch to separate source directory.
>     This copy should only update files that changed.
> 
>  3. Incrementally compile from that source directory

The terminology in the git world is, I think, a little different from what you expect. We call the thing that contains all of the tracked information (what you're calling the repository) the "object database"; what we call the "repository" is a bit different: it primarily keeps track of the heads of branches, in addition to either containing an object database or referencing an external one. So you need a repository for each source directory (because it keeps track of what commit is currently in the source directory), but it doesn't need to have its own complete object database, which is what you're trying to share between all of them.

You have a single repository with no source directory that contains the database and the heads according to the upstream source, and then each source directory has a repository that contains the head as far as you've built it in that directory. You fetch into the single bare repository from upstream, and then pull into each source directory from the bare repository; this will do the minimal update to the contents of the source directory automatically.

I think that you want to request a few git features:
 - support having a bare repository not on a branch, so that it can fetch 
   all heads from its upstream. You're not doing anything branch-specific 
   in the bare repository anyway, but git currently wants a valid HEAD to
   accept a path as containing a git repository
 - support getting an origin remote configuration with a bare repository
 - support cloning a branch of a repository, such that the clone's 
   "origin" is the upstream's chosen branch, not its "master".
 - support cloning without generating a "master" branch in the clone, and 
   instead starting on "origin"
Then you do:
git clone --bare --no-head --with-origin <upstream> REPOSITORY.git
for each branch:
  git clone --shared --branch=<branch> --no-master REPOSITORY.git <branch>
When you want to update:
GIT_DIR=REPOSITORY.git git fetch
for each branch:
 (cd <branch>; git pull; make)

Note that all of the features you need are in "clone" for setting things up nicely automatically; if you arrange everything by hand just right, you can already to the updating procedure I give.

	-Daniel
Previous: Jakub NarebskiNext: Han-Wen Nienhuys
Message 6 of 8 in “updating only changed files source directory?”
  1. Han-Wen NienhuysOct 24, 2006
  2. Shawn PearceOct 24, 2006
  3. Jakub NarebskiOct 24, 2006
  4. Han-Wen NienhuysOct 24, 2006
  5. Jakub NarebskiOct 24, 2006
  6. Daniel BarkalowOct 24, 2006
  7. Han-Wen NienhuysOct 25, 2006
  8. Daniel BarkalowOct 25, 2006

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.