Re: [PATCH 12/17] odb: trivial refactorings to get rid of `the_repository`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Derrick Stolee <stolee@xxxxxxxxx> writes:

> On 5/6/25 7:09 AM, Patrick Steinhardt wrote:
>> All of the external functions provided by the object database subsystem
>> don't depend on `the_repository` anymore, but some internal functions
>> still do. Refactor those cases by plumbing through the repository that
>> owns the object database.
>> This change allows us to get rid of the
>> `USE_THE_REPOSITORY_VARIABLE`
>> preprocessor define.
>
>> --- a/odb.c
>> +++ b/odb.c
>> @@ -1,5 +1,3 @@
>> -#define USE_THE_REPOSITORY_VARIABLE
>> -
>
> Very satisfying! Thanks,

Yes, nice outcome.  I looked at the resulting odb.c and was a bit
unhappy to see that we still need to pass "struct repository *"
(instead of "struct object_database *") around.  But that is not
because we assume we can get to an odb via repo, but primarily
because repo has many things like config access and hash-algo that
we rely on, so it is perfectly OK.

At some places, where we pass odb around, we can and do go from it
to its repository (e.g. odb->repo->hash_algo), which was what I am
expecting to see more of in the future.

Thanks.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux