git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Chapman <thestar@fussycoder.id.au>
To: git@vger.kernel.org
Cc: John Chapman <thestar@fussycoder.id.au>
Subject: [PATCH 2/2] Cached the git configuration, which is now noticibly faster on windows.
Date: Sat,  8 Nov 2008 14:22:49 +1100	[thread overview]
Message-ID: <1226114569-8506-2-git-send-email-thestar@fussycoder.id.au> (raw)
In-Reply-To: <1226114569-8506-1-git-send-email-thestar@fussycoder.id.au>


Signed-off-by: John Chapman <thestar@fussycoder.id.au>
---
 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

  reply	other threads:[~2008-11-08  5:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-08  3:22 [PATCH 1/2] Added support for purged files and also optimised memory usage John Chapman
2008-11-08  3:22 ` John Chapman [this message]
2008-11-08  5:19   ` [PATCH 2/2] Cached the git configuration, which is now noticibly faster on windows David Symonds
2008-11-08  6:52     ` Arafangion
2008-11-10  8:38       ` Steve Frécinaux
2008-11-08 10:13     ` Jakub Narebski
2008-11-09 18:33   ` Junio C Hamano
2008-11-10  3:50     ` Han-Wen Nienhuys
2008-11-10  9:46     ` Simon Hausmann
2008-11-12  0:50       ` Junio C Hamano
2008-11-12 11:54         ` Arafangion

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1226114569-8506-2-git-send-email-thestar@fussycoder.id.au \
    --to=thestar@fussycoder.id.au \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).