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

[PATCH] faq.html - Spaces in path to EDITOR troubles

From: Michael Sinz <Michael.Sinz_at_sinz.org>
Date: 2005-11-12 03:43:57 CET

As suggested by Fogel, I have added some wording about the SVN_EDITOR setting
and how to support spaces in the editor path by correctly quoting the setting.

(I know, this is a repost of the patch from another thread, but I did not label
that posting as containing a patch)

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

Added an entry about how to deal with spaces in the editor path
in the SVN_EDITOR setting.

This includes a note about the ability to include initial editor
arguments in the SVN_EDITOR setting.

Examples for both Windows and Unix sh/bash environments are included.
I presume that other Unix environment users can easily translate
to their specific syntax for setting environment variables.

* www/faq.html

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 @@
+<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:
+ set SVN_EDITOR="C:\Program Files\Posix Tools\bin\vi"
+<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>
+<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:
+ SVN_EDITOR='"/usr/local/more editors/bin/xemacs"'
+ export SVN_EDITOR
+<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>For Windows:</p>
+ set SVN_EDITOR="C:\Program Files\Posix Tools\bin\vi" -nx -r
+<p>For UNIX/bash:</p>
+ SVN_EDITOR='"/usr/local/more editors/bin/xemacs" -nx -r'
+ export SVN_EDITOR
+<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.
 <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 Sat Nov 12 03:45:11 2005

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