git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Tim Ansell <mithro@mithis.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH 2/3] replace_object: add mechanism to replace objects found in "refs/replace/"
Date: Mon, 12 Jan 2009 10:50:23 +0100	[thread overview]
Message-ID: <200901121050.24548.jnareb@gmail.com> (raw)
In-Reply-To: <1231727868.6716.155.camel@vaio>

On Mon, 12 Jan 2009, Tim 'mithro' Ansell wrote:

> > I just had an idea: we can use this mechanism to better manage large
> > binary files in Git, by using replacements for _blobs_.
> > 
> > We want to be able to have two flavours of repository: one with large
> > blobs (media files usually), and one without.  We can use stubs in the
> > place of large binary files in 'no-megablobs' flavor, and add contents
> > of those files via refs/replace/* for _blobs_ in 'with-megablobs'
> > flavour.  We can control which objects we want to have, and which
> > objects to transfer.
> > 
> > What do you think about this (abuse of) an idea?
> 
> I'm not sure I understand. I don't really care much about the
> implementation details if it's transparent to the user :)
> 
> I have not really had much time to pursue my idea of getting sha1_file
> to read download blob on an as-needed basis (work has been hectic).

Actually this idea is a bit different from lazy / on demand downloading
of large blobs.


In "on demand loading" solution you have sha-1 of _full_ blob in a tree,
but git knows that not having it is not a fatal error (somehow), and you
can ask git to download it. This is as far as I understand the solution
you proposed and partially implemented.

In "replacement blobs" solution, the (ab)use of object replacement
mechanism meant originally for easier bisect, you have sha-1 of _stub_
object in a tree.  If you want full (large) blob, you add replacement
in refs/replace/*, replacing stub blob object (must be unique; it can
for example contain some header + sha-1 of full object) with full
object.  If you want to have large object, you need to transfer 
refs/replace/*.  This solution means that user needs to be aware of
this mechanism, or have some wrapper (script) around it.


Different solution, and a bit different behavior wrt getting large
object for the user.

-- 
Jakub Narebski
Poland

  parent reply	other threads:[~2009-01-12  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-07  7:43 [RFC/PATCH 2/3] replace_object: add mechanism to replace objects found in "refs/replace/" Christian Couder
2009-01-07  8:41 ` Junio C Hamano
2009-01-08 17:31   ` Christian Couder
2009-01-08 23:55     ` Junio C Hamano
2009-01-10 16:30       ` Jakub Narebski
     [not found]         ` <1231727868.6716.155.camel@vaio>
2009-01-12  9:50           ` Jakub Narebski [this message]
2009-01-07 12:29 ` Johannes Schindelin

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=200901121050.24548.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mithro@mithis.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).