Skip to end of metadata
Go to start of metadata

The svn:executable property on Windows in cygwin

Background

Subversion carries executable information in the built-in property called svn:executable. This property, unlike others, may be present or absent, but it has no value. You can add it or delete it, but but you cannot change its value.

In theory, Subversion ignores Windows file permissions and by default does not set svn:executable. However, cygwin svn acts like Unix svn and determines the svn:executable property based on file permissions.

If you create a file from the cygwin command line, by default it is executable only if the filename ends with .bat, .com or .exe, or if its content starts with #!. [This is what the doc says, but you may see -x for all files.] If you create a file using a Windows tool, by default its Windows permissions are executable by all. Cygwin interprets the Unix-style permissions this way as well. If the file is executable by all, cygwin svn sets the svn:executable property on the file when you invoke svn add.

Removing existing executable properties from the repository

You can use svn propdel to remove the svn:executable property from your working copy.

svn propdel -R svn:executable

will recursively remove the svn:executable property from all of the files below the current directory. You can use this and commit the files to clean the repository if necessary.

Preventing Subversion from adding unwanted executable properties

Windows/cygwin users who don't want to have to think about using svn propdel or chmod on each added file can use a non-cygwin version of svn. The Subversion 1.2.3 Win32 binaries, downloadable from the link at the bottom of http://subversion.tigris.org/project_packages.html, appear to work well. After installation add the svn.exe location to your Windows PATH variable. If you are switching from cygwin svn to Win32 svn

Remove the subversion component from your cygwin installation because when svn is invoked from a cygwin window, the cygwin version is found even if your cygwin/bin directory is later on the path. (In the Select Packages window of the setup wizard, navigate to the subversion package in the Devel. category. Click on the status icon until Uninstall is displayed. Click next and continue through the wizard until installation is complete.)

Copy the servers file and the auth folder from the sygwin ~/.subversion directory to C:\Documents and Settings\<user>\Application Data\Subversion used by Win32 subversion.

Note that windows svn uses backslash as the path separator when displaying file names. You cannot just copy and paste this file name to another svn command when running from within a cygwin shell. You need to enclose the file name into double quotes.

Alternatively, Windows users can set file permissions in Windows Explorer. (Right-click on the top-level folder & select Properties. Select the Security tab. Click Advanced. Remove all instances of Read & Execute from the Permission Entries. Click "Reset permissions on all child objects and enable propogations of inheritable permissions". Click Apply. OK. OK.) You will have to do this again when you do a clean checkout to a new directory.

Labels
  • None