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

[PATCH/RFC 0/6] pack-objects hook for upload-pack

From
Jeff King <peff@peff.net>
Date
May 18, 2016, 22:37 UTC
Message-ID
<20160518223712.GA18317@sigill.intra.peff.net>

I've often wanted to intercept the call from upload-pack to pack-objects. The final patch in this series goes into more detail, but basically it's good for:

  1. Capturing the output from pack-objects for debugging/inspection.
  2. Capturing the input to pack-objects to replay for debugging or
     performance analysis.
  3. Caching pack-objects output.

It's pretty trivial to add a hook to run instead of pack-objects (and the hook would just run pack-objects itself). But we don't want to run hooks in upload-pack, because we don't necessarily trust the repository we're running in.

So instead we'd have to learn about the hook from the environment, or from any of the non-repo config files. And that in turn requires some support from the config code, which is what patches 1-5 are doing (along with some cleanups along the way).

I think the config refactoring is all pretty sane, and could support other "dangerous" features besides this particular hook in a way that's easy to use for site admins (whether they trust the repos they're serving or not). I've marked this "RFC" because I'd like input on some details of the final patch; I'll point out my questions separately there.

  [1/6]: git_config_with_options: drop "found" counting
  [2/6]: git_config_parse_parameter: refactor cleanup code
  [3/6]: config: set up config_source for command-line config
  [4/6]: config: return configset value for current_config_ functions
  [5/6]: config: add a notion of "scope"
  [6/6]: upload-pack: provide a hook for running pack-objects
-Peff
Next: Jeff King
Message 1 of 23 in “pack-objects hook for upload-pack”
  1. 0/6 pack-objects hook for upload-packJeff King, May 18, 2016
  2. 1/6 git_config_with_options: drop "found" countingJeff King, May 18, 2016
  3. 2/6 git_config_parse_parameter: refactor cleanup codeJeff King, May 18, 2016
  4. 3/6 config: set up config_source for command-line configJeff King, May 18, 2016
  5. 4/6 config: return configset value for current_config_ functionsJeff King, May 18, 2016
  6. Jeff KingMay 19, 2016
  7. Duy NguyenMay 26, 2016
  8. Junio C HamanoMay 26, 2016
  9. Jeff KingMay 26, 2016
  10. Junio C HamanoMay 26, 2016
  11. Jeff KingMay 27, 2016
  12. Junio C HamanoMay 27, 2016
  13. Jeff KingMay 27, 2016
  14. 5/6 config: add a notion of "scope"Jeff King, May 18, 2016
  15. 6/6 upload-pack: provide a hook for running pack-objectsJeff King, May 18, 2016
  16. Jeff KingMay 19, 2016
  17. Ævar Arnfjörð BjarmasonMay 19, 2016
  18. Jeff KingMay 19, 2016
  19. Ævar Arnfjörð BjarmasonMay 19, 2016
  20. Jeff KingMay 26, 2016
  21. Junio C HamanoMay 25, 2016
  22. Jeff KingMay 26, 2016
  23. Junio C HamanoMay 26, 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.