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:29 UTC
Message-ID
<20180803132959.GB28939@sigill.intra.peff.net>
In-Reply-To
<877el7twej.fsf@evledraar.gmail.com>
On Fri, Aug 03, 2018 at 03:25:08PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 19 quoted lines
> > 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.
> 
> Right, I mean:
> 
>     is_new = !in_quarantine() && in_main()
> 
> Or:
> 
>     is_new = !in_main()
> 
> Should work, in the latter case if the object really is missing from the
> quarnatine too, other fsck bits will stop the push.

Ah, OK. Yes, I agree that should work to cover new objects (including ones that the other side but aren't actually needed to update the refs, though hopefully that is rare).

There may also be other object stores, if the main repository used alternates (or if somebody set GIT_ALTERNATE_OBJECT_DIRECTORIES). You can probably disregard that, though, as:

  1. If you ignore the main repo, presumably you ignore its
     recursive info/alternates, too.
  2. The easy mechanism for ignoring the main repo is to ignore
     GIT_ALTERNATE_OBJECT_DIRECTORIES, so you'd already be handling
     that.
Show 8 quoted lines
> But as you point out:
> 
>     is_new = in_quarantine()
> 
> Cannot be relied upon, although it'll be true most of the time.
> 
> Perhaps I'm missing some edge case above, but I wanted to reword it to
> make sure I understood it correctly (and perhaps you have a correction).
Nope, I just didn't think through what you were saying carefully enough. ;)
-Peff
Previous: Ævar Arnfjörð Bjarmason
Message 7 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.