gpt4 book ai didi

svn - 强制 svn :eol-style=native on the server?

转载 作者:行者123 更新时间:2023-12-02 15:22:52 26 4
gpt4 key购买 nike

目前,为了保证颠覆性eol-style设置为native对于添加到项目中的每个新文件,我们必须将其添加到 ~/.subversion/config我们每台开发人员机器上的文件:

[miscellany]
enable-auto-props = yes

[auto-props]
*.java = svn:eol-style=native

有没有办法在 svn 服务器上做同样的事情?

最佳答案

不,没有。

您可以使用 Hook 脚本来查找要设置或未设置的属性,但除此之外这是不可能的。 Subversion 与 CVS 不同,它无法更改来自提交的代码内容。

SVN 书中包含有关 this question 的注释:

Warning

Do not attempt to modify the transaction using hook scripts. A common example of this would be to automatically set properties such as svn:eol-style or svn:mime-type during the commit. While this might seem like a good idea, it causes problems. The main problem is that the client does not know about the change made by the hook script, and there is no way to inform the client that it is out-of-date. This inconsistency can lead to surprising and unexpected behavior.

Instead of attempting to modify the transaction, it is much better to check the transaction in the pre-commit hook and reject the commit if it does not meet the desired requirements.

关于svn - 强制 svn :eol-style=native on the server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5671406/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com