开发者

Why cant I use the $SVN_EDITOR environment variable in cygwin?

I must be missing something stupid! It works fine when I use the -m option.

$ echo $SVN_EDITOR
emacs

$ svn commit test.py
svn: Commit failed (details to follow):
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR envirionment variable or us开发者_StackOverflow社区ing the --message (-m) or --file (-F) options 
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found


Though this is a cygwin question, I would like to state that on windows command line when using svn command line (collabnet), you could use the following

set SVN_EDITOR=notepad.exe

I am stating this hear since it might help windows users and did not find anything else related to this on other SO questions.


I have never seen a platform where SVN_EDITOR actually works -- it doesn't work on Mac OS X either. Use EDITOR, it should work fine.


Maybe you can try adding this line to your ~/.bashrc file:

export SVN_EDITOR=emacs


Adding to @user_v's answer:

To have the setting stick around, add SVN_EDITOR to the windows environmental variables.

To use a program under a path with spaces (like C:\Program Files) put the value in quotes.


you need to logout and login if you add it to bashrc.

If you want to do it one time, and then add it, you can just do this on the command line (in bash)

SVN_EDITOR=emacs;export SVN_EDITOR


Quick, but less powerful: Use the -m option to give the Commit Message directly as command line argument. E. g: svn commit -m "Corrected cppcheck errors."


A nice trick with windows that solves this problem and lets you output the debug message to the console: write the command "set SVN_EDITOR=TYPE" in your CMD, I suggest the same works for Linux by setting SVN_EDITOR variable to "cat".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