You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Quincey Koziol <ko...@ncsa.uiuc.edu> on 2002/09/27 17:39:07 UTC

svn:executable property

Howdy all,
    I'm new to the subversion side of things, so please take this with a
grain of salt.  But, it occurs to me that the 'svn:executable' setting
should be a platform dependent setting based on the machine a working copy
is checked out on (similar to the 'svn:eol-style' property).  It really
would not be useful to mark UNIX scripts or binaries as executable on a
Windows platform and vice versa for batch files from DOS/Windows on UNIX.
    Is there a convenient way to have the property vary based on the working
copies platform?

    Quincey Koziol
    koziol@ncsa.uiuc.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:executable property

Posted by cm...@collab.net.
"Barry Scott" <ba...@ntlworld.com> writes:

> > No real need to make it OS dependent, as far as I know.  Windows has
> > no executable bit (using file extension for that mechanism) and Unix
> > has only the executable bit (and doesn't give a rip about file
> > extension.  So I think keeping things OS-ignorant is benign.
> 
> This means that you have to make sure that APR never sets the execute
> bit on not-Unix to support the client being OS independent. That's an
> obscure dependency.

Well, as it turns out, APR *does* set the execute bit, and rightfully
so (in my opinion).  Keep in mind that these bits are a statement
about permission to perform tasks, not a testament to the success
you'll have if you try to do so.  In other words, just because I
'chmod 777 biff.jpg' doesn't mean that trying to run 'biff.jpg' as a
program is going to work out all that well.  

As is accurately noted in APR's code:

    /* Read, write execute for owner.  In the Win9x environment, any
     * readable file is executable (well, not entirely 100% true, but
     * still looking for some cheap logic that would help us here.)
     * The same holds on NT if a file doesn't have a DACL (e.g., on FAT)
     */

So, the real problem here is that it seems folks want to map APR's use
of the OS's "execute permission" bit to a Subversion "execution
success" property, in what I assume is an attempt to keep from having
every new file added under Win9x from having this property set.

If that is the case, then I don't think we have any choice but to have
OS-dependent code in Subversion.  That's disappointing... but then so
was Matchbox Twenty's sophomore release.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svn:executable property

Posted by Barry Scott <ba...@ntlworld.com>.
> -----Original Message-----
> From: Karl Fogel [mailto:kfogel@newton.ch.collab.net]
> Sent: 02 October 2002 05:47
> To: Brian Denny
> Cc: Barry Scott; dev@subversion.tigris.org
> Subject: Re: svn:executable property
> 
> 
> If it's not already there, we should try to put any HAS_EXECUTE_BIT
> flag in APR, not Subversion.  There are enough APR developers here to
> get any reasonable patch into the tree, I would think...
> 
> -K

Magic! I like this design! APR knows the semantics, SVN behaviour is
controlled by what APR reports.

The flip side of the execute bit semantics is that no code should assume
that file-is-runnable == execute-bit-set. The semantics of runnable on
Mac and windows are far more interesting then this. (This may be an issue
for rapid SVN I doubt it is for CLI SVN). Open of a .doc file could run
the associated app for example.)

BArry



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:executable property

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
If it's not already there, we should try to put any HAS_EXECUTE_BIT
flag in APR, not Subversion.  There are enough APR developers here to
get any reasonable patch into the tree, I would think...

-K


Brian Denny <br...@briandenny.net> writes:
> do you mean doing something like
> 
> #ifdef SVN_WIN32
> #define SVN_HAS_EXECUTE_BIT  0
> #else
> #define SVN_HAS_EXECUTE_BIT  1
> #endif
> 
> in an appropriate header file?  or as part of the configure/build
> system?
> 
> or do you know of some pre-existing way to tell if the system
> has an execute bit?  (i can find no such thing in the APR or SVN
> headers).
> 
> OTOH the logic works (AFAIK) for the cases we have presently, and it's
> only one line in the code that we're talking about, so it's easy to
> refactor if the need arises.
> 
> so i don't feel particularly *compelled* to alter the patch, myself,
> but will be happy to do so if there's some consensus on how it should
> be changed...
> 
> 
> -brian
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svn:executable property

Posted by Brian Denny <br...@briandenny.net>.

> Can you have a APR_HAS_EXECUTE_BIT? Then you can write in
> positive rather then negative logic.

