git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: git@vger.kernel.org, Mike Hommey <mh@glandium.org>,
	Jamie Wellnitz <jwellnitz@gmail.com>,
	Richard Assal <richard_assal@yahoo.com>
Subject: Re: git equivalent to clearcase wink-in
Date: Thu, 21 Jan 2010 02:51:24 +0100	[thread overview]
Message-ID: <201001210251.24948.johan@herland.net> (raw)
In-Reply-To: <fabb9a1e1001201434n1036253ds1120c2abc0d3728e@mail.gmail.com>

On Wednesday 20 January 2010, Sverre Rabbelier wrote:
> On Wed, Jan 20, 2010 at 22:12, Mike Hommey <mh@glandium.org> wrote:
> > Surely the ccache directory could be shared on nfs or some other
> > network filesystem. Or object file could be checked in, which is imho
> > ugly, but should work (better to do that on a separate branch)
> 
> Ha! It could even be stored as a note on the tree object? The whole
> notes business seems to be nearing a usable stage. Or maybe notes are
> text-only, mhhh. Johan?

In principle you could (ab)use the notes structure for this purpose. There 
is nothing inherently text-only about notes. I would certainly suggest to 
create a custom notes ref for this purpose, so that these object caches are 
not mixed up with other notes (and are also not displayed by git log).

I'm also not sure the putting the note on the tree object is the right 
granularity. You could imagine putting a .o-file as a note on the 
corresponding .c-file _blob_, but that would only work if the .o-file 
depended solely on the .c file (i.e. it would only work for preprocessed 
source, or .c-files without any #includes), so that is probably not viable.

The problem with putting the object cache on the tree object, is that it 
would only be useful for those building the exact same tree as the one where 
the cache was made. Even though ccache can handle changed files just fine, 
you would not be able to leverage it, since the cache would be hidden under 
a different tree object.


Here's is an even more extreme idea: AFAIK, ccache works by hashing a 
preprocessed source file, and mapping the hash value to the resulting object 
file. A later lookup of the same preprocessed source file will yield the 
object file without having to go through that pesky compilation.

Now, what if that hash function happened to be SHA1, and the mapping 
happened to be the Git object database? In other words you could create a 
notes tree where the keys are SHA1s from preprocessed source files, and the 
note objects are the corresponding object files. As long as you don't call 
gc_notes() on this notes tree, it doesn't really matter that your SHA1 keys 
do not really exist as objects in the Git repo. The notes code can happily 
map any arbitrary SHA1 sum to a note object; it's only in gc_notes() that we 
actually care whether that SHA1 identifies an existing Git object.


Oh, and BTW, I consider the notes feature to be ready for prime time once 
the patch series currently in 'pu' is fully merged.


Have fun! :)

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

  reply	other threads:[~2010-01-21  1:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 20:20 git equivalent to clearcase wink-in Richard Assal
2010-01-20 21:05 ` Jamie Wellnitz
2010-01-20 21:12   ` Mike Hommey
2010-01-20 22:34     ` Sverre Rabbelier
2010-01-21  1:51       ` Johan Herland [this message]
2010-01-21  7:46     ` Matthieu Moy
2010-01-20 21:24   ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201001210251.24948.johan@herland.net \
    --to=johan@herland.net \
    --cc=git@vger.kernel.org \
    --cc=jwellnitz@gmail.com \
    --cc=mh@glandium.org \
    --cc=richard_assal@yahoo.com \
    --cc=srabbelier@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).