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

Re: svn commit: r1875312 - /subversion/site/publish/docs/release-notes/1.14.html

From: Nathan Hartman <hartman.nathan_at_gmail.com>
Date: Wed, 18 Mar 2020 19:59:38 -0400

On Wed, Mar 18, 2020 at 2:42 PM Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> Nathan Hartman wrote on Wed, 18 Mar 2020 13:42 -0400:
> > On Tue, Mar 17, 2020 at 3:50 PM Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> > > Suggest to say "When invoking the user-defined editor", with or without
> > > listing some of the ways in which the editor command may be specified.
> > > Add an example? (An example is worth a thousand words…)
> >
> > Thanks for your suggestions.
> >
> > How about something along these lines:
>
> Thanks, much better :-)
>
> To clarify, what I thought specifically was to give examples of
> problematic filename and of an editor command that uses shell. For
> example, a screenshot:
>
> [[[
> % svn up
> Updating '.':
> C foo bar.txt
> Updated to revision 2.
> Summary of conflicts:
> Text conflicts: 1
> Merge conflict discovered in file 'foo bar.txt'.
> Select: (p) Postpone, (df) Show diff, (e) Edit file, (m) Merge,
> (s) Show all options: <b>e</b>
> ]]]
>
> As to an editor command, I guess something as simple as
> «--editor-cmd='vim -N'» would suffice to get the point across.

Yes, I think that's a good idea. May I use your "screenshot" as-is?

Something like this:

[[[

<div class="h4" id="editor-filename-escaping">
<h4>Escaping/quoting of pathname arguments to the user-defined editor
  <a class="sectionlink" href="#log-search"
     title="Link to this section">&para;</a>
</h4>

<p>When invoking the user-defined editor, such as during interactive conflict
resolution, Subversion now performs escaping of any special characters in the
pathname of the file to be edited. This corrects a problem that would occur
previously when the file to be edited (and/or the path leading to it)
contained spaces or other special characters. (See
<a href="http://svn.apache.org/r1874057">r1874057</a>,
<a href="http://svn.apache.org/r1874093">r1874093</a>, and
<a href="http://svn.apache.org/r1875230">r1875230</a>.)</p>

<p>Note that escaping is performed only on the pathname argument. As before,
the editor itself is invoked through the shell and the user must properly
quote/escape the command line used to launch it. This is intentional, as it
allows the user to construct a shell command which itself contains command
line arguments. See the related
<a href="https://subversion.apache.org/faq.html#svn-editor">FAQ entry</a> for
more on spaces and/or command line options in the editor path.</p>

<p>The user-defined editor can be specified in the following ways, in this
order of precedence:</p>

<ul>
  <li>The <tt>--editor-cmd</tt> command-line option</li>
  <li>The <tt>$SVN_EDITOR</tt> environment variable</li>
  <li>The <tt>editor-cmd</tt> runtime configuration option</li>
  <li>The <tt>$VISUAL</tt> environment variable</li>
  <li>The <tt>$EDITOR</tt> environment variable</li>
</ul>

<p>The escaped pathname of the file to be edited is passed to the editor as
its last command line argument.</p>

<p>For example, suppose that <tt>$SVN_EDITOR</tt> is set as follows:</p>

<pre>SVN_EDITOR='vim -N'
    export SVN_EDITOR
</pre>

<p>Furthermore, suppose 'svn up' finds a text conflict in a file called
<tt>foo bar.txt</tt>:</p>

<pre>
$ svn up
Updating '.':
C foo bar.txt
Updated to revision 2.
Summary of conflicts:
  Text conflicts: 1
Merge conflict discovered in file 'foo bar.txt'.
Select: (p) Postpone, (df) Show diff, (e) Edit file, (m) Merge,
        (s) Show all options: <b>e</b>
</pre>

<p>When Subversion launches the editor, the space in <tt>vim -N</tt> will
<strong>not</strong> be escaped, allowing vim to be invoked with <tt>-N</tt>
as its first argument, but the space in <tt>foo bar.txt</tt>
<strong>will</strong> be escaped.</p>

</div> <!-- editor-filename-escaping -->

]]]

Cheers,
Nathan
Received on 2020-03-19 00:59:59 CET

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.