Re: [PATCH 07/16] hex.h: move some hex-related declarations from cache.h
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 23, 2023, 19:31 UTC
- Message-ID
- <CABPp-BEDwrAdT4wzA0JMt2jSQNK+wTfBeaEnhau3AE0+spwsFQ@mail.gmail.com>
- In-Reply-To
- <22ca24ee-39fe-013a-494a-ed7f140210fa@github.com>
On Thu, Feb 23, 2023 at 6:11 AM Derrick Stolee <derrickstolee@github.com> wrote:
Show 25 quoted lines
> > On 2/23/2023 3:05 AM, Elijah Newren via GitGitGadget wrote: > > From: Elijah Newren <newren@gmail.com> > > > > hex.c contains code for hex-related functions, but for some reason these > > functions were declared in the catch-all cache.h. Move the function > > declarations into a hex.h header instead. > > > > This also allows us to remove includes of cache.h from a few C files. > > > diff --git a/cache.h b/cache.h > > index daf6150bb3c..d0619ce2e63 100644 > > --- a/cache.h > > +++ b/cache.h > > @@ -13,6 +13,7 @@ > > #include "string-list.h" > > #include "pack-revindex.h" > > #include "hash.h" > > +#include "hex.h" > > Adding this to cache.h is definitely safe, but it makes it so .c > files that consume the moved code do not _need_ to include hex.h > like I think you want to imply at the end of this patch. > > What changes if you drop this from your change?
I need to add a #include "hex.h" in 171 C files. I was worried previously that the sheer number of locations that I need to add such a header would cause my series to heavily conflict with next and seen, but it appears that these changes do not introduce any new conflicts. So, I guess I should have done it all along.
I think I'll do that in a separate follow-on commit instead of combining it with this one (so that this commit doesn't become excessively hard to review).