geany-plugins
geany-plugins copied to clipboard
GeanyVC: support subversion authenticated commit
I just started to use Geany, coming from Bluefish... it's really a great tool and I wish to tank everyone contributing!
I only noticed a problem when I try commit to a Subversion repository which needs the user to be authenticated. No problem wen I commit to a repository which does not require authentication.
Here is the screenshot of a packet capture between client and SVN server which shows the issue:
I think to be unable to fix without help from someone. Thanks!
GeanyVC uses the real svn
commands under the hood, so it should be possible to get this to work.
I am not knowledgeable about SVN authenticated commits; what would you do to get this to work on the command line? GeanyVC uses svn commit --non-interactive -m "MESSAGE" FILE_LIST
I guess that in order to achieve this, the plugin should start managing interactive usage... or it would be solved by getting the error code which is returned if unauthorized (1) and try again by asking username/password to the user and issuing the command svn commit --user USERNAME --passwd PASSWORD --non-interactive -m "MESSAGE" FILE_LIST
svn
exits with error code "1" in that case, and outputs on stderr this string:
svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option svn: E215004: Commit failed (details follow): svn: E215004: No more credentials or we tried too many times.
Can't username and password be set somewhere in a SVN configuration file?
Not in the SVN working directory, but svn
can save user credentials under several files in the ~/.subversion/auth
directory tree. However I guess it might be tricky to parse them all and get the right credentials to use for the current working directory commit. Moreover, to save subversion passwords in that way is not very safe.
I think it should be simpler to ask for credentials each time we need them, or make the user store them in Geany preferences.
Can't you just remove the --non-interactive
to have svn prompt for credentials? By the nature of an IDE Geany is totally insecure, better to have handle svn usernames and passwords.
@elextr the command is not run in a TTY, there's no way for the user to interact -- or that would be on the terminal from which Geany was launched at best, if stdin was inherited.
ok, well, might as well just configure --username
and --passwd
on the commands, oh wait, its not configurable :(
@b4n I was thinking that GeanyVC does not seems to have the ambition to serve as a full replacement of a VC client, thus it will be OK to save credentials using svn
after all...
However, if it wouldn't be too difficult to parse svn
output, I'm sure a lot of people will appreciate the "ask for credentials if commit fails" behavior I proposed here above.
GeanyVC is just as lightweight as the Geany itself :)
So in editor context GeanyVC rather assumes that the underlying repositories have been properly set up, which includes logins credentials needed for clone, pull (if any). This way GeanyVC does not need to deal with managing the logins for all the VCS it supports, and just focuses on managing local file changes.
Some VCSs make it simpler to manages login details (like Git's remotes). Subversion has its own way of "remembering" passwords. SVN+SSH further helps make the authentication transparent by using proper keys automatically so you won't need to type either username or password details with SVN commands at all.
If it's still relevant, you may check out the SO thread https://stackoverflow.com/questions/2899209/how-to-save-password-when-using-subversion-from-the-console on the subject.