Perforce 客户端预提交钩子 [英] Perforce client side pre-commit hook

查看:234
本文介绍了Perforce 客户端预提交钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 perforce 作为 Visual Studio 解决方案的源代码控制.使用 P4 和 P4V.是否可以添加客户端预提交挂钩?例如确保调试器"这个词;*.js 文件中不存在.可以在谷歌找到一些东西.谢谢.

We are using perforce as a source control for Visual studio solution. Working with P4 and P4V. Is it possible to add client side pre-commit hook? for instance to ensure the word "debugger;" is not exist in *.js files. Could find something in Google. Thanks.

推荐答案

Perforce 触发器可用于强制执行此类策略,但它们在服务器中运行,而不是在客户端运行.因此,我所知道的大多数网站都会强制执行一项规则,例如您在服务器中使用更改内容触发器描述的规则.

Perforce triggers can be used to enforce such a policy, but they run in the server, not client-side. So most sites that I'm aware of would enforce a rule such as the one you describe using a change-content trigger in the server.

http://www.perforce.com/perforce/doc.current/manuals/cmdref/triggers.html

从您的问题中看不出为什么需要客户端挂钩.您是否有某些原因不想使用更改内容触发器?

It's not obvious from your question why you need to have a client-side hook. Is there some reason you don't want to use a change-content trigger?

也许您可以考虑将工作流程重新构建为代码审查流程,并在您选择的代码审查工具中实施此类政策.

Perhaps you might consider re-framing your workflow as a code review process, and implement policies like this in your code review tool of choice.

这篇关于Perforce 客户端预提交钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