Skip to content

Instantly share code, notes, and snippets.

@mrigor
Created April 26, 2012 18:46
Show Gist options
  • Save mrigor/2501863 to your computer and use it in GitHub Desktop.
Save mrigor/2501863 to your computer and use it in GitHub Desktop.
git-svn patch to remember password in KeyChain on OS X (sudo vim /opt/local/libexec/git-core/git-svn)
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -5436,7 +5436,7 @@ BEGIN {
}
sub _auth_providers () {
- [
+ my @rv = (
SVN::Client::get_simple_provider(),
SVN::Client::get_ssl_server_trust_file_provider(),
SVN::Client::get_simple_prompt_provider(
@@ -5452,7 +5452,23 @@ sub _auth_providers () {
\&Git::SVN::Prompt::ssl_server_trust),
SVN::Client::get_username_prompt_provider(
\&Git::SVN::Prompt::username, 2)
- ]
+ );
+
+ # earlier 1.6.x versions would segfault, and <= 1.5.x didn't have
+ # this function
+ if ($SVN::Core::VERSION gt '1.6.12') {
+ my $config = SVN::Core::config_get_config($config_dir);
+ my ($p, @a);
+ # config_get_config returns all config files from
+ # ~/.subversion, auth_get_platform_specific_client_providers
+ # just wants the config "file".
+ @a = ($config->{'config'}, undef);
+ $p = SVN::Core::auth_get_platform_specific_client_providers(@a);
+ # Insert the return value from
+ # auth_get_platform_specific_providers
+ unshift @rv, @$p;
+ }
+ \@rv;
}
sub escape_uri_only {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment