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

Re: [PATCH v2] odb: add write_packfile, for_each_unique_abbrev, convert_object_id

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 26, 2026, 13:58 UTC
Message-ID
<acU7eJ0MpUVhCs6-@pks.im>
In-Reply-To
<pull.2074.v2.git.1774532383055.gitgitgadget@gmail.com>
On Thu, Mar 26, 2026 at 01:39:43PM +0000, Aaron Paterson via GitGitGadget wrote:
Show 17 quoted lines
> From: Aaron Paterson <apaterson@pm.me>
> 
> Add three vtable methods to odb_source that were not part of the
> recent ps/odb-sources and ps/object-counting series:
> 
>  - write_packfile: ingest a pack from a file descriptor. The files
>    backend chooses between index-pack (large packs) and
>    unpack-objects (small packs below fetch.unpackLimit). Options
>    cover thin-pack fixing, promisor marking, fsck, lockfile
>    capture, and shallow file passing.
> 
>  - for_each_unique_abbrev: iterate objects matching a hex prefix
>    for disambiguation. Searches loose objects via oidtree, then
>    multi-pack indices, then non-MIDX packs.
> 
>  - convert_object_id: translate between hash algorithms using the
>    loose object map. Used during SHA-1 to SHA-256 migration.

This will conflict with ps/odb-generic-object-name-handling, which already introduces generic callbacks for `for_each_unique_abbrev()`. There's also ongoing work by Justin to handle writing packfiles via the ODB transaction interface.

> Also add ODB_SOURCE_HELPER to the source type enum, preparing for
> the helper backend in the next commit.
Huh.
> The write_packfile vtable method replaces the pattern where callers
> spawn index-pack/unpack-objects directly. fast-import already uses
> odb_write_packfile() and this allows non-files backends to handle
> pack ingestion through their own mechanism.

I'm again a bit puzzled, same as with your previous patch series. It would be nice to collaborate on this topic, but that will require a bit more coordination than just sending in a patch series as things are quite in flux here.

Patrick
Previous: Aaron Paterson via GitGitGadgetNext: apaterson@pm.me
Message 3 of 5 in “odb: add write_packfile, for_each_unique_abbrev, convert_object_id”
  1. odb: add write_packfile, for_each_unique_abbrev, convert_object_idAaron Paterson via GitGitGadget, Mar 26, 2026
  2. odb: add write_packfile, for_each_unique_abbrev, convert_object_idAaron Paterson via GitGitGadget, Mar 26, 2026
  3. Patrick SteinhardtMar 26, 2026
  4. apaterson@pm.meMar 26, 2026
  5. Patrick SteinhardtMar 27, 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.