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

Re: Adding git hooks

From
Jeff King <peff@peff.net>
Date
Apr 26, 2014, 17:50 UTC
Message-ID
<20140426175002.GC21493@sigill.intra.peff.net>
In-Reply-To
<7vy4yshul9.fsf@alter.siamese.dyndns.org>
On Sat, Apr 26, 2014 at 10:24:50AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Suvorov Ivan <sv_91@inbox.ru> writes:
> 
> > I want to extend the functionality of git due to the possibility of
> > separation of the user repository into 2 parts - one part will be
> > stored as usual, under version control git, and the second part will
> > be stored in another location such as an FTP-server.
> 
> Sounds like you are looking for git-annex, perhaps?

I agree that is the right approach, but git-annex and git-media work _above_ the object layer, and taint the history by storing symlinks in git instead of the real sha1s. I'd love to see a solution that does the same thing, but lives at the pack/loose object layer. Basically:

  1. Teach sha1-file.c to look for missing objects by hitting an
     external script, like:
        git config odb.command "curl https://example.com/%s"
     and place them in an alternates-like separate object database.
  2. Teach the git protocol a new extension to say "don't bother sending
     blobs over size X". You'd have to coordinate that X with the source
     from your odb.command.

You'd probably want to wrap up the odb.command in a more fancy helper. For example, for performance, we'd probably want to be able to query it for "which objects do you have", as well as "fetch this object". And it would be nice if it could auto-query the "X" for step 2, and manage pruning local objects (e.g., when they become deep in history).

We'd probably also want to teach a few places in git to treat external objects specially. For example, they should probably be auto-treated as binary, so that a "log -p" does not try to fetch all of them. And likewise, things like "log -S" should probably ignore them by default.

I have a messy sketch of step 1 that I did quite a while ago, but haven't proceeded further on it.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “Adding git hooks”
  1. Suvorov IvanApr 26, 2014
  2. Junio C HamanoApr 26, 2014
  3. Jeff KingApr 26, 2014
  4. Junio C HamanoApr 28, 2014
  5. Jeff KingApr 28, 2014

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.