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

From: Michael Haggerty <[email-masked]>
Date: Mon, 10 Aug 2015 14:05:14 +0200

On 08/10/2015 11:38 AM, Jeff King wrote:
> [...]
> This patch introduces a series of functions to "memoize"
> these strings, which are essentially globals for the
> lifetime of the program. We compute the value once, take
> ownership of the buffer, and return the cached value for
> subsequent calls.  cache.h provides a helper macro for
> defining these functions as one-liners, and defines a few
> common ones for global use.
> [...]

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.

Michael

-- 
Michael Haggerty
[email-masked]