Re: [PATCH 02/18] setup: stop using `the_repository` in `is_inside_worktree()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 19, 2026, 09:50 UTC
- Message-ID
- <agwyf8LATRyY0kAq@pks.im>
- In-Reply-To
- <xmqqqzn89os3.fsf@gitster.g>
On Tue, May 19, 2026 at 10:22:20AM +0900, Junio C Hamano wrote:
Show 23 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > >> I do not offhand know if other code paths that are called from this > >> function are thread-safe, but yeah, this use of file-scope static is > >> not a safe thing to do. > > > > In the current status quo this is a safe conversion to do, as we still > > have the assumption ingrained that this only works for a single repo. > > We were using static variables before, and we're still using static > > variables now. > > > > That being said, I wouldn't mind dropping the static variable if this is > > something we'd rather want to get rid of. It's a smell that I'm not > > particularly happy about myself. > > > > I'll send a revised version in a bit, thanks! > > OK. In the v2 (perhaps v3?) series, I can see the removal of two > static strbuf based "optimizations" is the only change since the > previous round (after merging the previous one to the base of the > new iteration and comparing the result with the new iteration). > > Looking very good. Shall we mark the topic for 'next' now?
I'll send one final round to address Karthik's comment on the commit message, but once that's out I think this series is ready. Thanks!
Patrick