Re: [PATCH] merge-recursive: use fspathcmp() in path_hashmap_cmp()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 13, 2021, 19:58 UTC
- Message-ID
- <xmqqy280dz8s.fsf@gitster.g>
- In-Reply-To
- <YT+FzPT0RCP2PdNL@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> Another approach is to stuff the appropriate globals into the repository > struct, and then "push" onto the global the_repository pointer, treating > it like a stack. And then low-level code is free to use that global > context, even if it wasn't passed in. > ... > - it's a challenge with threading (an obvious problem would be a > multi-threaded grep which wanted to descend into a submodule). Using > a thread-local global for the_repository might solve that. > > It's possible that this is a terrible direction to go, so I'm not > necessarily endorsing it, but just offering it as a possibility to think > about. The trickiest thing is that any devil would likely be in the > details, and we wouldn't know until proceeding for a while along that > path. Whereas passing around a context struct, while verbose and > annoying, is a well-understood construct.
I agree that it is cute, thread-unsafe, and tricky. Let's leave it at an interesting thought experiment for now.
Thanks.