You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jože Fabčič <Jo...@comtrade.com> on 2015/06/11 15:26:09 UTC

bug? svn.exe propset svn:executable "*" affects too may files on Windows

Hi all,

I compiled a library (boost) and found out that few files are missing the svn:executable property. I wanted to set the property and the command line client started to apply the property to all the files in the current directory:

b:\boost\boost-1.44>svn propset svn:executable "*" bootstrap.sh
property 'svn:executable' set on 'boost-build.jam'
property 'svn:executable' set on 'boost.css'
property 'svn:executable' set on 'boost.png'
property 'svn:executable' set on 'bootstrap.bat'
property 'svn:executable' set on 'bootstrap.sh'
svn: E200009: Cannot set 'svn:executable' on a directory ('B:\boost\boost-1.44\doc')

The working copy was created with TortoiseSVN, probably 1.8.10 that linked SVN 1.8.11. I upgraded to the latest TortoiseSVN 1.8.11 that links SVN 1.8.13 and received the same result. I installed SVN 1.8.13 from https://www.visualsvn.com/downloads/ and received the same result.

On unix, the command works correctly. Using some other value of a property, as used for example in SVN book works fine:

b:\boost\boost-1.44>svn propset svn:executable on bootstrap.sh

The asterisk "*" is returned as the value of property.

b:\boost\boost-1.44>svn propget svn:executable  bootstrap.sh
*

When searching google with "svn execute permission windows", the first result that I receive is

http://stackoverflow.com/questions/6874085/how-to-set-execute-attribute-to-a-file-and-check-it-in-svn-from-windows

and besides the correct procedure using TortoiseSVN it also presents the wrong command-line invocation

svn propset svn:executable "*" someScript

It seems that the value of property is incorrectly used also for selecting the target:
b:\boost\boost-1.44>svn propset svexecutable "i*" bootstrap.sh
property 'svexecutable' set on 'index.html'
property 'svexecutable' set on 'INSTALL'
property 'svexecutable' set on 'bootstrap.sh'
b:\boost\boost-1.44>svn propset svexecutable b* bootstrap.sh
property 'svexecutable' set on 'boost-build.jam'
property 'svexecutable' set on 'boost.css'
property 'svexecutable' set on 'boost.png'
property 'svexecutable' set on 'bootstrap.bat'
property 'svexecutable' set on 'bootstrap.sh'
property 'svexecutable' set on 'bootstrap.sh'

Do you see the same behaviour also on your systems?

Thanks, Jože

Re: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Branko Čibej <br...@wandisco.com>.
On 11.06.2015 17:41, Jože Fabčič wrote:
>
> I see, there are more urgent tasks. It then the different behaviour
> somewhere described? I use SVN book when I need it and I can't find
> anything there. Like many developers, I work on different operating
> systems and it would be good if e.g. SVN Book has a chapter  or note
> on "OS specifics" that explains that the command like
>
>  
>
> svn propset svn:executable "*" bootstrap.sh
>
>  
>
> produces different results depending on OS.
>

Yes. Lots of things are OS-specific; for example, 'svn mkdir foo:bar'
works on my Mac but fails on Windows.

On the other hand,

    svn propset svn:executable yes,please bootstrap.sh

works exactly the same on Windows and Unix and even does what you
expect: sets the property value to '*'.

In hindsight, we really shouldn't have normalized boolean property
values to '*'; but that's water under the bridge.

-- Brane


RE: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Jože Fabčič <Jo...@comtrade.com>.
I see, there are more urgent tasks. It then the different behaviour somewhere described? I use SVN book when I need it and I can't find anything there. Like many developers, I work on different operating systems and it would be good if e.g. SVN Book has a chapter  or note on "OS specifics" that explains that the command like

svn propset svn:executable "*" bootstrap.sh

produces different results depending on OS.

Jože

From: Bert Huijben [mailto:bert@qqmail.nl]
Sent: Thursday, June 11, 2015 5:29 PM
To: Jože Fabčič; dev@subversion.apache.org
Subject: RE: bug? svn.exe propset svn:executable "*" affects too may files on Windows

                Hi Jože,

I know it can be worked around... I described that before. (And even disabled this feature on a few processes that don't handle filenames, but still had this feature enabled)

We try not to add too much Windows specific code to Subversion. (And only C; not C++)
Our commandline handling is borrowed from APR, which provides our platform abstraction.

I don't know if there is an issue number for this... but as long as the general consensus is that this shouldn't be implemented Windows specifically an issue number doesn't help at all. Adding an issue is just a reminder for issues; the way we use the issue tracker for Subversion.


Implementing this 'smart' for each and every commandline option certainly won't be easy... (Every subcommand has different rules for their arguments, sometimes even mixing urls and local paths)

                Bert

Re: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Branko Čibej <br...@wandisco.com>.
On 11.06.2015 17:29, Bert Huijben wrote:
>
>                 Hi Jože,
>
>  
>
> I know it can be worked around… I described that before. (And even
> disabled this feature on a few processes that don’t handle filenames,
> but still had this feature enabled)
>
>  
>
> We try not to add too much Windows specific code to Subversion. (And
> only C; not C++)
>
> Our commandline handling is borrowed from APR, which provides our
> platform abstraction.
>

We explicitly link the setargv.obj library provided by MSVC to expand
wildcards on the command line. This doesn't really have anything to do
with APR. But there's no way to quote the * verbatim on Windows, as
there is with most Unix shells (single vs. double quotes).

We could theoretically implement our own, more Unix-like setargv; but
that would have other weird consequences, not the least being that it
would be incompatible with every other existing command-line tool on
Windows.

In any case, all Subversion properties with boolean values
(svn:executable, svn:needs-lock, etc.) are intentionally implemented so
that /any/ value you set will internally be converted to the asterisk.
We did this precisely because of Windows issues.

Just don't try to explicitly set a property value to '*' on the command
line, or use the -F option if you really must do it.

-- Brane


RE: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Bert Huijben <be...@qqmail.nl>.
                Hi Jože,

 

I know it can be worked around. I described that before. (And even disabled
this feature on a few processes that don't handle filenames, but still had
this feature enabled)

 

We try not to add too much Windows specific code to Subversion. (And only C;
not C++)

Our commandline handling is borrowed from APR, which provides our platform
abstraction.

 

I don't know if there is an issue number for this. but as long as the
general consensus is that this shouldn't be implemented Windows specifically
an issue number doesn't help at all. Adding an issue is just a reminder for
issues; the way we use the issue tracker for Subversion.

 

 

Implementing this 'smart' for each and every commandline option certainly
won't be easy. (Every subcommand has different rules for their arguments,
sometimes even mixing urls and local paths)

 

                Bert

 

From: Jože Fabčič [mailto:Joze.Fabcic@comtrade.com] 
Sent: donderdag 11 juni 2015 17:23
To: Bert Huijben; dev@subversion.apache.org
Subject: RE: bug? svn.exe propset svn:executable "*" affects too may files
on Windows

 

Bert, do you know the issue number for this "known issue"?

 

I checked what the Windows, Visual studio and vscrt do. It's easy to get the
original command line as it was typed into console using function
GetCommandLine (1). It's easy to instruct CRT to expand * to all the files
by linking setargv.obj (2), see
https://msdn.microsoft.com/en-us/library/8bch7bkk(v=vs.100).aspx.

 

The example c++ code is here, easily convertible into c:

#include <iostream>

#include <windows.h>

 

int _tmain(int argc, _TCHAR* argv[])

{

    // 

    _TCHAR* cmd_line = GetCommandLine();

    std::cout << _T("Whole command line=") << cmd_line << _T("\n");

 

    for (int i=0; i<argc; i++)

        std::cout << _T("argv[") << i << _T("]=") << argv[i] << _T("\n");

 

       return 0;

}

 

