Re: [PATCH v2 02/10] midx-write: pass down repository to static functions

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

 



On Wed, Nov 20, 2024 at 07:15:04PM +0100, Christian Couder wrote:
> On Tue, Nov 19, 2024 at 5:36 PM Karthik Nayak <karthik.188@xxxxxxxxx> 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/

Good eyes.

> 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.

I think this is fine to leave out personally. Since hash_to_hex()
relies on the_hash_algo only, it's natural to expect that when a caller
has access to a new variable pointing at a 'struct git_hash_algo' that
they would convert that function to hash_to_hex_algop().

Thanks,
Taylor




[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