Re: [PATCH v2 3/4] apply: remove the_repository global variable
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 1, 2024, 17:10 UTC
- Message-ID
- <xmqqwmirzr32.fsf@gitster.g>
- In-Reply-To
- <Zvvr1_9syRh1McVA@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 5 quoted lines
> I disagree with this statement. If code isn't prepare to not handle a > `NULL` repository we shouldn't fall back to `the_repository`, but we > should instead prepare the code to handle this case. This of course > requires us to do a ton of refactorings, but that is the idea of this > whole exercise to get rid of `the_repository`.
I agree. To me, the patch was screaming that the author was not prepared to go the whole nine yards, though. Adding back the explicit reference to "the_repository" as a fallback is the next best thing to do, pushing the "problem" closer to where it is.
> If a command cannot be converted to stop using `the_repository` right > now we should skip it and revisit once all prerequisites have been > adapted accordingly.
That is also a viable approach.