I compiled it with VS 2010 and run on windows 7.

When run a directory with the following files:

 

b:\svn>dir /b

args

bad-svn.txt

 

It was possible to get asterisk expansion and the original line:

 

b:\svn>args\debug\args 1 "2" "*" *

Whole command line=args\debug\args  1 "2" "*" *

argv[0]=args\debug\args

argv[1]=1

argv[2]=2

argv[3]=args

argv[4]=bad-svn.txt

argv[5]=args

argv[6]=bad-svn.txt

 

This processing of asterisks by CRT function _setargv  is different from the
processing of unix shells as it removes the quotes if present. But the
svn.exe can start with the result of GetCommandLine and evaluate arguments
better, it can distinguish between "*" and *.

 

Jože

 

From: Bert Huijben [mailto:bert@qqmail.nl] 
Sent: Thursday, June 11, 2015 3:56 PM
To: Jože Fabčič; dev@subversion.apache.org
<ma...@subversion.apache.org> 
Subject: RE: bug? svn.exe propset svn:executable "*" affects too may files
on Windows

 

On Windows the '*' is evaluated even when it is enclosed in quotes... (The
arguments are expanded by 'svn' after they are split on Windows, instead of
by the shell as on many other platforms). So your command sets the name of
the first file that matches to the svn:executable value on all further files
that match.

 

There is not much we can do about this. A valid workaround is passing a
different character (E.g. 'x'), as Subversion will canonicalize the value of
this reserved property to '*' when you set it.

(Another workaround is using -F <file> where file contains '*')

 

 

Given that this is a known issue, it would have been better to ask this on
the user list.

 

                Bert

 

From: Jože Fabčič [mailto:Joze.Fabcic@comtrade.com] 
Sent: donderdag 11 juni 2015 15:26
To: dev@subversion.apache.org <ma...@subversion.apache.org> 
Subject: bug? svn.exe propset svn:executable "*" affects too may files on
Windows

 

Hi all,

 

I compiled a library (boost) and found out that few files are missing the
svn:executable property. I wanted to set the property and the command line
client started to apply the property to all the files in the current
directory:

 

b:\boost\boost-1.44>svn propset svn:executable "*" bootstrap.sh

property 'svn:executable' set on 'boost-build.jam'

property 'svn:executable' set on 'boost.css'

property 'svn:executable' set on 'boost.png'

property 'svn:executable' set on 'bootstrap.bat'

property 'svn:executable' set on 'bootstrap.sh'

svn: E200009: Cannot set 'svn:executable' on a directory
('B:\boost\boost-1.44\doc')

 

The working copy was created with TortoiseSVN, probably 1.8.10 that linked
SVN 1.8.11. I upgraded to the latest TortoiseSVN 1.8.11 that links SVN
1.8.13 and received the same result. I installed SVN 1.8.13 from
https://www.visualsvn.com/downloads/ and received the same result.

 

On unix, the command works correctly. Using some other value of a property,
as used for example in SVN book works fine:

 

b:\boost\boost-1.44>svn propset svn:executable on bootstrap.sh

 

The asterisk "*" is returned as the value of property.

 

b:\boost\boost-1.44>svn propget svn:executable  bootstrap.sh

*

 

When searching google with "svn execute permission windows", the first
result that I receive is 

 

http://stackoverflow.com/questions/6874085/how-to-set-execute-attribute-to-a
-file-and-check-it-in-svn-from-windows

 

and besides the correct procedure using TortoiseSVN it also presents the
wrong command-line invocation

 

svn propset svn:executable "*" someScript

 

It seems that the value of property is incorrectly used also for selecting
the target:

b:\boost\boost-1.44>svn propset svexecutable "i*" bootstrap.sh

property 'svexecutable' set on 'index.html'

property 'svexecutable' set on 'INSTALL'

property 'svexecutable' set on 'bootstrap.sh'

