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

Re: Question regarding quarantine environments

From
Jeff King <peff@peff.net>
Date
Aug 3, 2018, 13:00 UTC
Message-ID
<20180803130058.GA4671@sigill.intra.peff.net>
In-Reply-To
<878t5ntxqs.fsf@evledraar.gmail.com>
On Fri, Aug 03, 2018 at 02:56:11PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
> > Any Git commands you run should therefore find objects from either
> > location, but any writes would go to the quarantine (most notably, Git's
> > own index-pack/unpack-objects processes, which is the point of the
> > quarantine in the first place).
> 
> To add to this, one interesting thing that you can do with hooks because
> of this quarantine is to answer certain questions about the push that
> were prohibitively expensive before it existed, but there's no explicit
> documentation for this.
> 
> E.g. for a hook that wants to ban big blobs in the repo, but wants to
> allow all existing blobs (you don't want to block e.g. a revert of a
> commit that removed it from the checkout), you can juggle these two env
> variables and hide the "main" object dir from the hook for some
> operations, so e.g. if a blob lookup succeeds in the alternate
> quarantine dir, but not the main object dir, you know it's new.

I'd be a bit careful with that, though, as the definition of "new" is vague there.

For example, completing a thin pack may mean that the receiver creates a copy of a base object found in the main repo. That object isn't new as part of the push, nor was it even sent on the wire, but it will appear in the quarantine directory. But only sometimes, depending on whether we kept the sender's pack or exploded it to loose objects.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 5 of 7 in “Question regarding quarantine environments”
  1. Liam DeckerAug 2, 2018
  2. Jeff KingAug 2, 2018
  3. Jonathan NiederAug 3, 2018
  4. Ævar Arnfjörð BjarmasonAug 3, 2018
  5. Jeff KingAug 3, 2018
  6. Ævar Arnfjörð BjarmasonAug 3, 2018
  7. Jeff KingAug 3, 2018

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.