From: Avery Pennarun <apenwarr@gmail.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>, git@vger.kernel.org
Subject: Configurable callbacks for missing objects (we Re: upload-pack: support subtree packing)
Date: Tue, 27 Jul 2010 14:51:27 -0400 [thread overview]
Message-ID: <20100727185127.GD25124@worldvisions.ca> (raw)
In-Reply-To: <20100727144605.GA25268@spearce.org>
On Tue, Jul 27, 2010 at 07:46:05AM -0700, Shawn O. Pearce wrote:
> But I disagree with the client rewriting the commits in order to
> work with them locally. Doing so means you can't take a commit
> from your team's issue tracker and look it up. And any commit
> you create can't be pushed back to the server without rewriting.
> Its messy for the end-user to work with.
Yeah, that doesn't sound ideal. And I wrote git-subtree, which does exactly
that, so I should know :)
> I would prefer doing something more like what we do with shallow
> on the client side. Record in a magic file the path(s) that we
> did actually obtain. During fsck, rev-list, or read-tree the
> client skips over any paths that don't match that file's listing.
> Then we can keep the same commit SHA-1s, but we won't complain that
> there are objects missing.
Disclaimer: I've never looked at any of the fetch code.
But I've been thinking that a really elegant way to solve the problem could
be to have a user-configurable "get the missing objects" callback. If any
part of git that *needs* an object can't find it, it calls this callback to
go try to retrieve it (either just that one object, or it can request to
download the object recursively, ie. everything it points to).
Then shallow clones could just auto-fill themselves if you really need a
prior version, for example.
It's also conceivable that we could limit this just to blobs: downloading
the complete set of commit objects, and probably even the complete set of
tree objects, is probably not that expensive. And that would allow someone
to do virtually all operations (other than three-way merges to resolve blob
conflicts) without having the entire repo.
I say it could be user-configurable because that's where you could plugin a
gittorrent, or a tool that just tries fetching from a series of repositories in
turn, etc.
Have fun,
Avery
next prev parent reply other threads:[~2010-07-27 18:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 23:36 [PATCH 0/2] Subtree clone? Nguyễn Thái Ngọc Duy
2010-07-26 23:36 ` [PATCH 1/2] upload-pack: support subtree packing Nguyễn Thái Ngọc Duy
2010-07-27 13:15 ` Ævar Arnfjörð Bjarmason
2010-07-27 14:46 ` Shawn O. Pearce
2010-07-27 18:51 ` Avery Pennarun [this message]
2010-07-27 22:32 ` Configurable callbacks for missing objects (we Re: upload-pack: support subtree packing) Nguyen Thai Ngoc Duy
2010-07-28 1:53 ` Elijah Newren
2010-07-28 2:00 ` Avery Pennarun
2010-07-27 22:29 ` [PATCH 1/2] upload-pack: support subtree packing Nguyen Thai Ngoc Duy
2010-07-26 23:36 ` [PATCH 2/2] fetch-pack: support --subtree and --commit-subtree options Nguyễn Thái Ngọc Duy
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=20100727185127.GD25124@worldvisions.ca \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=spearce@spearce.org \
/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).