b:\boost\boost-1.44>svn propset svexecutable b* bootstrap.sh

property 'svexecutable' set on 'boost-build.jam'

property 'svexecutable' set on 'boost.css'

property 'svexecutable' set on 'boost.png'

property 'svexecutable' set on 'bootstrap.bat'

property 'svexecutable' set on 'bootstrap.sh'

property 'svexecutable' set on 'bootstrap.sh'

 

Do you see the same behaviour also on your systems?

 

Thanks, Jože

 


RE: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Jože Fabčič <Jo...@comtrade.com>.
Bert, do you know the issue number for this "known issue"?

I checked what the Windows, Visual studio and vscrt do. It's easy to get the original command line as it was typed into console using function GetCommandLine (1). It's easy to instruct CRT to expand * to all the files by linking setargv.obj (2), see https://msdn.microsoft.com/en-us/library/8bch7bkk(v=vs.100).aspx.

The example c++ code is here, easily convertible into c:
#include <iostream>
#include <windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
    //
    _TCHAR* cmd_line = GetCommandLine();
    std::cout << _T("Whole command line=") << cmd_line << _T("\n");

    for (int i=0; i<argc; i++)
        std::cout << _T("argv[") << i << _T("]=") << argv[i] << _T("\n");

       return 0;
}

I compiled it with VS 2010 and run on windows 7.
When run a directory with the following files:

b:\svn>dir /b
args
bad-svn.txt

It was possible to get asterisk expansion and the original line:

b:\svn>args\debug\args 1 "2" "*" *
Whole command line=args\debug\args  1 "2" "*" *
argv[0]=args\debug\args
argv[1]=1
argv[2]=2
argv[3]=args
argv[4]=bad-svn.txt
argv[5]=args
argv[6]=bad-svn.txt

This processing of asterisks by CRT function _setargv  is different from the processing of unix shells as it removes the quotes if present. But the svn.exe can start with the result of GetCommandLine and evaluate arguments better, it can distinguish between "*" and *.

Jože

From: Bert Huijben [mailto:bert@qqmail.nl]
Sent: Thursday, June 11, 2015 3:56 PM
To: Jože Fabčič; dev@subversion.apache.org
Subject: RE: bug? svn.exe propset svn:executable "*" affects too may files on Windows

On Windows the '*' is evaluated even when it is enclosed in quotes... (The arguments are expanded by 'svn' after they are split on Windows, instead of by the shell as on many other platforms). So your command sets the name of the first file that matches to the svn:executable value on all further files that match.

There is not much we can do about this. A valid workaround is passing a different character (E.g. 'x'), as Subversion will canonicalize the value of this reserved property to '*' when you set it.
(Another workaround is using -F <file> where file contains '*')


Given that this is a known issue, it would have been better to ask this on the user list.

                Bert

From: Jože Fabčič [mailto:Joze.Fabcic@comtrade.com]
Sent: donderdag 11 juni 2015 15:26
To: dev@subversion.apache.org<ma...@subversion.apache.org>
Subject: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Hi all,

I compiled a library (boost) and found out that few files are missing the svn:executable property. I wanted to set the property and the command line client started to apply the property to all the files in the current directory:

b:\boost\boost-1.44>svn propset svn:executable "*" bootstrap.sh
property 'svn:executable' set on 'boost-build.jam'
property 'svn:executable' set on 'boost.css'
property 'svn:executable' set on 'boost.png'
property 'svn:executable' set on 'bootstrap.bat'
property 'svn:executable' set on 'bootstrap.sh'
svn: E200009: Cannot set 'svn:executable' on a directory ('B:\boost\boost-1.44\doc')

The working copy was created with TortoiseSVN, probably 1.8.10 that linked SVN 1.8.11. I upgraded to the latest TortoiseSVN 1.8.11 that links SVN 1.8.13 and received the same result. I installed SVN 1.8.13 from https://www.visualsvn.com/downloads/ and received the same result.

