svnmucc

40 views
Skip to first unread message

Vladislav Javadov

unread,
Nov 16, 2013, 2:10:17 AM11/16/13
to us...@subversion.apache.org
Hi,

My svnmucc 1.8.4 can't work with commands from a file, like these (saved
as 'normalize.mucc'):

rm programs/develop/fasm/tags
rm programs/games/mine/tags
rm programs/games/snake/tags

I try execute them via svnmucc:

svnmucc -U file:///X:/SVN/Kolibri.com -X normalize.mucc -m "Normalization"

It causes me an error:

svnmucc: E200004: 'rm programs/develop/fasm/tags' is not an action

I looked into the sources and found this error like svnmucc treats the
entire string 'rm programs/develop/fasm/tags' as single command. Is it
real? Is it common issue, not just for Windows?



--
WBR,
Vladislav Javadov

Geoff Rowell

unread,
Nov 16, 2013, 4:29:13 AM11/16/13
to Vladislav Javadov, us...@subversion.apache.org

> On Nov 16, 2013, at 2:10 AM, Vladislav Javadov <vapa...@yandex.ru> wrote:
>
> rm programs/develop/fasm/tags
> rm programs/games/mine/tags
> rm programs/games/snake/tags

Each command argument must be on a separate line:

rm
programs/develop/fasm/tags
rm
programs/games/mine/tags
rm
programs/games/snake/tags

- Geoff

Andreas Mohr

unread,
Nov 16, 2013, 6:06:42 AM11/16/13
to Geoff Rowell, Vladislav Javadov, us...@subversion.apache.org
So, does that mean that svnmucc has single-arg support only?
Cause given this example, on the syntax side there's nothing
that would indicate that a new command is following,
rather than further options to the existing command...
(unless "rm" is one of the commands
which are specially recognized as a known-supported command)

Sorry for my critique (and thank you for your help!) - just sayin'...

Andreas Mohr

Geoff Rowell

unread,
Nov 16, 2013, 8:03:19 AM11/16/13
to Andreas Mohr, Vladislav Javadov, us...@subversion.apache.org
svnmucc commands have a fixed number of arguments. Use "svnmucc --help" to see the valid commands.

- Geoff

Blair Zajac

unread,
Nov 16, 2013, 11:38:28 AM11/16/13
to Andreas Mohr, Geoff Rowell, Vladislav Javadov, us...@subversion.apache.org
Not having looked at the source code, it probably just reads from the
file until it reaches the end.

The reason to support this syntax with command and arg on separate lines
is to support files with whitespaces in the names, which wouldn't be
possible wit the syntax of command and arg on a single line.

Blair

Ben Reser

unread,
Nov 16, 2013, 12:43:05 PM11/16/13
to Blair Zajac, Andreas Mohr, Geoff Rowell, Vladislav Javadov, us...@subversion.apache.org
On 11/16/13 8:38 AM, Blair Zajac wrote:
> The reason to support this syntax with command and arg on separate lines is to
> support files with whitespaces in the names, which wouldn't be possible wit the
> syntax of command and arg on a single line.

Yet another thing to add to the list of code that assumes that filenames don't
have newlines in them.

Vladislav Javadov

unread,
Nov 17, 2013, 4:19:36 AM11/17/13
to Blair Zajac, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org
BZ> The reason to support this syntax with command and arg on separate lines
BZ> is to support files with whitespaces in the names

But what about quotes? Most OSes and programs accept quoted file names
containing spaces. Single-line commands are more readable, IMHO.


--
WBR,
Vladislav Javadov

Nico Kadel-Garcia

unread,
Nov 18, 2013, 7:11:40 AM11/18/13
to Vladislav Javadov, Blair Zajac, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org
Brother, unweaving the quotes is its own problem. You see, most
filesystems allow single quotes and double quotes in the filenames
themselves. Hilarity will ensue.

Andrew Reedick

unread,
Nov 18, 2013, 10:24:05 AM11/18/13
to Nico Kadel-Garcia, Vladislav Javadov, Blair Zajac, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org


