[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Issue 2434] Spaces in path to EDITOR cause trouble

From: Michael Sinz <Michael.Sinz_at_sinz.org>
Date: 2005-11-11 03:22:04 CET

kfogel@collab.net wrote:
> Julian Foad <julianfoad@btopenworld.com> writes:
>
>>Excellent. That may be the best solution for invoking an editor:
>>leave the code alone and document the feature. Does anybody see a
>>problem with that?
>
>
> No, +1, I think it's by far the best solution! Thanks, Michael, for
> pointing it out.

Attached is a rough patch to the faq.html about this issue. I am not
sure about the specific wording or the level of the intended audience.
But it does show the way to do this in both Windows and Unix/bash.
(I figure most Unix users can handle the translation to other shell
constructs.)

-- 
Michael Sinz                     Technology and Engineering Director/Consultant
"Starting Startups"                                mailto:michael.sinz@sinz.org
My place on the web                            http://www.sinz.org/Michael.Sinz

Index: faq.html
===================================================================
--- faq.html (revision 17296)
+++ faq.html (working copy)
@@ -118,6 +118,7 @@
 <li><a href="#auto-props">How can I set certain properties on
 everything in the repository? Also, how can I make sure that every
 new file coming into the repository has these properties?</a></li>
+<li>How do I handle spaces in the editor path?</li>
 <li><a href="#divining-bdb-version">How do I determine which version of
 Berkeley DB a repository is using?</a></li>
 <li><a href="#website-auto-update">I'm managing a website in my
@@ -1762,6 +1763,70 @@
 
 <![CDATA[=========================================================]]>
 
+<div class="h3" id="svn-editor" title="auto-props">
+<h3>How do I deal with spaces in the editor path?&nbsp; Also, how can
+I define command line options for the editor?</h3>
+
+<p>The Subversion command line client will invoke the editor defined
+in the environment variable SVN_EDITOR.&nbsp; This environment variable
+is passed directly to the operating system along with the name of a
+temporary file used to enter/edit the log message.</p>
+
+<p>Due to the fact that the SVN_EDITOR string is used as is to the
+system's command shell, spaces in the editor name or path name to
+the editor will not work unless the editor name is in quotes.<p>
+
+<p>For example, on Windows if your editor is in
+<code>C:\Program&nbsp;Files\Posix&nbsp;Tools\bin\vi</code> you would
+want to set the variable as follows:
+</p>
+<pre>
+ set SVN_EDITOR="C:\Program Files\Posix Tools\bin\vi"
+</pre>
+
+<p>Note that there is no need to escape the quotes in the Windows
+shell as they are not part of the syntax for the <code>set</code>
+command.
+</p>
+
+<p>On UNIX systems you would need to follow your shell's specific
+methods for setting the variable.&nbsp; For example, in a bash shell,
+the following should work:
+</p>
+
+<pre>
+ SVN_EDITOR='"/usr/local/more editors/bin/xemacs"'
+ export SVN_EDITOR
+</pre>
+
+<p>In case a command line option would be needed for the invocation
+of the editor, just add that after the editor name in the SVN_EDITOR
+environment variable just like you would us on the command line.&nbsp;
+For example, if the options <code>-nx -r</code> would be wanted for
+the above editors, the following will provide those options:
+</p>
+
+<p>For Windows:</p>
+<pre>
+ set SVN_EDITOR="C:\Program Files\Posix Tools\bin\vi" -nx -r
+</pre>
+
+<p>For UNIX/bash:</p>
+<pre>
+ SVN_EDITOR='"/usr/local/more editors/bin/xemacs" -nx -r'
+ export SVN_EDITOR
+</pre>
+
+<p>Note that SVN_EDITOR is the Subversion specific environment variable
+setting for the editor selection.&nbsp; Subversion also supports
+using the more generic EDITOR variable but if you need special behaviors
+with Subversion it is best to use the SVN_EDITOR variable.
+</p>
+
+</div>
+
+<![CDATA[=========================================================]]>
+
 <div class="h3" id="divining-bdb-version" title="divining-bdb-version">
 <h3>How do I determine which version of
 Berkeley DB a repository is using?</h3>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 11 03:23:57 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.