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

[Outreachy] fast-import: Use repo_for_each_pack() for duplicate checks

From
JJJoie Joie <soniqjjj@gmail.com>
Date
Nov 6, 2026, 17:44 UTC
Message-ID
<CAH=d44co_ZFA8EJwAoFL4=88ZqWzO65_+GbHDZfjG8amR4cHBw@mail.gmail.com>
Hi Patrick,

I was looking through `fast-import.c` and noticed that both `store_object()` and `stream_blob()` still loop through `files->dirs` to check whether an object is already in a pack.

I saw that Git already has `repo_for_each_pack()`, which is used in places like `count-objects.c` and `pack-objects.c`.

Would it be worth using that iterator in these two places instead? The idea would be to avoid accessing the files backend directly while keeping the current packed-object lookup and duplicate-handling behavior unchanged.

I haven't made any changes yet. I wanted to get your thoughts first and check whether this would be a useful follow-up in the current refactoring work.

Thanks! Joy

Next: Patrick Steinhardt
Message 1 of 3 in “[Outreachy] fast-import: Use repo_for_each_pack() for duplicate checks”
  1. Joie JoieNov 6, 2026
  2. Patrick SteinhardtNov 9, 2026
  3. Karthik NayakNov 9, 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.