On unix, the command works correctly. Using some other value of a property, as used for example in SVN book works fine:

b:\boost\boost-1.44>svn propset svn:executable on bootstrap.sh

The asterisk "*" is returned as the value of property.

b:\boost\boost-1.44>svn propget svn:executable  bootstrap.sh
*

When searching google with "svn execute permission windows", the first result that I receive is

http://stackoverflow.com/questions/6874085/how-to-set-execute-attribute-to-a-file-and-check-it-in-svn-from-windows

and besides the correct procedure using TortoiseSVN it also presents the wrong command-line invocation

svn propset svn:executable "*" someScript

It seems that the value of property is incorrectly used also for selecting the target:
b:\boost\boost-1.44>svn propset svexecutable "i*" bootstrap.sh
property 'svexecutable' set on 'index.html'
property 'svexecutable' set on 'INSTALL'
property 'svexecutable' set on 'bootstrap.sh'
b:\boost\boost-1.44>svn propset svexecutable b* bootstrap.sh
property 'svexecutable' set on 'boost-build.jam'
property 'svexecutable' set on 'boost.css'
property 'svexecutable' set on 'boost.png'
property 'svexecutable' set on 'bootstrap.bat'
property 'svexecutable' set on 'bootstrap.sh'
property 'svexecutable' set on 'bootstrap.sh'

Do you see the same behaviour also on your systems?

Thanks, Jože

RE: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Bert Huijben <be...@qqmail.nl>.
On Windows the '*' is evaluated even when it is enclosed in quotes... (The
arguments are expanded by 'svn' after they are split on Windows, instead of
by the shell as on many other platforms). So your command sets the name of
the first file that matches to the svn:executable value on all further files
that match.

 

There is not much we can do about this. A valid workaround is passing a
different character (E.g. 'x'), as Subversion will canonicalize the value of
this reserved property to '*' when you set it.

(Another workaround is using -F <file> where file contains '*')

 

 

Given that this is a known issue, it would have been better to ask this on
the user list.

 

                Bert

 

From: Jože Fabčič [mailto:Joze.Fabcic@comtrade.com] 
Sent: donderdag 11 juni 2015 15:26
To: dev@subversion.apache.org
Subject: bug? svn.exe propset svn:executable "*" affects too may files on
Windows

 

Hi all,

 

I compiled a library (boost) and found out that few files are missing the
svn:executable property. I wanted to set the property and the command line
client started to apply the property to all the files in the current
directory:

 

b:\boost\boost-1.44>svn propset svn:executable "*" bootstrap.sh

property 'svn:executable' set on 'boost-build.jam'

property 'svn:executable' set on 'boost.css'

property 'svn:executable' set on 'boost.png'

property 'svn:executable' set on 'bootstrap.bat'

property 'svn:executable' set on 'bootstrap.sh'

svn: E200009: Cannot set 'svn:executable' on a directory
('B:\boost\boost-1.44\doc')

 

The working copy was created with TortoiseSVN, probably 1.8.10 that linked
SVN 1.8.11. I upgraded to the latest TortoiseSVN 1.8.11 that links SVN
1.8.13 and received the same result. I installed SVN 1.8.13 from
https://www.visualsvn.com/downloads/ and received the same result.

 

On unix, the command works correctly. Using some other value of a property,
as used for example in SVN book works fine:

 

b:\boost\boost-1.44>svn propset svn:executable on bootstrap.sh

 

The asterisk "*" is returned as the value of property.

 

b:\boost\boost-1.44>svn propget svn:executable  bootstrap.sh

*

 

When searching google with "svn execute permission windows", the first
result that I receive is 

 

http://stackoverflow.com/questions/6874085/how-to-set-execute-attribute-to-a
-file-and-check-it-in-svn-from-windows

 

and besides the correct procedure using TortoiseSVN it also presents the
wrong command-line invocation

 

svn propset svn:executable "*" someScript

 

