验证文件签入到 svn

发布于 2024-12-28 11:38:56 字数 102 浏览 5 评论 0原文

我的团队成员经常使用 CopyLocal 选项 True 签入 Cshasrp 项目文件以获取程序集引用。我想阻止这种情况发生。

有哪些机制可用于验证检查到 svn 的文件?

My team members often check-in Cshasrp project files with CopyLocal option True for assembly references. I would like to prevent this.

What mechanisms available to validate files checked to svn?

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

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

发布评论

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

评论(2

椵侞 2025-01-04 11:38:57

可用的机制是 预提交提交挂钩。我认为大多数 SVN 发行版都附带了此类钩子脚本的示例。

这是我创建新存储库时由发行版创建的示例挂钩:

#!/bin/sh

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null || exit 1

# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1

# All checks passed, so allow the commit.
exit 0

The available mechanism is a pre-commit hook. I think most distributions of SVN come with examples of such hook scripts.

Here's the example hook that is created by by distribution when I create a new repo:

#!/bin/sh

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/local/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
   grep "[a-zA-Z0-9]" > /dev/null || exit 1

# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1

# All checks passed, so allow the commit.
exit 0
英雄似剑 2025-01-04 11:38:57

另一个解决方案

是在存储库、(主干)属性中定义忽略列表,并包含所有本地文件,这些文件必须被 Subversion 命令忽略。

之后,任何一次签出/更新都会将更改的属性填充到所有工作副本中

Just another solution

define ignore-list on repository, in properties (of trunk) and include all local files, which must be ignored by Subversion commands.

After it any and every checkout/update will populate changed properties into all working copies

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