Proper way to add svn:executable

SvnPropertiesExecutable

Svn Problem Overview


I have a few files that have been executable before svn adding them. They have the svn:executable property set. Now, a few other files were checked in without the executable bit do not have it, and I want to set the svn:executable property:

$ svn propset svn:executable on *.cgi

Then I check the status and even the files with the svn:executable have been modified:

$ svn diff
Property changes on: a.cgi
___________________________________________________________________
Modified: svn:executable
   - 
   + *


Property changes on: b.cgi
___________________________________________________________________
Added: svn:executable
   + *

a.cgi should not be modified. I want to add the svn:executable bit to be set in the same way as it is on the other files, but can't figure out the command to do it.

Svn Solutions


Solution 1 - Svn

You are right to use the svn property editing commands. The property is svn:executable.

To add the "executable bit" in svn

svn propset svn:executable on <list of files>

To remove the "executable bit" in svn

svn propdel svn:executable <list of files>

The SVN documentation for this is located here.

As far as not modifying the executables, you are not modifying the executable (a checksum will verify that), but you are modifying the SVN repository. Remember that SVN revisions file systems, not just files; so, a modification of the permission bits will increase the SVN revision number, even if it's just a modification of a file's properties (and not a modification of the file itself).

Solution 2 - Svn

Here is how I set the executable property on all the *.py files in my project that have execute bit set on them. I execute this from the top level directory

for f in `find ./ -name '*.py'`; do echo $f; if [ -x $f ]; then echo $f 'is executable setting svn:executable'; svn propset svn:executable on $f; else echo $f 'is not executable'; fi; done;

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJakeView Question on Stackoverflow
Solution 1 - SvnEdwin BuckView Answer on Stackoverflow
Solution 2 - SvnIsaac JessopView Answer on Stackoverflow