It seems that the value of property is incorrectly used also for selecting
the target:

b:\boost\boost-1.44>svn propset svexecutable "i*" bootstrap.sh

property 'svexecutable' set on 'index.html'

property 'svexecutable' set on 'INSTALL'

property 'svexecutable' set on 'bootstrap.sh'

b:\boost\boost-1.44>svn propset svexecutable b* bootstrap.sh

property 'svexecutable' set on 'boost-build.jam'

property 'svexecutable' set on 'boost.css'

property 'svexecutable' set on 'boost.png'

property 'svexecutable' set on 'bootstrap.bat'

property 'svexecutable' set on 'bootstrap.sh'

property 'svexecutable' set on 'bootstrap.sh'

 

Do you see the same behaviour also on your systems?

 

Thanks, Jože

 


Re: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Branko Čibej <br...@wandisco.com>.
On 11.06.2015 15:26, Jože Fabčič wrote:
>
> Hi all,
>
>  
>
> I compiled a library (boost) and found out that few files are missing
> the svn:executable property. I wanted to set the property and the
> command line client started to apply the property to all the files in
> the current directory:
>
>  
>
> b:\boost\boost-1.44>svn propset svn:executable "*" bootstrap.sh
>

Zvezdica je wildcard tudi na Windows. :)

-- Brane


Re: bug? svn.exe propset svn:executable "*" affects too may files on Windows

Posted by Martin Furter <mf...@bluewin.ch>.
On 06/11/15 18:56, Jože Fabčič wrote:
> Hi all,
>
> I compiled a library (boost) and found out that few files are missing
> the svn:executable property. I wanted to set the property and the
> command line client started to apply the property to all the files in
> the current directory:
>
> b:\boost\boost-1.44>svn propset svn:executable "*" bootstrap.sh
> property 'svn:executable' set on 'boost-build.jam'
> property 'svn:executable' set on 'boost.css'
> property 'svn:executable' set on 'boost.png'
> property 'svn:executable' set on 'bootstrap.bat'
> property 'svn:executable' set on 'bootstrap.sh'
>
> svn: E200009: Cannot set 'svn:executable' on a directory
> ('B:\boost\boost-1.44\doc')
>
> The working copy was created with TortoiseSVN, probably 1.8.10 that
> linked SVN 1.8.11. I upgraded to the latest TortoiseSVN 1.8.11 that
> links SVN 1.8.13 and received the same result. I installed SVN 1.8.13
> from https://www.visualsvn.com/downloads/ and received the same result.
>
> On unix, the command works correctly. Using some other value of a
> property, as used for example in SVN book works fine:
>
> b:\boost\boost-1.44>svn propset svn:executable on bootstrap.sh
>
> The asterisk "*" is returned as the value of property.
>
> b:\boost\boost-1.44>svn propget svn:executable bootstrap.sh
>
> *
>
> When searching google with "svn execute permission windows", the first
> result that I receive is
>
> http://stackoverflow.com/questions/6874085/how-to-set-execute-attribute-to-a-file-and-check-it-in-svn-from-windows
>
> and besides the correct procedure using TortoiseSVN it also presents the
> wrong command-line invocation
>
> |svn propset svn:executable "*" someScript|
>
> ||
>
> It seems that the value of property is incorrectly used also for
> selecting the target:
>
> b:\boost\boost-1.44>svn propset svexecutable "i*" bootstrap.sh
> property 'svexecutable' set on 'index.html'
> property 'svexecutable' set on 'INSTALL'
> property 'svexecutable' set on 'bootstrap.sh'

Please retry this command with the property name "svexecutable", then 
look at the contents of the property:
svn propget svexecutable INSTALL
I guess it will show "index.htm" (or some other filename).

If this is true then it seems to expand the property value like a 
filename pattern. And since it finds multiple files you get some 
additional files for which the property is set.

Another experiment is using a different property value:
svn propset svn:executable X bootstrap.sh

- Martin