Re: [PATCH v2 00/20] Introduce `USE_THE_REPOSITORY_VARIABLE` macro
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Jun 13, 2024, 23:14 UTC
- Message-ID
- <b69449d0-46f4-448e-b80e-002a8b5c4e1f@ramsayjones.plus.com>
- In-Reply-To
- <xmqqfrtgk7ah.fsf@gitster.g>
On 13/06/2024 19:48, Junio C Hamano wrote:
Show 34 quoted lines
> Junio C Hamano <gitster@pobox.com> writes: > >> Patrick Steinhardt <ps@pks.im> writes: >> >>> this is the second version of my patch series that introduce a new >>> `USE_THE_REPOSITORY_VARIABLE` macro. If undefined, then declarations >>> like `the_repository`, `the_hash_algo` and a subset of functions that >>> implicitly depend on either of these are hidden away. >> >> ;-) > > Two things. > > (1) This stupid change was needed to please "make sparse", or we'd > get this: > > repository.c:21:19: error: symbol 'the_repository' was not declared. Should it be static? > gmake: *** [Makefile:3259: repository.sp] Error 1 > > repository.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git c/repository.c w/repository.c > index 95d10cc4a0..22ef85b0b3 100644 > --- c/repository.c > +++ w/repository.c > @@ -18,6 +18,8 @@ > > /* The main repository */ > static struct repository the_repo; > + > +extern struct repository *the_repository; > struct repository *the_repository = &the_repo; >
Hmm, odd; isn't the declaration of 'the_repository' from the "repository.h" header file visible at this point?
puzzled.
ATB, Ramsay Jones