From: Jeff King Date: Thu, 16 Apr 2009 08:26:15 GMT Subject: Re: integrating make and git 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