Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto propdel svn:executable?

Subversion has a feature to set the svn:executable property on newly added files that have exec-permission. Is there some configuration that controls this behavior?

I know how to set a property on certain files using config [autoprop], but I see no way to unset it.

It is particularly irritating when the svn client on Cygwin believes that all windows files are executable, and populates the repository with executable texts and C files.

Is there any trick to inhibit this, apart from being careful and chmod the files before adding them to svn?

like image 241
jmster Avatar asked Nov 28 '25 15:11

jmster


2 Answers

Basically to chmod -x run: svn propdel svn:executable file

svn propset svn:executable src/*.C 
svn propset svn:executable src/*.txt
like image 151
Victor Parmar Avatar answered Dec 01 '25 16:12

Victor Parmar


Based on Victor Parmar's idea, I have written the following wrapper script svn-add, which tries to detect actual executables and removes the svn:executable property for the rest when adding files.

#!/bin/bash

svn add "$@" || exit $?

if [ "$(uname -o 2>/dev/null)" = "Cygwin" ]; then
    for filespec
    do
        if [ -f "$filespec" ]; then
            extension=${filespec##*.}
            if [[ ";${PATHEXT^^};" = *";.${extension^^};"* ]]; then
                echo "$filespec is executable"
            else
                # According to Windows, the file is not executable, but Cygwin
                # treats all files on the Windows file systems as executable
                # (unless explicitly modified via chmod), and Subversion's
                # Automatic Property Setting feature adds svn:executable
                # properties. Strip them off for this file.
                svn propdel svn:executable "$filespec"
            fi
        fi
    done
fi
like image 29
Ingo Karkat Avatar answered Dec 01 '25 17:12

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!