You are not logged in.

#1 2011-09-02 13:30:32

vendion
Member
From: Tennessee, USA
Registered: 2010-03-10
Posts: 204
Website

[SOLVED] urxvt and Git/SVN commit problem

I have a problem where SVN and Git cant see that the EDITOR variable is set on my system when I go to make a commit, they both error out because the EDITOR variable (as well as other variables are blank).  This is the error that I get from SVN:

┌─(vendion@Tyre Fri, 02 Sep 11)───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(08:48)──┘
└─(/srv/http/juice38)─> sudo svn ci
svn: Commit failed (details follow):
svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using 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
┌─(vendion@Tyre Fri, 02 Sep 11)───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(08:48)──┘
└─(/srv/http/juice38)─> echo $EDITOR
vim

Git acts the same way but with its own error message (sorry don't have an example of this currently), is there a way to fix this so that Git and SVN will see that I do have an EDITOR set and use it with out having to change terminals (works fine in xterm...)

Last edited by vendion (2011-09-02 16:08:48)

Offline

#2 2011-09-02 13:56:43

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: [SOLVED] urxvt and Git/SVN commit problem

This is due to sudo working with a new environment: see your sudoers file for the "env_keep" option.

Offline

#3 2011-09-02 13:59:54

vendion
Member
From: Tennessee, USA
Registered: 2010-03-10
Posts: 204
Website

Re: [SOLVED] urxvt and Git/SVN commit problem

Sorry over looked that, when I run sudo to check the EDITOR variable it also has vim set

┌─(vendion@Tyre Fri, 02 Sep 11)───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(09:42)──┘
└─(/home/vendion/Projects/TickIt)─> sudo echo $EDITOR
Password: 
vim

Offline

#4 2011-09-02 14:10:57

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: [SOLVED] urxvt and Git/SVN commit problem

The variable EDITOR is substituted before invoking sudo. Try something like the following:

sudo bash -c 'echo $EDITOR'

(Note the single quotes.)

Offline

#5 2011-09-02 14:25:44

vendion
Member
From: Tennessee, USA
Registered: 2010-03-10
Posts: 204
Website

Re: [SOLVED] urxvt and Git/SVN commit problem

Ah yea calling it that way shows EDITOR as being empty...

Offline

#6 2011-09-02 16:08:18

vendion
Member
From: Tennessee, USA
Registered: 2010-03-10
Posts: 204
Website

Re: [SOLVED] urxvt and Git/SVN commit problem

Ok so I added

Defaults env_keep += "EDITOR"

to my sudoers file and now EDITOR shows vim when ran via sudo

Offline

#7 2011-09-02 16:25:21

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: [SOLVED] urxvt and Git/SVN commit problem

Do you still experience the problems as described in your first post? Why do you even run git/svn via sudo, is that a sane setup?

Offline

Board footer

Powered by FluxBB