> -----Original Message-----
> From: Nico Kadel-Garcia [mailto:nka...@gmail.com]
> Sent: Monday, November 18, 2013 7:12 AM
> To: Vladislav Javadov
> Cc: Blair Zajac; Andreas Mohr; Geoff Rowell; us...@subversion.apache.org
> Subject: Re: svnmucc
>
> Brother, unweaving the quotes is its own problem. You see, most filesystems allow single quotes and double quotes in the filenames themselves. Hilarity will ensue.
>
> On Sun, Nov 17, 2013 at 4:19 AM, Vladislav Javadov <vapa...@yandex.ru> wrote:
> > BZ> The reason to support this syntax with command and arg on separate
> > BZ> lines is to support files with whitespaces in the names
> >
> > But what about quotes? Most OSes and programs accept quoted file names
> > containing spaces. Single-line commands are more readable, IMHO.
> >
> >
> > --
> > WBR,
> > Vladislav Javadov
> >

And this is why I switched from bash to xash (aka "xml bash"). All my commands are now entered in xml format. Finally, no more -print0 and nested/escaped quotes nonsense!

Example:
cp -p foo bar
Becomes
<command><arg>cp</arg><arg>-p</arg><arg>foo</arg><arg>bar</arg></command>

And multi-line commands and scripts go from:
# Contrived example
find . -type f -print0 | while read -d $'\0' i
do
sed 's/e/E/g' "$i"
done | tee foo.txt 2>&1
to:
<commands>
<command>
<arg>find</arg>
<arg>.</arg>
<arg>-type</arg>
<arg>f</arg>
</command>
<pipe/>
<command>
<arg>while</arg>
<arg>read</arg>
<arg>i</arg>
</command>
<command>
<arg>do</arg>
</command>
<command>
<arg>sed</arg>
<arg>'s/e/E/g'</arg>
<arg>$i</arg>
</command>
<command>
<arg>done</arg>
</command>
<pipe/>
<tee stdout_format="human_ascii">
<file>foo.txt</file>
</tee>
<redirects>
<redirect><file_no from="2" to="1"/></redirect>
</redirects>
</commands>

Simple and inherently accurate, natch?

Andreas Krey

unread,
Nov 18, 2013, 10:33:54 AM11/18/13
to Nico Kadel-Garcia, Vladislav Javadov, Blair Zajac, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org
On Mon, 18 Nov 2013 07:11:40 +0000, Nico Kadel-Garcia wrote:
> Brother, unweaving the quotes is its own problem. You see, most
> filesystems allow single quotes and double quotes in the filenames
> themselves. Hilarity will ensue.

Quoting is a solved problem, including quoting quotes.

Using newlines a command argument separator because there may be spaces
in files names is a regression from accepted CLI design, and doesn't
even solve the problem of newlines in file name which filesystems also
allow. Besides, hilarity also ensues there when a file happens to be named
'rm'.

Andreas

--
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

Blair Zajac

unread,
Nov 18, 2013, 10:47:38 AM11/18/13
to Andreas Krey, Nico Kadel-Garcia, Vladislav Javadov, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org

On Nov 18, 2013, at 7:33 AM, Andreas Krey <a.k...@gmx.de> wrote:

> On Mon, 18 Nov 2013 07:11:40 +0000, Nico Kadel-Garcia wrote:
>> Brother, unweaving the quotes is its own problem. You see, most
>> filesystems allow single quotes and double quotes in the filenames
>> themselves. Hilarity will ensue.
>
> Quoting is a solved problem, including quoting quotes.
>
> Using newlines a command argument separator because there may be spaces
> in files names is a regression from accepted CLI design, and doesn't
> even solve the problem of newlines in file name which filesystems also
> allow. Besides, hilarity also ensues there when a file happens to be named
> 'rm’.

svnmucc handles arbitrary long command line arguments with spaces if they are quoted. This is in regards to the -X command line option.

Blair

Nico Kadel-Garcia

unread,
Nov 18, 2013, 10:12:41 PM11/18/13
to Andreas Krey, Vladislav Javadov, Blair Zajac, Andreas Mohr, Geoff Rowell, us...@subversion.apache.org
> Quoting is a solved problem, including quoting quotes.

Bwa-ha-ha-ha!. Hee. Giggle, Snort. Oh, dear lord, that one deserved a
"coffee and cats" warning. The handling of syntactically significant
characters, such as quotes, slashes, single quotes, and spaces is a
very common cross-platform problem and multiple tool problem. There
are individual tools that do it well. Many, many casually written
access control, hook-scripts, and and build scripts do not. And with
so many interpreters having different syntax for quote handling, it
can actually be impossible for one script to hand off the right number
of levels of quoting to another tool several layers deeper.
Reply all
Reply to author
Forward
0 new messages