do you mean doing something like

#ifdef SVN_WIN32
#define SVN_HAS_EXECUTE_BIT  0
#else
#define SVN_HAS_EXECUTE_BIT  1
#endif

in an appropriate header file?  or as part of the configure/build
system?

or do you know of some pre-existing way to tell if the system
has an execute bit?  (i can find no such thing in the APR or SVN
headers).

OTOH the logic works (AFAIK) for the cases we have presently, and it's
only one line in the code that we're talking about, so it's easy to
refactor if the need arises.

so i don't feel particularly *compelled* to alter the patch, myself,
but will be happy to do so if there's some consensus on how it should
be changed...


-brian



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svn:executable property

Posted by Barry Scott <ba...@ntlworld.com>.
> in discussion of the patch to address this issue, the closest thing
> to a consensus has been to *not* set the svn:executable property on
> platforms that don't have executable bits, which if i understand
> correctly is also what you (Barry) are advocating.

Yes thats what I'm advocating. Why not state when you will do it
rather then when not?

> thus, the patch which i have submitted checks for
> APR_HAS_USER and !(SVN_WIN32).

!(SVN_WIN32) does equal a POSIX filesystem API.
Can you have a APR_HAS_EXECUTE_BIT? Then you can write in
positive rather then negative logic.

> AFAIK no one so far has objected to this approach.  it's not clear to me
> that cmpilato's post quoted above is in disagreement.

cmpilato's post (that I repied to) said that it should be platform
independent. cmpilato's follow up is that it should be platform
dependent.

Barry



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svn:executable property

Posted by Brian Denny <br...@briandenny.net>.

On Mon, 30 Sep 2002, Barry Scott wrote:

> > No real need to make it OS dependent, as far as I know.  Windows has
> > no executable bit (using file extension for that mechanism) and Unix
> > has only the executable bit (and doesn't give a rip about file
> > extension.  So I think keeping things OS-ignorant is benign.
>
> I think it should be OS dependent so that it is clear that its not
> supposed to work on not-Unix. Or at least test for execute bits capability
> being supported on the platform.

in discussion of the patch to address this issue, the closest thing
to a consensus has been to *not* set the svn:executable property on
platforms that don't have executable bits, which if i understand
correctly is also what you (Barry) are advocating.

thus, the patch which i have submitted checks for
APR_HAS_USER and !(SVN_WIN32).

AFAIK no one so far has objected to this approach.  it's not clear to me
that cmpilato's post quoted above is in disagreement.

-brian




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: svn:executable property

Posted by Barry Scott <ba...@ntlworld.com>.
> No real need to make it OS dependent, as far as I know.  Windows has
> no executable bit (using file extension for that mechanism) and Unix
> has only the executable bit (and doesn't give a rip about file
> extension.  So I think keeping things OS-ignorant is benign.

This means that you have to make sure that APR never sets the execute
bit on not-Unix to support the client being OS independent. That's an
obscure dependency.

If someone finds a use for execute bit on Windows the client code
will not work right. os.stat in Python for example sets execute bit
for .exe files.

When someone reads the code and sees that on windows you run this
logic they should be surprised and wonder how it ever works.

I think it should be OS dependent so that it is clear that its not
supposed to work on not-Unix. Or at least test for execute bits capability
being supported on the platform.

BArry



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn:executable property

Posted by cm...@collab.net.
Quincey Koziol <ko...@ncsa.uiuc.edu> writes:

>     I'm new to the subversion side of things, so please take this with a
> grain of salt.  But, it occurs to me that the 'svn:executable' setting
> should be a platform dependent setting based on the machine a working copy
> is checked out on (similar to the 'svn:eol-style' property).  It really
> would not be useful to mark UNIX scripts or binaries as executable on a
> Windows platform and vice versa for batch files from DOS/Windows on UNIX.

No real need to make it OS dependent, as far as I know.  Windows has
no executable bit (using file extension for that mechanism) and Unix
has only the executable bit (and doesn't give a rip about file
extension.  So I think keeping things OS-ignorant is benign.

I think you were saying the same thing, but your complaint is that the
feature isn't *useful* across OS.  I agree, but I see no need to add
the unnecessary complexity (in the code and in documentation).  It
should suffice to say that "the property controls the executable bit on
platforms that have such a thing", and be done with it.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org