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

Re: [PATCH v4 0/6] odb: make packfile generation pluggable

From
Karthik Nayak <karthik.188@gmail.com>
Date
Aug 21, 2026, 12:38 UTC
Message-ID
<CAOLa=ZQMjb1SzYTVVuMF0ajmre_5_q=L6bmSQwYY233f-RiVXA@mail.gmail.com>
In-Reply-To
<20260821-b4-pks-odb-generate-pack-v4-0-074e8bd641f8@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 111 quoted lines
> Hi,
>
> this patch series makes packfile generation pluggable.
>
> Note that this series only makes those parts pluggable that are required
> for the transport layer. The other parts that relate to packfile
> generation as required by our repository maintenance is kept as-is, as
> there is a bunch of options there that are way too specific to the
> "files" backend to be portable. This should ultimately not be much of a
> problem though, as maintenance itself is already pluggable in the first
> place.
>
> It's a bit of a shame though for git-pack-objects(1), which still isn't
> usable with alternate backends. I tried several times to find good
> solutions for making it fully pluggable, but due to the backend-specific
> options it's an utter mess. I want to eventually address this though:
> same as with git-refs(1), I want to introduce git-objects(1) to care
> about all things ODB. And as part of that command we can also introduce
> a command that generates packfiles in a generic fashion, without all the
> cruft that git-pack-objects(1) has. This is part of a future patch
> series though.
>
> Changes in v4:
>   - Improve an error message.
>   - Sneak in a small stylistic fix while at it.
>   - Link to v3: https://patch.msgid.link/20260820-b4-pks-odb-generate-pack-v3-0-bc42252f6169@pks.im
>
> Changes in v3:
>   - Fix a use-after-scope bug on abnormal exit when child processes are
>     cleaned up via `mark_child_for_cleanup()`, as noticed by Elijah.
>   - Link to v2: https://patch.msgid.link/20260817-b4-pks-odb-generate-pack-v2-0-4c8a96ccfdb3@pks.im
>
> Changes in v2:
>   - Mostly remove the dependencies on `the_repository` in "bundle.c".
>   - Link to v1: https://patch.msgid.link/20260807-b4-pks-odb-generate-pack-v1-0-7dec431ae7cd@pks.im
>
> The series is built on top of 2c78326f81 (The 11th batch, 2026-08-05).
>
> Thanks!
>
> Patrick
>
> ---
> Patrick Steinhardt (6):
>       odb: introduce interface to generate packfiles
>       upload-pack: generate packfiles via the object database
>       send-pack: generate packfiles via the object database
>       builtin/bundle: refactor option handling for progress meter
>       bundle: get (mostly) rid of `the_repository`
>       bundle: generate packfiles via the object database
>
>  builtin/bundle.c      |  34 +++++------
>  bundle.c              |  97 ++++++++++++++++++--------------
>  bundle.h              |   3 +-
>  odb.c                 |  21 +++++++
>  odb.h                 | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  odb/source-files.c    | 149 +++++++++++++++++++++++++++++++++++++++++++++++++
>  odb/source.h          |  33 +++++++++++
>  send-pack.c           | 101 +++++++++++----------------------
>  t/t5516-fetch-push.sh |  12 ++--
>  upload-pack.c         | 125 +++++++++++++++--------------------------
>  10 files changed, 508 insertions(+), 219 deletions(-)
>
> Range-diff versus v3:
>
> 1:  4a56334af1 = 1:  33039a0ab8 odb: introduce interface to generate packfiles
> 2:  1ff0eaf6b7 ! 2:  7093fcee83 upload-pack: generate packfiles via the object database
>     @@ upload-pack.c: static void create_pack_file(struct upload_pack_data *pack_data,
>      -	 */
>      +		oid_array_append(&opts.haves,
>      +				 &pack_data->extra_edge_obj.objects[i].item->oid);
>     -+
>     +
>      +	opts.thin = pack_data->use_thin_pack;
>      +	if (!pack_data->no_progress)
>      +		opts.progress = ODB_GENERATE_PACK_PROGRESS_STANDARD;
>     @@ upload-pack.c: static void create_pack_file(struct upload_pack_data *pack_data,
>      +	opts.progress_fd = -1;
>      +
>      +	if (odb_generate_pack(the_repository->objects, &generator, &opts))
>     -+		die("git upload-pack: unable to fork git-pack-objects");
>     ++		die("git upload-pack: unable to generate pack");
>      +	odb_generate_pack_options_release(&opts);
>     -
>     ++
>      +	/*
>      +	 * We read from generator->err to capture stderr output for the
>      +	 * progress bar, and generator->out to capture the pack data.
> 3:  22a19a9a70 = 3:  0a2ca04c01 send-pack: generate packfiles via the object database
> 4:  5d2275c90b = 4:  2d339ee7b7 builtin/bundle: refactor option handling for progress meter
> 5:  0f00e6d234 = 5:  3cf0210247 bundle: get (mostly) rid of `the_repository`
> 6:  ae6af210ff ! 6:  d3345e4407 bundle: generate packfiles via the object database
>     @@ Commit message
>
>       ## builtin/bundle.c ##
>      @@ builtin/bundle.c: static int parse_options_cmd_bundle(int argc,
>     + }
>
>       static int cmd_bundle_create(int argc, const char **argv, const char *prefix,
>     - 			     struct repository *repo UNUSED) {
>     +-			     struct repository *repo UNUSED) {
>      -	struct strvec pack_opts = STRVEC_INIT;
>     ++			     struct repository *repo UNUSED)
>     ++{
>       	int progress = isatty(STDERR_FILENO);
>       	int version = -1;
>       	struct option options[] = {
>
> ---
> base-commit: 2c78326f810173a4f3aefd8021f1e07575412481
> change-id: 20260807-b4-pks-odb-generate-pack-f30fbcdef3fc
Everything looks good now. Thanks!
Previous: Patrick Steinhardt
Message 58 of 58 in “odb: make packfile generation pluggable”
  1. 0/5 odb: make packfile generation pluggablePatrick Steinhardt, Aug 7, 2026
  2. 1/5 odb: introduce interface to generate packfilesPatrick Steinhardt, Aug 7, 2026
  3. 2/5 upload-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 7, 2026
  4. 3/5 send-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 7, 2026
  5. 4/5 builtin/bundle: refactor option handling for progress meterPatrick Steinhardt, Aug 7, 2026
  6. 5/5 bundle: generate packfiles via the object databasePatrick Steinhardt, Aug 7, 2026
  7. Junio C HamanoAug 13, 2026
  8. Patrick SteinhardtAug 14, 2026
  9. Junio C HamanoAug 7, 2026
  10. Patrick SteinhardtAug 10, 2026
  11. Taylor BlauAug 12, 2026
  12. Patrick SteinhardtAug 13, 2026
  13. Junio C HamanoAug 13, 2026
  14. 0/6 odb: make packfile generation pluggablePatrick Steinhardt, Aug 17, 2026
  15. 1/6 odb: introduce interface to generate packfilesPatrick Steinhardt, Aug 17, 2026
  16. Elijah NewrenAug 19, 2026
  17. Patrick SteinhardtAug 20, 2026
  18. Elijah NewrenAug 21, 2026
  19. Patrick SteinhardtAug 21, 2026
  20. 2/6 upload-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 17, 2026
  21. 3/6 send-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 17, 2026
  22. 4/6 builtin/bundle: refactor option handling for progress meterPatrick Steinhardt, Aug 17, 2026
  23. 5/6 bundle: get (mostly) rid of `the_repository`Patrick Steinhardt, Aug 17, 2026
  24. Junio C HamanoAug 17, 2026
  25. Patrick SteinhardtAug 18, 2026
  26. Elijah NewrenAug 21, 2026
  27. Patrick SteinhardtAug 21, 2026
  28. 6/6 bundle: generate packfiles via the object databasePatrick Steinhardt, Aug 17, 2026
  29. Justin ToblerAug 19, 2026
  30. Patrick SteinhardtAug 20, 2026
  31. 0/6 odb: make packfile generation pluggablePatrick Steinhardt, Aug 20, 2026
  32. 1/6 odb: introduce interface to generate packfilesPatrick Steinhardt, Aug 20, 2026
  33. Karthik NayakAug 20, 2026
  34. Patrick SteinhardtAug 20, 2026
  35. Junio C HamanoAug 20, 2026
  36. Patrick SteinhardtAug 21, 2026
  37. 2/6 upload-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 20, 2026
  38. Karthik NayakAug 20, 2026
  39. Patrick SteinhardtAug 20, 2026
  40. Karthik NayakAug 20, 2026
  41. 3/6 send-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 20, 2026
  42. 4/6 builtin/bundle: refactor option handling for progress meterPatrick Steinhardt, Aug 20, 2026
  43. Karthik NayakAug 20, 2026
  44. 5/6 bundle: get (mostly) rid of `the_repository`Patrick Steinhardt, Aug 20, 2026
  45. 6/6 bundle: generate packfiles via the object databasePatrick Steinhardt, Aug 20, 2026
  46. Karthik NayakAug 20, 2026
  47. Patrick SteinhardtAug 20, 2026
  48. Karthik NayakAug 20, 2026
  49. Patrick SteinhardtAug 20, 2026
  50. Elijah NewrenAug 21, 2026
  51. 0/6 odb: make packfile generation pluggablePatrick Steinhardt, Aug 21, 2026
  52. 1/6 odb: introduce interface to generate packfilesPatrick Steinhardt, Aug 21, 2026
  53. 2/6 upload-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 21, 2026
  54. 3/6 send-pack: generate packfiles via the object databasePatrick Steinhardt, Aug 21, 2026
  55. 4/6 builtin/bundle: refactor option handling for progress meterPatrick Steinhardt, Aug 21, 2026
  56. 5/6 bundle: get (mostly) rid of `the_repository`Patrick Steinhardt, Aug 21, 2026
  57. 6/6 bundle: generate packfiles via the object databasePatrick Steinhardt, Aug 21, 2026
  58. Karthik NayakAug 21, 2026

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.