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

Re: Bug report -- space in env. var. VISUAL causes commits to fail (needs confirmation)

From: David Dyer-Bennet <dd-b_at_dd-b.net>
Date: Tue, 7 Dec 2010 08:44:28 -0600

On Tue, December 7, 2010 04:18, Julian Foad wrote:
> On Tue, 2010-12-07, Daniel Shahaf wrote:

> I confirmed that there was a bug in that report, but that was on Windows
> and the evidence there was that the arguments were not being parsed
> correctly even when the space was escaped with the "^" character.
> That's a different problem from yours.

I'm also not sure what this concept of escaping with "^" is; if this is a
windows thing I've managed to avoid learning about it (and I still use
Windows systems, even today).

>> Today we use system(), and thus things like EDITOR='gvim -f' and
>> EDITOR='emacs -nw' work. If propedit-cmd.c just quoted all spaces in
>> the editor command, it would break this use case.

Agreed, that would be too drastic a solution, and would break important
things.

>> I suppose setting VISUAL="\"/path with spaces/to/editor/binary\"" is the
>> easiest solution --- it requires no code changes so it will work with
>> any svn binary out there.
>
> Yes, I think that's the best solution.

That's an interesting idea.

Unfortunately, it doesn't seem to work. (Example from Centos 5.5 again):

sh-3.2$ export VISUAL='"/home/path with spaces/bin/emacs"'
sh-3.2$ echo $VISUAL
"/home/path with spaces/bin/emacs"
sh-3.2$ ls -l "/home/path with spaces/bin"
total 8
-rwxr-xr-x 1 root root 192 Dec 7 08:40 emacs
sh-3.2$ svn commit
basename: extra operand `spaces/bin/emacs'
Try `basename --help' for more information.
Can't find
svn: Commit failed (details follow):
svn: system('"/home/path with spaces/bin/emacs" svn-commit.tmp') returned 256

And, in any case, VISUAL is a public interface, and I wonder how many
other applications would break if I put that kind of thing into
VISUAL.

-- 
David Dyer-Bennet, dd-b@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info
Received on 2010-12-07 15:51:37 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.