Thread (26 messages) flat view 26 messages, 3 authors, 2016-06-15

Re: [PATCH 17/17] memoize common git-path "constant" files

From: Jeff King <hidden>
Date: 2016-06-15 23:06:08

On Mon, Aug 10, 2015 at 02:05:14PM +0200, Michael Haggerty wrote:
I was wondering whether this memoization could interact badly with
update_common_dir(). For example, if any of the memoized functions were
called before git_common_dir is initialized, then the pre-git_common_dir
value would continue to be used even if git_common_dir is changed
afterwards. But I believe it is taboo to call git_path() before
setup_git_env(), so I think this is not a problem.
Calling git_path() actually ends up in setup_git_env(), because we
lazily call it from get_git_dir(). So if somebody tries to tweak
common_dir stuff too late, we could in theory cache a bogus value; but
the real problem is generating the bogosity in the first place.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help