{"thread":{"id":"26962","subject":"[PATCH 2/2] git-svn: Cache results of running the executable \"git config\"","startedAt":"2011-04-01T18:42:14Z","lastAt":"2011-04-01T18:42:16Z","messageCount":3,"participants":["Alejandro R. Sedeño"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"164907","messageId":"1301683336-10832-1-git-send-email-asedeno@mit.edu","threadId":"26962","inReplyTo":null,"subject":"a couple of git-svn patches","fromName":"Alejandro R. Sedeño","fromEmail":"asedeno@mit.edu","sentAt":"2011-04-01T18:42:14Z","receivedAt":"2011-04-01T18:42:14Z","isPatch":false,"sender":{"key":"asedeno@mit.edu","avatar":"https://avatars.githubusercontent.com/u/28302?v=4"},"body":"Here are two independent git-svn patches that my co-worker handed off\nto me back in January.\n\nThe first changes the behavior of commit_url to be like that of url so\nthat you can commit to multiple branches.\n\nThe second uses Memoize to cache the results of shelling out to\ngit-config, which has good performance benefits for git-svn fetch.\n"},{"id":"164906","messageId":"1301683336-10832-2-git-send-email-asedeno@mit.edu","threadId":"26962","inReplyTo":"1301683336-10832-1-git-send-email-asedeno@mit.edu","subject":"[PATCH 1/2] git-svn: Fix the commit-url config to be the base url, just like the url config","fromName":"Alejandro R. Sedeño","fromEmail":"asedeno@mit.edu","sentAt":"2011-04-01T18:42:15Z","receivedAt":"2011-04-01T18:42:15Z","isPatch":true,"sender":{"key":"asedeno@mit.edu","avatar":"https://avatars.githubusercontent.com/u/28302?v=4"},"body":"From: James Knight <jknight@itasoftware.com>\n\nThis is necessary if you want to be able to commit to multiple branches.\n\nSigned-off-by: Alejandro R. Sedeño <asedeno@mit.edu>\n---\n git-svn.perl |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a5857c1..aa41896 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -523,12 +523,14 @@ sub cmd_dcommit {\n \t}\n \n \tif (defined $_commit_url) {\n-\t\t$url = $_commit_url;\n+\t\t$url = $_commit_url . (length $gs->{path} ? '/' . $gs->{path} : '');\n \t} else {\n \t\t$url = eval { command_oneline('config', '--get',\n \t\t\t      \"svn-remote.$gs->{repo_id}.commiturl\") };\n \t\tif (!$url) {\n \t\t\t$url = $gs->full_url\n+\t\t} else {\n+\t\t\t$url = $url . (length $gs->{path} ? '/' . $gs->{path} : '');\n \t\t}\n \t}\n \n-- \n1.7.4.2.1.gd6f1f\n"},{"id":"164905","messageId":"1301683336-10832-3-git-send-email-asedeno@mit.edu","threadId":"26962","inReplyTo":"1301683336-10832-1-git-send-email-asedeno@mit.edu","subject":"[PATCH 2/2] git-svn: Cache results of running the executable \"git config\"","fromName":"Alejandro R. Sedeño","fromEmail":"asedeno@mit.edu","sentAt":"2011-04-01T18:42:16Z","receivedAt":"2011-04-01T18:42:16Z","isPatch":true,"sender":{"key":"asedeno@mit.edu","avatar":"https://avatars.githubusercontent.com/u/28302?v=4"},"body":"From: James Y Knight <jknight@itasoftware.com>\n\nRunning programs is not cheap!\n\nSigned-off-by: Alejandro R. Sedeño <asedeno@mit.edu>\n---\n git-svn.perl |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex aa41896..e47e04c 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -59,6 +59,7 @@ use File::Find;\n use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;\n use IPC::Open3;\n use Git;\n+use Memoize;  # core since 5.8.0, Jul 2002\n \n BEGIN {\n \t# import functions from Git into our packages, en masse\n@@ -72,6 +73,8 @@ BEGIN {\n \t\t\t*{\"${package}::$_\"} = \\&{\"Git::$_\"};\n \t\t}\n \t}\n+\tMemoize::memoize 'Git::config';\n+\tMemoize::memoize 'Git::config_bool';\n }\n \n my ($SVN);\n@@ -3199,6 +3202,8 @@ sub has_no_changes {\n \t\tMemoize::unmemoize 'check_cherry_pick';\n \t\tMemoize::unmemoize 'has_no_changes';\n \t}\n+\n+\tMemoize::memoize 'Git::SVN::repos_root';\n }\n \n END {\n-- \n1.7.4.2.1.gd6f1f\n"}]}