You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2014/03/19 11:43:54 UTC

Re: r1577170 - remove wildcard handling from some .exe's on Windows

> URL: http://svn.apache.org/r1577170

> Log:
> Following up on r1577164, remove the special '*' argument handling from all
> Subversion .exe's except the few that really need this.
> 
> After this patch
> $ svnmucc.exe propset svn:special "*" URL -m "set svn:special"
> 
> will work on Windows, while this would try to evaluate '*' before.

I understand it's nice to not expand the '*' in this particular case, and maybe in all svnmucc commands. However, I am concerned about the inconsistency this introduces between the various svn command-line programs. It looks like

  svnmucc propset svn:special "*" URL

will set the prop val to '*', but

  svn propset svn:special "*" WC-path

will expand the '*'.

Is this really what we want to give the Windows users?

- Julian

[I mentioned it to Bert on IRC: <http://colabti.org/irclogger/irclogger_log/svn-dev?date=2014-03-13#l198>.]


> * build.conf
>   (svn,
>    svnadmin): Add setargv.obj to msvc-libs.
> 
> * build/generator/gen_win.py
>   (get_win_libs): Remove magic dependency of all .exe's.

> Modified: subversion/trunk/build.conf
> ==============================================================================
> @@ -146,6 +146,7 @@
> +msvc-libs = setargv.obj
> 
> @@ -155,6 +156,7 @@
> +msvc-libs = setargv.obj
> 
> Modified: subversion/trunk/build/generator/gen_win.py
> ==============================================================================
> @@ -867,9 +867,6 @@ class WinGeneratorBase(gen_win_dependenc
> 
>      nondeplibs = target.msvc_libs[:]
> 
> -    if isinstance(target, gen_base.TargetExe):
> -      nondeplibs.append('setargv.obj')
> -

RE: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: C. Michael Pilato [mailto:cmpilato@collab.net]
> Sent: woensdag 19 maart 2014 16:27
> To: Bert Huijben; 'Branko Čibej'; dev@subversion.apache.org
> Subject: Re: r1577170 - remove wildcard handling from some .exe's on
> Windows
> 
> On 03/19/2014 11:12 AM, Bert Huijben wrote:
> > Just to name a few: to set our binary properties, which we documented to
> just allow '*'
> >
> > svn:needs-lock
> > svn:executable
> 
> This is a kinda soft one, since we automatically normalize the values of
> these properties:
> 
> $ svn pset svn:executable '' iota
> property 'svn:executable' set on 'iota'
> svn: warning: W125005: To turn off the svn:executable property, use 'svn
> propdel';
> setting the property to '' will not turn it off.
> $ svn plist -vR
> Properties on 'iota':
>   svn:executable
>     *

Too bad that we do this normalizing in libsvn_wc, so it doesn't work for svnmucc in 1.7 and 1.8 where svnmucc is not linked against libsvn_client nor libsvn_wc, while it is linked to setargv.obj...

This case should be fixed on trunk though, where we do normalize the properties by using the wc property validation api from the mtcc api.

I think we even use(d?) svnmucc to explicitly introduce invalid property values in the repository for our python test suite.

	Bert


RE: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: C. Michael Pilato [mailto:cmpilato@collab.net]
> Sent: woensdag 19 maart 2014 16:27
> To: Bert Huijben; 'Branko Čibej'; dev@subversion.apache.org
> Subject: Re: r1577170 - remove wildcard handling from some .exe's on
> Windows
> 
> On 03/19/2014 11:12 AM, Bert Huijben wrote:
> > Just to name a few: to set our binary properties, which we documented to
> just allow '*'
> >
> > svn:needs-lock
> > svn:executable
> 
> This is a kinda soft one, since we automatically normalize the values of
> these properties:
> 
> $ svn pset svn:executable '' iota
> property 'svn:executable' set on 'iota'
> svn: warning: W125005: To turn off the svn:executable property, use 'svn
> propdel';
> setting the property to '' will not turn it off.
> $ svn plist -vR
> Properties on 'iota':
>   svn:executable
>     *
> $
> 
> > Or
> > svn ci -m "* STATUS: something"
> > this example doesn't match anything as ':' is invalid, but this invocation does
> trigger the glob handling.
> 
> This is a *better* case, but preeeeeeetty edge-casey still as arguments go.

Yesterday I found a much better example, and this time even on one of the applications that are really affected by the change...
(svnadmin and svn aren't... see the patch)

See:
$ svndumpfilter --help include
include: Filter out nodes without given prefixes from dumpstream.
usage: svndumpfilter include PATH_PREFIX...

Valid options:
  --drop-empty-revs        : Remove revisions emptied by filtering.
  --drop-all-empty-revs    : Remove all empty revisions found in dumpstream
                             except revision 0.
  --renumber-revs          : Renumber revisions left after filtering.
  --skip-missing-merge-sources : Skip missing merge sources.
  --targets ARG            : Read additional prefixes, one per line, from
                             file ARG.
  --preserve-revprops      : Don't filter revision properties.
  --quiet                  : Do not display filtering statistics.
  --pattern                : Treat the path prefixes as file glob patterns.


This tells us that
$ svndumpfilter include --pattern "*.txt" < file.dump > newfile.dump

Would evaluate the * as part of the argument parsing, not as part of the filtering.

And as the * is evaluated in svndumpfilter (and not the shell as on *nix), there is no way to escape the *...

	Bert


Re: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 03/19/2014 11:12 AM, Bert Huijben wrote:
> Just to name a few: to set our binary properties, which we documented to just allow '*'
> 
> svn:needs-lock 
> svn:executable

This is a kinda soft one, since we automatically normalize the values of
these properties:

$ svn pset svn:executable '' iota
property 'svn:executable' set on 'iota'
svn: warning: W125005: To turn off the svn:executable property, use 'svn
propdel';
setting the property to '' will not turn it off.
$ svn plist -vR
Properties on 'iota':
  svn:executable
    *
$

> Or
> svn ci -m "* STATUS: something"
> this example doesn't match anything as ':' is invalid, but this invocation does trigger the glob handling.

This is a *better* case, but preeeeeeetty edge-casey still as arguments go.

-- Mike (who began his Subversion career as a Windows development)

RE: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Branko Čibej [mailto:brane@wandisco.com]
> Sent: woensdag 19 maart 2014 15:50
> To: Bert Huijben; 'C. Michael Pilato'; dev@subversion.apache.org
> Subject: Re: r1577170 - remove wildcard handling from some .exe's on
> Windows
> 
> On 19.03.2014 14:59, Bert Huijben wrote:
> >
> > The problem is that you can’t quote…
> >
> >
> >
> > So while from python you can pass ‘*’ as an argument on unix, you
> > can’t do this on Windows…
> >
> 
> And when, pray tell, do you ever have to pass a literal asterisk as an
> argument to Subversion? Give me one example.

Just to name a few: to set our binary properties, which we documented to just allow '*'

svn:needs-lock 
svn:executable

Or
svn ci -m "* STATUS: something"
this example doesn't match anything as ':' is invalid, but this invocation does trigger the glob handling.

	Bert


Re: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Branko Čibej <br...@wandisco.com>.
On 19.03.2014 14:59, Bert Huijben wrote:
>
> The problem is that you can’t quote…
>
>  
>
> So while from python you can pass ‘*’ as an argument on unix, you
> can’t do this on Windows…
>

And when, pray tell, do you ever have to pass a literal asterisk as an
argument to Subversion? Give me one example.

>  For a tool like ‘svnmucc’ which doesn’t have any ‘*’ handling of its
> own this makes the tool work less like on *nix, not work more like on
> Unix.
>

I'm confused ... which "'*' handling" are you referring to?

> I’m quite surprised that the responses in this thread are all from the
> common unix developers on this list; not the Windows developers
>

Go check the repo history to see who started the Windows port before you
decide who is and who is not a Windows developer.

> while Cygwin (which is how many unix devs work on Windows) explicitly
> doesn’t apply this behavior to the ‘svn’ they provide.
>


Of course it doesn't, cygwin is supposed to be a Unix-like environment
for Windows, and they expect people to use bash -- which does the
argument expansion -- not cmd.exe. You're argument is doubly strange
since we've always told people not to mix and match cygwin and Windows,
and have always recommended they use the native command-line binaries
with cmd.exe. The behaviour you quote is one reason for that; native
end-of-line format is another.


-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

RE: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Bert Huijben <be...@qqmail.nl>.
The problem is that you can’t quote…

 

So while from python you can pass ‘*’ as an argument on unix, you can’t do this on Windows…

 

For a tool like ‘svnmucc’ which doesn’t have any ‘*’ handling of its own this makes the tool work less like on *nix, not work more like on Unix.

 

 

I’m quite surprised that the responses in this thread are all from the common unix developers on this list; not the Windows developers, while Cygwin (which is how many unix devs work on Windows) explicitly doesn’t apply this behavior to the ‘svn’ they provide.

 

                Bert

 

From: C. Michael Pilato [mailto:cmpilato@collab.net] 
Sent: woensdag 19 maart 2014 14:38
To: Branko Čibej; dev@subversion.apache.org
Subject: Re: r1577170 - remove wildcard handling from some .exe's on Windows

 

On 03/19/2014 09:00 AM, Branko Čibej wrote:

I disagree. It's more important that the tools behave similarly across different platforms. Making some tools behave differently for others to save people some argument quoting woes is just silly.


+1.  Uniformity across platforms was a major design goal from the project's beginning.




-- 
C. Michael Pilato  <ma...@collab.net> <cm...@collab.net>
CollabNet   <>   www.collab.net <http://www.collab.net>    <>   Enterprise Cloud Development

Re: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 03/19/2014 09:00 AM, Branko Čibej wrote:
> I disagree. It's more important that the tools behave similarly across
> different platforms. Making some tools behave differently for others
> to save people some argument quoting woes is just silly.

+1.  Uniformity across platforms was a major design goal from the
project's beginning.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development


Re: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Branko Čibej <br...@wandisco.com>.
On 19.03.2014 12:29, Bert Huijben wrote:
> Normal Windows applications don't expand '*' directly when passed on the
> commandline (and neither does the Windows default shell). So before this
> patch *all* our applications were special in their handling of '*' and '?',
> while after this patch only the two applications that really use the
> wildcard expansion are special while the other applications work like all
> the other applications from all other sources. 
>
> It is not that we as Subversion project can set a standard with millions of
> other applications out there. I don't think Windows users think about the
> argument parsing as being different for svn applications and other
> applications.

I don't really care about what you call "normal" Windows applications;
there aren't any such beasts.

> The best fix for Windows users would be to remove the special handling from
> 'svn' and 'svnadmin' too, and handle the wildcard expansion in the argument
> parsing logic *after* we separate them from arguments that don't point to
> local paths... This is how well behaved Windows applications do things.

No. We explicitly and intentionally included setargv.obj in the Windows
link for command-line tools in order to make them behave approximately
the same way as on Unix.

> But this would involve adding a lot of Windows support to apis and/or the
> svn client that aren't used for this kind of things on other platforms.

Exactly. Not our problem.

> With reducing the scope of the 'special argument parsing' to the tools that
> really need this, all other applications are much easier to use by scripts,
> where they had to apply hacks to provide arguments that may contain a '?' or
> '*', because there is no way to escape the arguments at this level.

I disagree. It's more important that the tools behave similarly across
different platforms. Making some tools behave differently for others to
save people some argument quoting woes is just silly.

-- Brane


-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane@wandisco.com

RE: r1577170 - remove wildcard handling from some .exe's on Windows

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Julian Foad [mailto:julianfoad@btopenworld.com]
> Sent: woensdag 19 maart 2014 11:44
> To: Bert Huijben
> Cc: dev@subversion.apache.org
> Subject: Re: r1577170 - remove wildcard handling from some .exe's on
> Windows
> 
> > URL: http://svn.apache.org/r1577170
> 
> > Log:
> > Following up on r1577164, remove the special '*' argument handling from
> all
> > Subversion .exe's except the few that really need this.
> >
> > After this patch
> > $ svnmucc.exe propset svn:special "*" URL -m "set svn:special"
> >
> > will work on Windows, while this would try to evaluate '*' before.
> 
> I understand it's nice to not expand the '*' in this particular case, and
maybe
> in all svnmucc commands. However, I am concerned about the inconsistency
> this introduces between the various svn command-line programs. It looks
> like
> 
>   svnmucc propset svn:special "*" URL
> 
> will set the prop val to '*', but
> 
>   svn propset svn:special "*" WC-path
> 
> will expand the '*'.
> 
> Is this really what we want to give the Windows users?

Normal Windows applications don't expand '*' directly when passed on the
commandline (and neither does the Windows default shell). So before this
patch *all* our applications were special in their handling of '*' and '?',
while after this patch only the two applications that really use the
wildcard expansion are special while the other applications work like all
the other applications from all other sources. 

It is not that we as Subversion project can set a standard with millions of
other applications out there. I don't think Windows users think about the
argument parsing as being different for svn applications and other
applications.


The best fix for Windows users would be to remove the special handling from
'svn' and 'svnadmin' too, and handle the wildcard expansion in the argument
parsing logic *after* we separate them from arguments that don't point to
local paths... This is how well behaved Windows applications do things.

But this would involve adding a lot of Windows support to apis and/or the
svn client that aren't used for this kind of things on other platforms.

With reducing the scope of the 'special argument parsing' to the tools that
really need this, all other applications are much easier to use by scripts,
where they had to apply hacks to provide arguments that may contain a '?' or
'*', because there is no way to escape the arguments at this level.

	Bert
> 
> - Julian
> 
> [I mentioned it to Bert on IRC:
>
<http://colabti.org/irclogger/irclogger_log/svn-dev?date=2014-03-13#l198>.]
> 
> 
> > * build.conf
> >   (svn,
> >    svnadmin): Add setargv.obj to msvc-libs.
> >
> > * build/generator/gen_win.py
> >   (get_win_libs): Remove magic dependency of all .exe's.
> 
> > Modified: subversion/trunk/build.conf
> >
> ==========================================================
> ====================
> > @@ -146,6 +146,7 @@
> > +msvc-libs = setargv.obj
> >
> > @@ -155,6 +156,7 @@
> > +msvc-libs = setargv.obj
> >
> > Modified: subversion/trunk/build/generator/gen_win.py
> >
> ==========================================================
> ====================
> > @@ -867,9 +867,6 @@ class WinGeneratorBase(gen_win_dependenc
> >
> >      nondeplibs = target.msvc_libs[:]
> >
> > -    if isinstance(target, gen_base.TargetExe):
> > -      nondeplibs.append('setargv.obj')
> > -