Thread View: linux.kernel.git
2 messages
2 total messages
Started by Joie Joie
Fri, 06 Nov 2026 17:44
[Outreachy] fast-import: Use repo_for_each_pack() for duplicate checks
Author: Joie Joie
Date: Fri, 06 Nov 2026 17:44
Date: Fri, 06 Nov 2026 17:44
21 lines
11922 bytes
11922 bytes
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
Re: [Outreachy] fast-import: Use repo_for_each_pack() for duplicate checks
Author: Karthik Nayak
Date: Mon, 09 Nov 2026 15:25
Date: Mon, 09 Nov 2026 15:25
63 lines
14675 bytes
14675 bytes
--000000000000ccf16e065fd99369 Content-Type: text/plain; charset="UTF-8" >Patrick Steinhardt <ps@pks.im> writes: > Hi Joie, > > On Fri, Nov 06, 2026 at 06:44:49PM +0100, Joie Joie wrote: >> 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. > > No. `repo_for_each_pack()` was introduced as a helper function to make > the migration towards pluggable object databases a bit easier. But it is > ultimately still flawed, as it assumes that the backend uses packfiles > in the first place. So the goal is rather to eventually get rid of this > macro altogether in favor of higher-level interfaces that can be > implemented by arbitrary backends. > > For git-fast-import(1) this will be done by making use of transactions, > and Karthik has already started taking a look at it, so I've Cc'd him. > For other subsystems we'll need to investigate how to do it properly. > Yeah, that's the idea. I have started poking around a bit and don't have anything concrete yet. I was hoping to send in a series cleaning up the tests before getting into the weeds. > Thanks! > > Patrick --000000000000ccf16e065fd99369 Content-Type: application/pgp-signature; name="signature.asc" Content-Disposition: attachment; filename="signature.asc" Content-Transfer-Encoding: base64 X-Attachment-Id: 1a414ad7323a7341_0.1 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSEtCQUVCQ2dBMEZpRUVWODVNZjJOMWNR L0xaY1lHUHRXZkpJNUdqSDhGQW1yeDVmMFdIR3RoY25Sb2FXc3UKTVRnNFFHZHRZV2xzTG1OdmJR QUtDUkErMVo4a2prYU1mekRwREFDaHg2NkNIellBWkVxeG8yVWhBeTIrTUFubgovWEtrZ0dEVVhB cGJaTFZoR1duaHNmK1o1WFZONGxoSEdHVitrTS90dEtsOHBKVi9BU3prRkJnUjZIYURYSUdGClRo QjRacCsrSTdWTENJU1RRanBneTQvbU8xWFl4dmp6U2h1RnloRnJOeGxxV0ltWHhnSzJxaFBUTnJY UU5yWjIKRzZtUS9FbVJLSk02dmdYbXJTdGwyV0JTb0tUZ3UyQlE4UmhYMVFqMGFaaDhRSm41SmpE TUtVSGs1ZG1FQVdJMQpuMkdjblpXY2s2UzRMK05mVFNOZVozUCswUTJrVHdzczlvQk1QMTJiaHBM bUFVcDlWVE1rY3A0eWQ4MElyQnZQCnhGN0NWR3Q0VjdSazVmTDdnUmZnSXdJNVYwQ3g3TWVXeVJ0 a2E5NUhkNUFTRnNtMzZDOUVsNjdIc0g1TTNrRjYKQUtKbUwxUGIwbkxiTVo1Mm9wMjFjbGx2WTkz ZU9wZzdoVTRYSS9DeCsyUVNxY1lrZjF0UVE0aVl6MzQvRzN0ZQp4aWMzSG1KdUs1WmdnZGZiZkZr WVdFbjI3aHh0ZEo3ZXFTbTZZbW83L2I0dEp6eE1qSEFHVU9XUHpRT1JDZm5UCnlZY3pkaEV0N2l1 YUpZbWUySnlhWkFkQ1I1cXpuWFJqVDM5ODVLZz0KPU5Lcy8KLS0tLS1FTkQgUEdQIFNJR05BVFVS RS0tLS0t --000000000000ccf16e065fd99369--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads