当提交修订控制需要开发人员更改自己的配置时

发布于 2024-11-30 19:31:28 字数 227 浏览 1 评论 0原文

当提交到版本控制的更改需要获取更新的开发人员执行一些特定的附加操作(例如修改不在版本控制中的本地配置文件)时,通知其他开发人员的最佳方法是什么?

我目前正在将其写入提交消息中,但似乎很容易被忽略。是否有任何版本控制系统提供更好的方法来做到这一点?

其他人如何做到这一点,或者不应该有任何超出修订控制范围的必要更改?

我正在使用 Mercurial,但使用其他形式的修订控制的人的答案也很有用。

What's the best method to notify other developers when a change committed into revision control requires some specific additional action by the developer getting the update e.g. modify a local config file not in version control?

I'm currently writing it in the commit message, but it seems like this could easily be missed. Do any revision control systems provide a better way of doing this?

How do other people do this, or should there never be any necessary changes that are outside of revision control?

I'm using mercurial but answers from those using other forms of revision control would be useful too.

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

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

发布评论

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

评论(5

﹉夏雨初晴づ 2024-12-07 19:31:28

很少有超出修订控制范围的必要更改。对于极少数情况,请使用开发人员拥有的常规沟通渠道(例如邮件列表或 IRC 渠道或类似渠道)。无论如何,每个多开发人员项目都需要这样的东西。

There should rarely be changes necessary that are outside of revision control. For the rare cases where they are, use the regular communication channel the developers have (like mailing list or IRC channel or something similar). Every multi-developer project needs such thing anyway.

不再见 2024-12-07 19:31:28

使用 git,您可以做的(即使在该场景中并不存在)是使用 过滤器驱动程序,前提是您的提交包含以下更改:包含可识别内容的文件(过滤器不会没有文件的名称或路径)。

在此处输入图像描述

过滤器驱动程序是:

  • .gitattributes 文件中声明(意思是,相反挂钩或触发器,您可以轻松分发它)
  • 附加到污点和清晰的脚本(也有版本控制,污点脚本在提交时触发。
  • 您可以在提交时触发您需要的任何自动操作。

同样,重点是不是使用挂钩(您无法在存储库中轻松复制),并使用可以进行版本控制和克隆的机制。

With git, what you could do (even if it isn't really there for that scenario) is to use a filter driver, provided your commit includes changes for a file with a recognizable content (the filter doesn't have a name or path of the file).

enter image description here

A filter driver is:

  • declared in a .gitattributes files (meaning, contrary to hooks or triggers, you can easily distribute it)
  • attached to a smudge and a clear script (also versioned, the smudge one being triggered on commit.
  • you can, on commit, triggers whatever automatic action you need.

Again, the point is to not use hooks (which you can't easily replicated amongst repos), and use a mechanism which can be versioned and cloned around.

凉栀 2024-12-07 19:31:28

就我个人而言,我使用两种方法:

  1. 沟通一种:我告诉其他开发人员需要进行哪些操作才能保持最新(正确,但有时,我们会错过一些细节......)
  2. 脚本化方法:我做了一个update 脚本,用于管理项目所有部分的更新(不同的目录、不同的存储库、不同的版本控制...),在这个脚本中我放置了维护正确所需的每个操作存储库(我将它用于 svn 和git 存储库)。

Personnally, I use 2 methods :

  1. the communication one : I tell to other developpers what manipulations are to do to be up-to-date (correct, but sometimes, we miss some details ....)
  2. the scripted one : I made an update script that is used to manage the update of all the parts of my project (different directories, different repositories, different version control...), in this script I put every operation needed to maintain a correct repository (I use it for svn and git repositories).
后来的我们 2024-12-07 19:31:28

只是一个想法,但您可以根据提交消息中的模式触发,

以通过 挂钩

Just an idea, but you could have trigger based on a pattern in the commit message to send a mail with the commit comment to developers

doable with hooks

您的好友蓝忘机已上羡 2024-12-07 19:31:28

对于每个开发人员需要进行本地更改的文件(例如数据库连接字符串等),我喜欢将模板保留为跟踪文件,例如 localconfig.template。在您的构建/启动脚本中,您可以具有如下逻辑:

if not exists localconfig then
  copy localconfig.template to localconfig
else
  if localconfig.template is newer than localconfig
    print a big ugly warning about maybe needing to update

For files where each developer needs to make local changes (like database connection strings, etc.) I like to keep a template as a tracked file, something like localconfig.template. In your build/launch scripts you could have logic like this:

if not exists localconfig then
  copy localconfig.template to localconfig
else
  if localconfig.template is newer than localconfig
    print a big ugly warning about maybe needing to update
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文