Re: [PATCH v8 09/10] grep: simplify config parsing and option parsing
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jan 19, 2022, 01:15 UTC
- Message-ID
- <220119.86bl08o76l.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <xmqq35lkpm4q.fsf@gitster.g>
On Tue, Jan 18 2022, Junio C Hamano wrote:
Show 10 quoted lines
> Æ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.
Yes, it does assume the current one-shot API users, e.g. "git grep --recurse-submodules" only reads the config of the one parent repo.
Show 7 quoted lines
> 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.
*nod*, will change it.