Re: [PATCH v2 08/10] midx: pass down `hash_algo` to `get_midx_filename[_ext]`
- From
karthik nayak <karthik.188@gmail.com>
- Date
- Nov 21, 2024, 15:35 UTC
- Message-ID
- <CAOLa=ZQPtxeuqf3VaZKai8=15shpynOA5yn1pWjnQ89wnc2U7w@mail.gmail.com>
- In-Reply-To
- <CAP8UFD3ZuTtd2SckoyvXmkMG3eeGqH3eHSHtda-4o5yGdj6cBg@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 13 quoted lines
> On Tue, Nov 19, 2024 at 4:39 PM Karthik Nayak <karthik.188@gmail.com> wrote: >> >> The function `get_midx_filename_ext` uses `hash_to_hex` which internally >> uses the global variable `the_repository`. To remove this dependency, >> pass down the `hash_algo` to both `get_midx_filename` and >> `get_midx_filename_ext`. > > Technically passing down the `hash_algo` to both functions is not > enough to remove the dependency, as replacing `hash_to_hex()` with > `hash_to_hex_algop*()` is also needed. It's a bit unclear if > `hash_to_hex()` calls are replaced with other calls in this patch or > not though. >
I see what you mean, this patch itself swaps `hash_to_hex()` with `hash_to_hex_algop()`, but only in `get_midx_filename[_ext]`.
> So you might want to add something like: "Replacing `hash_to_hex` with > functions that take an `hash_algo` as argument will be done in a > followup commit."
While we also do something similar in the next patch, I'll amend this commit message to be less vague and clarify the intention. Thanks.
> >> This adds `the_repository` variable usage to >> `midx-write.c`, which will be resolved in a future commit.
I think this is stale too and will remove it ;)