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

Re: integrating make and git

From
Jeff King <peff@peff.net>
Date
Apr 16, 2009, 08:26 UTC
Message-ID
<20090416082615.GA27365@coredump.intra.peff.net>
In-Reply-To
<200904151930.32816.robin.rosenberg.lists@dewire.com>
On Wed, Apr 15, 2009 at 07:30:32PM +0200, Robin Rosenberg wrote:
> Take a look at ccache. It doesn't use Git, but it uses hashes of source, and
> compiler flags and associates that with the resulting object files, so it
> can avoid compiling. If you are building largs C/C++ (especially C++)
> projects you want it. 

In theory, one could improve something like ccache by asking git the sha-1 of the file. Since git maintains a cache based on stat info, you can get away with not looking at the file contents at all (which saves CPU time in hashing, but also helps a lot when building from a cold cache).

In practice, this doesn't help because:
  1. ccache looks at more than just the file itself. I believe it
     actually runs it through cpp and hashes that.
  2. People combine ccache with make; if the stat data hasn't changed,
     in most cases, you will skip building before you even get to
     ccache.

But one could probably design a system to replace both ccache and make that relies on git's fast sha-1 reporting to avoid duplicate work. I suspect nobody has bothered because make+ccache is "fast enough" that the added complexity would not be worth it.

-Peff
Previous: Robin RosenbergNext: Matthieu Moy
Message 6 of 14 in “integrating make and git”
  1. E RApr 15, 2009
  2. Matthieu MoyApr 15, 2009
  3. Daniel BarkalowApr 15, 2009
  4. E RApr 15, 2009
  5. Robin RosenbergApr 15, 2009
  6. Jeff KingApr 16, 2009
  7. Matthieu MoyApr 16, 2009
  8. Nguyen Thai Ngoc DuyApr 16, 2009
  9. Daniel BarkalowApr 15, 2009
  10. John BitoApr 15, 2009
  11. Ben JacksonApr 16, 2009
  12. David KågedalApr 16, 2009
  13. Dmitry PotapovApr 17, 2009
  14. Ealdwulf WuffingaApr 18, 2009

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.