Re: [PATCH] git-svn: respect Subversion's [auth] section configuration values
- From
Sam Vilain <sam@vilain.net>
- Date
- Oct 7, 2007, 01:24 UTC
- Message-ID
- <4708355B.4090403@vilain.net>
- In-Reply-To
- <20071006185719.GA3943@void.codelabs.ru>
Eygene Ryabinkin wrote:
Show 5 quoted lines
> Parameters 'store-passwords' and 'store-auth-creds' from Subversion's > configuration (~/.subversion/config) were not respected. This was > fixed: the default values for these parameters are set to 'yes' to > follow Subversion behaviour. >
I saw this in the svn api before. It really is a strange API, requiring the user to get things like this right.
Show 22 quoted lines
> Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
> ---
> git-svn.perl | 23 +++++++++++++++++++++++
> 1 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 484b057..f7ef421 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -3051,6 +3051,29 @@ sub new {
> ]);
> my $config = SVN::Core::config_get_config($config_dir);
> $RA = undef;
> + my $dont_store_passwords = 1;
> + my $conf_t = ${$config}{'config'};
> + {
> + # The usage of $SVN::_Core::SVN_CONFIG_* variables
> + # produces warnings that variables are used only once.
> + # I had not found the better way to shut them up, so
> + # warnings are disabled in this block.
> + no warnings;
> You can use no warnings 'once';
Show 19 quoted lines
> + if (SVN::_Core::svn_config_get_bool($conf_t,
> + $SVN::_Core::SVN_CONFIG_SECTION_AUTH,
> + $SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS,
> + 1) == 0) {
> + SVN::_Core::svn_auth_set_parameter($baton,
> + $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
> + bless (\$dont_store_passwords, "_p_void"));
> + }
> + if (SVN::_Core::svn_config_get_bool($conf_t,
> + $SVN::_Core::SVN_CONFIG_SECTION_AUTH,
> + $SVN::_Core::SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
> + 1) == 0) {
> + $Git::SVN::Prompt::_no_auth_cache = 1;
> + }
> + }
> my $self = SVN::Ra->new(url => $url, auth => $baton,
> config => $config,
> pool => SVN::Pool->new,
>