git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] git-svn: Cache results of running the executable "git config"

From
Alejandro R. Sedeño <asedeno@mit.edu>
Date
Apr 1, 2011, 18:42 UTC
Message-ID
<1301683336-10832-3-git-send-email-asedeno@mit.edu>
In-Reply-To
<1301683336-10832-1-git-send-email-asedeno@mit.edu>
From: James Y Knight <jknight@itasoftware.com>
Running programs is not cheap!
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
---
 git-svn.perl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index aa41896..e47e04c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -59,6 +59,7 @@ use File::Find;
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
 use IPC::Open3;
 use Git;
+use Memoize;  # core since 5.8.0, Jul 2002
 
 BEGIN {
 	# import functions from Git into our packages, en masse
@@ -72,6 +73,8 @@ BEGIN {
 			*{"${package}::$_"} = \&{"Git::$_"};
 		}
 	}
+	Memoize::memoize 'Git::config';
+	Memoize::memoize 'Git::config_bool';
 }
 
 my ($SVN);
@@ -3199,6 +3202,8 @@ sub has_no_changes {
 		Memoize::unmemoize 'check_cherry_pick';
 		Memoize::unmemoize 'has_no_changes';
 	}
+
+	Memoize::memoize 'Git::SVN::repos_root';
 }
 
 END {
-- 
1.7.4.2.1.gd6f1f
Previous: Alejandro R. Sedeño
Message 3 of 3 in “a couple of git-svn patches”
  1. Alejandro R. SedeñoApr 1, 2011
  2. 1/2 git-svn: Fix the commit-url config to be the base url, just like the url configAlejandro R. Sedeño, Apr 1, 2011
  3. 2/2 git-svn: Cache results of running the executable "git config"Alejandro R. Sedeño, Apr 1, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.