我如何与所有其他开发人员共享 Mercurial 中的提交挂钩?

发布于 10-16 17:13 字数 146 浏览 8 评论 0原文

我们正在使用 Mercurial,现在我们想引入预提交挂钩来保持代码整洁。我们希望每个人都能以某种方式获得钩子,但我们也希望能够以某种集中的方式更新它。 Mercurial 没有版本控制挂钩,那么我们的替代选择是什么? 你们有人找到解决方案吗? 提前致谢!

内米

we are working with mercurial and now we would like to introduce precommit hooks to keep the code clean. We would like everyone to somehow get the hooks, but we would also like to be able to update this in some centralized way. Mercurial does not version control hooks, so what would be our alternative option?
Do any of you have found a solution for this?
Thanks in advance!

Nemmi

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

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

发布评论

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

评论(3

太阳男子2024-10-23 17:13:00

钩子不会被克隆(如“Mercurial 中的版本控制扩展配置”中的详细信息) "),但您可以有一个通用的 hgrc 文件(请参阅 hgrc 语法):

%include file 形式的一行会将文件包含到当前配置文件中

中,然后您可以在该中央配置文件中修改 [hooks] 部分。

Hooks are not cloned (as detailed in "Version-controlled extension configuration in Mercurial"), but you can have a common hgrc file (see hgrc Syntax):

A line of the form %include file will include file into the current configuration file

In that central configuration file, you can then modify the [hooks] section.

若能看破又如何2024-10-23 17:13:00

如果您可以控制他们的桌面(这是标准的企业安装),您可以将挂钩放入系统范围的条目 /etc/mercurial/hgrc/etc/mercurial/hgrc.d /ourcommithook

如果您要远程管理机器,您可以使用非常优秀的 puppet 之类的东西来自动执行此操作 或者构建您自己的 .rpm、.deb 或 .msi 安装程序,该安装程序都安装了 Mercurial 并将每个人挂钩放置在计算机全局配置中。

If you have control over their desktops (it's a standard corporate install) you can put the hook in the system-wide entries /etc/mercurial/hgrc or /etc/mercurial/hgrc.d/ourcommithook

If you're remotely administering the machines you could automate this using something like the very excellent puppet or by building your own .rpm, .deb, or .msi installer which both installed Mercurial and places the everyone hooks in the machine-global config.

娇妻2024-10-23 17:13:00

查看 projrc 扩展。然后,您只需让设计人员在他们的 ~/.hgrc 文件中放置少量公共行,它们就会自动推送您在集中式存储库的 repo/.hg/projrc 文件中放置的任何内容。

您仍然需要一个公共位置来放置这些挂钩,但您可能已经拥有某种用户都安装的共享安装驱动器,对吧?或者您可以拥有一个“工具”存储库,每个人都必须在标准位置签出该存储库。

史蒂夫

Have a look at the projrc extension. You then simply need to have designers put a small number of common lines in their ~/.hgrc files and they will automatically get pushed whatever you put in your centralized repo's repo/.hg/projrc file.

You will still need a common place to put these hooks but you probably already have some sort of shared mounted drive that users all mount, right? Or you could have a "tools" repository that everybody has to have checked out in a standard location.

Steve

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