Re: [PATCH v8 09/10] grep: simplify config parsing and option parsing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 19, 2022, 01:09 UTC
- Message-ID
- <xmqq35lkpm4q.fsf@gitster.g>
- In-Reply-To
- <220119.86wniwo9mz.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> If we had a grep IPC call of some sort we'd surely limit it to the > "modern" config of grep.patternType, and take the opportunity to > deprecate grep.extendedRegexp from that interface.
A process that visits more than one repositories, with different configuration, does not have such a choice. As far as I tell, there is not yet a way to undo the static in the code after these patches so that such a process can reset between repositories.
A member that is necessary only during configuration parsing is not a problem as long as the field is marked clearly as such (I wouldn't even call that "not a NEW problem", since it is not a problem to begin with, and I am sure there are more examples in other subsystems). A static inside a helper function that has subtle interactions with second and subsequent invocations makes the code much harder to follow, on the other hand.