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

updating only changed files source directory?

From
Han-Wen Nienhuys <hanwen@xs4all.nl>
Date
Oct 24, 2006, 01:33 UTC
Message-ID
<ehjqgf$ggb$1@sea.gmane.org>
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 binary builder does this for several branches and several platforms of the project. Due to parallel compilation, it might even be possible that different branches of are being checked out concurrently from a single repository.

For a VCS, this is slightly nonstandard use, as we don't do any work in the working dir, we just compile from it, but have many working directories.

I have some questions and remarks
* Is there a command analogous to git-clone for updating a repository?
Right now, I'm using a combination of
   git-http-fetch -a <branch>  <url>
   wget <url>/refs/head/<branch>    ## dump to <myrepo>/refs/head/<branch>

for all branches I want to know about. I was looking for a command that would update the heads of all branches.

* Why is the order of args in git-http-fetch inconsistent with the
order in git-fetch? in fetch, the repository comes first, in
http-fetch, it comes last
* How do I update a source directory?
I can do the following
   git --git-dir <myrepo> read-tree <committish>
   cd <srcdir>
   git --git-dir <myrepo> checkout-index -a -f

Unfortunately, this touches all files, which messes up the timestamps triggering needless recompilation. How can I make checkout-index only touch files that have changed? Or alternatively, make checkout-index remember timestamps on files that didn't change?

Of course, I can store the commitish of the last version of the srcdir, and apply the diff between both to the source directory, but that seems somewhat convoluted. Is there a better way?

* As far as I can see, there is no reason to have only one index in a
git repository. Why isn't it possible to specify an alternate
index-file with an option similar to --git-dir ?
-- 
  Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
Next: Shawn Pearce
Message 1 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.