当提交修订控制需要开发人员更改自己的配置时
当提交到版本控制的更改需要获取更新的开发人员执行一些特定的附加操作(例如修改不在版本控制中的本地配置文件)时,通知其他开发人员的最佳方法是什么?
我目前正在将其写入提交消息中,但似乎很容易被忽略。是否有任何版本控制系统提供更好的方法来做到这一点?
其他人如何做到这一点,或者不应该有任何超出修订控制范围的必要更改?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
很少有超出修订控制范围的必要更改。对于极少数情况,请使用开发人员拥有的常规沟通渠道(例如邮件列表或 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.
使用 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).
A filter driver is:
.gitattributes
files (meaning, contrary to hooks or triggers, you can easily distribute it)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.
就我个人而言,我使用两种方法:
update
脚本,用于管理项目所有部分的更新(不同的目录、不同的存储库、不同的版本控制...),在这个脚本中我放置了维护正确所需的每个操作存储库(我将它用于 svn 和git 存储库)。Personnally, I use 2 methods :
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).只是一个想法,但您可以根据提交消息中的模式触发,
以通过 挂钩
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
对于每个开发人员需要进行本地更改的文件(例如数据库连接字符串等),我喜欢将模板保留为跟踪文件,例如
localconfig.template
。在您的构建/启动脚本中,您可以具有如下逻辑: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: