Re: [PATCH v2 02/10] midx-write: pass down repository to static functions
- From
karthik nayak <karthik.188@gmail.com>
- Date
- Nov 21, 2024, 14:57 UTC
- Message-ID
- <CAOLa=ZRRohwY85wbhJcb0zJhWx5MKfPJqSXDdSkPR5br1CBeCQ@mail.gmail.com>
- In-Reply-To
- <CAP8UFD0RpTXCdeYPA44yiS1E-LsmSHVrGxNKaUFkvUqq+zNTZw@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 14 quoted lines
> On Tue, Nov 19, 2024 at 5:36 PM Karthik Nayak <karthik.188@gmail.com> wrote: >> >> In 'midx-write.c' there are a lot of static functions which use global >> variables `the_repository` or `the_hash_algo`. In a follow up commit, >> the repository variable will be added to `write_midx_context`, which >> some of the functions can use. But for functions which do not have >> access to this struct, pass down the required information from >> non-static functions `write_midx_file` and `write_midx_file_only`. >> >> This ensures that the usage of global variables is limited to these >> non-static functions, which will be cleaned up in a follow up commits. > > s/commits/commit/ >
Will fix.
Show 5 quoted lines
> There are a few places in the patch where hash_to_hex() is replaced > with hash_to_hex_algop(). However hash_to_hex() is not quite a static > function and is not defined in 'midx-write.c'. So you might want to > mention this additional change in the commit message. >
While I think it is obvious, that might not be the case, so I'll add in a line to explain why we swap those functions.
> Thanks.