如何自动 propdel svn:executable?

发布于 2024-10-25 21:45:14 字数 280 浏览 1 评论 0原文

Subversion 具有设置 svn:executable 属性的功能 在新添加的具有执行权限的文件上。 是否有一些配置可以控制这种行为?

我知道如何使用配置 [autoprop] 在某些文件上设置属性,但我看不出有什么办法可以取消设置。

当 Cygwin 上的 svn 客户端认为所有 Windows 文件都是可执行的,并用可执行文本和 C 文件填充存储库时,这尤其令人恼火。

除了在将文件添加到 svn 之前小心并 chmod 之外,是否有任何技巧可以抑制这种情况?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

内心荒芜 2024-11-01 21:45:14

基本上是 chmod -x 运行:svn propdel svn:executable file

svn propset svn:executable src/*.C 
svn propset svn:executable src/*.txt

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

svn propset svn:executable src/*.C 
svn propset svn:executable src/*.txt
淡淡の花香 2024-11-01 21:45:14

基于 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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文