[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: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-11-08 14:10:45 CET

> kfogel@tigris.org writes:
>
>>http://subversion.tigris.org/issues/show_bug.cgi?id=2434
>
>>------- Additional comments from kfogel@tigris.org Mon Nov 7 09:59:04 -0800 2005 -------
>>So, anyone know if there's a Cygwin (or APR) function for escaping a
>>path so that it can be invoked as an executable reliably on Cygwin?
>>Should we just put the executable path in single quotes or
>>something?

This is a cross-platform issue, not specific to CygWin.

The implementation uses "system()" which requires that the program name and
arguments are represented by a single string with spaces delimiting program
name and arguments. We should use svn_io_run_command which keeps the program
name and arguments separately intact.

Philip Martin wrote:
> There was a patch to do something like that in the past. The current
> code allows things like
>
> SVN_EDITOR="LD_LIBRARY_PATH=/some/lib /some/program"
>
> and the patch would have stopped that working.

It also allows initial arguments to be specified, like SVN_EDITOR="/bin/editor
--option=x".

I doubt it was intended to allow things like that; that looks like an
accidental artifact of the implementation. In the absence of any further
argument for keeping the current behaviour I recommend calling it a bug and
fixing it, i.e. treat the whole variable as the name of a program.

Further, I note that the documentation (in the book; is there any other?) is
inadequate. It doesn't specify what the variable can contain (abs path,
program to be searched for in $PATH, initial arguments, ...), and it specifies
the order of priority wrongly.

The attached "book-editor-cmd.patch" improves it.

- Julian

Fix and improve the description of the "editor-cmd" configuration option.

* en/book/ch07.xml
  (svn.advanced.confarea.opts.config): Improve description of "editor-cmd".
  
* en/book/ch09.xml
  (svn.ref.svn.sw): Add a cross-reference to the above.

Index: en/book/ch07.xml
===================================================================
--- en/book/ch07.xml (revision 1811)
+++ en/book/ch07.xml (working copy)
@@ -482,12 +482,28 @@ collabnet = svn.collab.net
                 user wishes to edit, and the edits take place right
                 in the editor program (see <xref
                 linkend="svn.advanced.props" />). This option's default
- value is empty. If the option is not set, Subversion
- will fall back to checking the environment variables
- <literal>SVN_EDITOR</literal>,
- <literal>VISUAL</literal>, and
- <literal>EDITOR</literal> (in that order) for an
- editor command.</para>
+ value is empty. The order of priority for selecting the
+ editor to use is:</para>
+ <orderedlist>
+ <listitem>
+ <para>Command-line option <literal>--editor-cmd</literal></para>
+ </listitem>
+ <listitem>
+ <para>Environment variable <literal>SVN_EDITOR</literal></para>
+ </listitem>
+ <listitem>
+ <para>Configuration option <literal>editor-cmd</literal></para>
+ </listitem>
+ <listitem>
+ <para>Environment variable <literal>VISUAL</literal></para>
+ </listitem>
+ <listitem>
+ <para>Environment variable <literal>EDITOR</literal></para>
+ </listitem>
+ <listitem>
+ <para>Optionally, a default specified at compile time</para>
+ </listitem>
+ </orderedlist>
             </listitem>
           </varlistentry>
           <varlistentry>
Index: en/book/ch09.xml
===================================================================
--- en/book/ch09.xml (revision 1811)
+++ en/book/ch09.xml (working copy)
@@ -108,7 +108,9 @@ $ svn status -v myfile
             <replaceable>CMD</replaceable></term>
           <listitem>
             <para>Specifies an external program to use to edit a log message
- or a property value.</para>
+ or a property value. See the <literal>editor-cmd</literal>
+ section in <xref linkend="svn.advanced.confarea.opts.config"/>
+ for ways to specify a default editor.</para>
           </listitem>
         </varlistentry>
       

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 8 14:12:47 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.