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

Re: [PATCH 0/6] receive-pack: quarantine pushed objects

From
Christian Couder <christian.couder@gmail.com>
Date
Oct 2, 2016, 09:20 UTC
Message-ID
<CAP8UFD3Y1du+L9DRgz01wgbsCYiebu2DgyePH41MaDhjV24oHw@mail.gmail.com>
In-Reply-To
<20160930193533.ynbepaago6oycg5t@sigill.intra.peff.net>
On Fri, Sep 30, 2016 at 9:35 PM, Jeff King <peff@peff.net> wrote:
> I've mentioned before on the list that GitHub "quarantines" objects
> while the pre-receive hook runs. Here are the patches to implement
> that.
Great! Thanks for upstreaming these patches!
I wonder if the patch you sent in:
https://public-inbox.org/git/20160816144642.5ikkta4l5hyx6act@sigill.intra.peff.net/
is still useful or not.
Show 12 quoted lines
> The basic problem is that as-is, index-pack admits pushed objects into
> the main object database immediately, before the pre-receive hook runs.
> It _has_ to, since the hook needs to be able to actually look at the
> objects. However, this means that if the pre-receive hook rejects the
> push, we still end up with the objects in the repository. We can't just
> delete them as temporary files, because we don't know what other
> processes might have started referencing them.
>
> The solution here is to push into a "quarantine" directory that is
> accessible only to pre-receive, check_connected(), etc, and only
> move the objects into the main object database after we've finished
> those basic checks.

I guess if we fail the receive-pack because the pack is bigger than receive.maxInputSize, then the "quarantine" directory will also be removed, so the part of the pack that we received before failing the receive-pack will be deleted.

[...]
>     These two patches set that up by letting index-pack and pre-receive
>     know that quarantine path and use it to store arbitrary files that
>     _don't_ get migrated to the main object database (i.e., the log file
>     mentioned above).
It would be nice to have a diffstat for the whole series.

Thanks, Christian.

Previous: Jeff KingNext: Jeff King
Message 20 of 32 in “receive-pack: quarantine pushed objects”
  1. 0/6 receive-pack: quarantine pushed objectsJeff King, Sep 30, 2016
  2. 1/6 check_connected: accept an env argumentJeff King, Sep 30, 2016
  3. 2/6 sha1_file: always allow relative paths to alternatesJeff King, Sep 30, 2016
  4. René ScharfeOct 2, 2016
  5. Jeff KingOct 2, 2016
  6. Jeff KingOct 2, 2016
  7. Jeff KingOct 2, 2016
  8. 3/6 tmp-objdir: introduce API for temporary object directoriesJeff King, Sep 30, 2016
  9. Junio C HamanoSep 30, 2016
  10. Jeff KingSep 30, 2016
  11. David TurnerSep 30, 2016
  12. Jeff KingSep 30, 2016
  13. David TurnerSep 30, 2016
  14. 4/6 receive-pack: quarantine objects until pre-receive acceptsJeff King, Sep 30, 2016
  15. Jeff KingOct 1, 2016
  16. Ævar Arnfjörð BjarmasonApr 8, 2017
  17. Jeff KingApr 10, 2017
  18. 5/6 tmp-objdir: put quarantine information in the environmentJeff King, Sep 30, 2016
  19. 6/6 tmp-objdir: do not migrate files starting with '.'Jeff King, Sep 30, 2016
  20. Christian CouderOct 2, 2016
  21. Jeff KingOct 2, 2016
  22. Christian CouderOct 3, 2016
  23. 0/5 receive-pack: quarantine pushed objectsJeff King, Oct 3, 2016
  24. 1/5 check_connected: accept an env argumentJeff King, Oct 3, 2016
  25. Jakub NarębskiOct 5, 2016
  26. Jeff KingOct 5, 2016
  27. 2/5 tmp-objdir: introduce API for temporary object directoriesJeff King, Oct 3, 2016
  28. 3/5 receive-pack: quarantine objects until pre-receive acceptsJeff King, Oct 3, 2016
  29. 5/5 tmp-objdir: do not migrate files starting with '.'Jeff King, Oct 3, 2016
  30. 4/5 tmp-objdir: put quarantine information in the environmentJeff King, Oct 3, 2016
  31. Junio C HamanoOct 3, 2016
  32. Jeff KingOct 3, 2016

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.