From: John Chapman Date: Sat, 08 Nov 2008 03:22:49 GMT Subject: [PATCH 2/2] Cached the git configuration, which is now noticibly faster on windows. Message-ID: <1226114569-8506-2-git-send-email-thestar@fussycoder.id.au> In-Reply-To: <1226114569-8506-1-git-send-email-thestar@fussycoder.id.au> Signed-off-by: John Chapman --- contrib/fast-import/git-p4 | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 38d1a17..9f0a5f9 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -316,8 +316,11 @@ def gitBranchExists(branch): stderr=subprocess.PIPE, stdout=subprocess.PIPE); return proc.wait() == 0; +_gitConfig = {} def gitConfig(key): - return read_pipe("git config %s" % key, ignore_error=True).strip() + if not _gitConfig.has_key(key): + _gitConfig[key] = read_pipe("git config %s" % key, ignore_error=True).strip() + return _gitConfig[key] def p4BranchesInGit(branchesAreInRemotes = True): branches = {} -- 1.6.0.3.643.g233db