如何自动propdel svn:可执行文件?
Subversion具有设置如何自动propdel svn:可执行文件?,svn,cygwin,executable,Svn,Cygwin,Executable,Subversion具有设置svn:executable属性的功能 在新添加的具有exec权限的文件上。 是否存在控制此行为的配置 我知道如何使用config[autoprop]在某些文件上设置属性,但我看不到取消设置的方法 尤其令人恼火的是,Cygwin上的svn客户端认为所有windows文件都是可执行的,并用可执行文本和C文件填充存储库 除了在将文件添加到svn之前小心并对其进行chmod之外,还有什么技巧可以阻止这种情况吗?基本上是chmod-x运行:svn propdel svn:ex
svn:executable
属性的功能
在新添加的具有exec权限的文件上。
是否存在控制此行为的配置
我知道如何使用config[autoprop]
在某些文件上设置属性,但我看不到取消设置的方法
尤其令人恼火的是,Cygwin上的svn客户端认为所有windows文件都是可执行的,并用可执行文本和C文件填充存储库
除了在将文件添加到svn之前小心并对其进行chmod之外,还有什么技巧可以阻止这种情况吗?基本上是chmod-x运行:
svn propdel svn:executable file
svn propset svn:executable src/*.C
svn propset svn:executable src/*.txt
基于Victor Parmar的想法,我编写了以下包装器脚本
svn add
,它尝试检测实际的可执行文件,并在添加文件时删除其余部分的svn:executable
属性
#!/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
你确定它能切换吗?对我来说,任何值只会设置“*”坏运气,
svn propset svn:executable src/*.C
将把src/*.C
中的第一个值作为其余文件的属性值,并且该值总是被忽略<代码>svn propdel当然有效。然而,这只能在命令行中完成,在[自动道具]
中没有相应的选项。啊,笑话!我想您需要将它包装在一个shell脚本中:)