PHP 扩展以忽略 SVN 冲突
我确信我不是唯一一个在回家之前尝试将最新代码更改从 SVN 切换到实时服务器,却发现某些笨蛋直接在服务器上修改文件的人。服务器上,现在您有五个 PHP 脚本被标记为冲突,网站宕机,并且您因晚餐迟到而被妻子吼叫因为您必须手动解决所有冲突,因为回滚是不可能。
我认为如果有一个 PHP 扩展在遇到冲突文件时不会因意外 T_SL 的解析错误而死掉,而是仅使用工作副本版本来解析它,那就太棒了每一次冲突。
<<<<<<< .mine
changes_my_stupid_coworker_made(); // This would be executed
=======
my_important_changes(); // This would NOT be executed
>>>>>>> .r9
是否有这样的扩展或用户可以达到类似效果的东西?
I'm sure I'm not the only one who has tried to switch
the latest code changes to the live server from SVN just before heading home, only to find that some blockhead has modified files directly on the server and now you have five PHP scripts marked as conflicted, the site is down and you get yelled at by your wife for being late for dinner because you had to resolve all the conflicts manually because a rollback is out of the question.
I think it would be awesome if there was an extension for PHP that wouldn't die with a parse error for unexpected T_SL
when encountering a conflicted file, but would instead parse it using only the working copy version of every conflict.
<<<<<<< .mine
changes_my_stupid_coworker_made(); // This would be executed
=======
my_important_changes(); // This would NOT be executed
>>>>>>> .r9
Is there such an extension or something that can be user for similar effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这确实是解决问题的最糟糕的方法。
如果人们无法正常工作,就不要再让他们工作了。
This would really be the worst way of fixing the problem.
If people just can't work correctly, don't let them work anymore.
尝试更新实时环境,强制其满载,仍然会导致问题(请参阅之前的评论),但这可以防止发生冲突。从那时起,您就可以不必对版本控制之外的实时环境进行更改。
。
我们确保所有开发人员都有一种更新实时环境的方法,无论它是否非常严格 我们无法在实时服务器上通过命令行进行更新,但是我们在服务器上有一个中央脚本,我们可以在其上配置项目,然后我们可以通过该脚本发出更新命令。然后,该脚本将首先进行比较,检查冲突,如果没有问题则进行更新,并向负责该项目的多人和团队负责人发送一封包含 cmd 输出的电子邮件。
它非常整洁,可以防止严重的混乱和深夜。
Try updating the live environment forcing theirs-full, can still cause problems (see previous comment) but that prevents conflicts from happening. From there on you can work on not having to make changes to a live environment outside of version control.
Out the top of my head
We made sure all developers have a way to update a live environment, be it very strict. We can't update through command line on live servers, but we have a central script on a server on which we can configure projects on it, then we can give update commands through the script. The script will then do a diff first, checking conflicts and update if nothing is wrong and it sends multiple people and a teamlead responsible for the project an email with the cmd output.
It's pretty neat, prevents terrible screw-ups and really late nights.