单个git-svn命令未为多个svn操作缓存密码 [英] Single git-svn command not caching password for multiple svn actions

查看:131
本文介绍了单个git-svn命令未为多个svn操作缓存密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用git-svn连接到通过https进行身份验证的Subversion存储库.我在Linux(Ubuntu 12.04)上使用git命令行客户端.当我执行任何需要与Subversion服务器进行交互的命令时,必须按预期输入我的svn密码.但是,如果命令需要与svn服务器进行多次交互(例如git svn dcommit和多个本地提交),则必须多次输入密码.

I'm using git-svn to connect to a subversion repository that authenticates via https. I'm using the git command line client on Linux (Ubuntu 12.04). When I perform any command that requires interaction with the subversion server, I must enter my svn password, as expected. However, if the command requires multiple interactions with the svn server (e.g. git svn dcommit with multiple local commits) I must enter the password multiple times.

在另一个工作站上,我有一个类似的设置,这使我可以期望在整个提交系列中都要求输入一次密码.

On another workstation, I have a similar setup which gives me the expect behavior of asking for the password once for the entire series of commits.

我在此处此处,但在两种情况下,OP都希望在git-svn命令之间缓存svn凭据.我没有将Subversion配置为缓存我的密码,并且如果可以的话,希望保持这种方式.

I've found similar questions here and here but in both cases the OP wanted the svn credentials cached between git-svn commands. I do not have subversion configured to cache my password and want to keep it that way if I can.

我的git-svn版本是1.7.9.5(svn 1.6.17)

My git-svn version is 1.7.9.5 (svn 1.6.17)

推荐答案

问题在于,git svn命令使用常规Subversion接口周围的包装器执行了多个Subversion操作. Git不知道或不在乎您的Subversion凭据.

The problem is that git svn commands perform multiple Subversion operations using a wrapper around the regular Subversion interfaces; Git doesn't know or care about your Subversion credentials.

我可以看到一些继续进行的选项,但都不是很好:

I can see a few different options for proceeding, none of which are great:

  • 启用Subversion的凭据存储.您知道这一点,并说过您不想这样做,所以这不是一个开始.

  • Enable Subversion's credential store. You know about this and have said you don't want to do it, so that's a non-starter.

只需为Git执行的每个Subversion操作输入密码.您当前的解决方案;如果那很好,那么您就不会问这个问题.

Just type the password in for every Subversion operation that Git performs. Your current solution; if that were good you wouldn't be asking the question.

修补程序git svn. Git代码是开源的,git svn命令是用Perl编写的,因此您可以在系统上进行编辑并使用新版本,而无需重新编译.粗糙的设计:

Patch git svn. Git code is open source, and the git svn commands are written in Perl, so you can edit on your system and use the new version without recompiling. Rough design:

  • 无论何时与Subversion存储库进行交互,都首先尝试在没有交互式身份验证的情况下执行它(即,基础svn命令的--non-interactive参数).

如果可行,那就继续吧.如果失败,则假定由于缺少身份验证而失败,然后提示用户输入用户名和密码.

If that works, great, carry on. If that fails, assume it fails due to lacking authentication, and prompt the user for a username and password.

对于以后的svn命令,如果不需要身份验证,则继续进行.否则,请显式指定存储的用户名和密码(即基础svn命令的--username--password参数).

For later svn commands, if no authentication was needed, carry on like that. Otherwise, specify the stored username and password explicitly (ie --username and --password arguments to the underlying svn command).

但是,独奏绝非易事.除非您特别喜欢在Git源代码中进行一些艰苦的工作,或者除非您希望这足以支付某人为您做的工作,否则这似乎是您需要忍受的行为.

Going solo is far from trivial, though. Unless you particularly fancy some hard work digging around in the Git source code, or want this enough to pay someone to do that for you, it looks like this is behaviour you'll need to live with.

这篇关于单个git-svn命令未为多个svn操作缓存密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