如何创建 SVN 提交消息模板和挂钩以进行验证
我使用 Visual SVN Server 和 Tortoise SVN(客户端)进行源代码控制。 我希望所有开发人员能够标准化签入注释的一致格式。
例如,我希望他们的提交消息默认为...
概要:
开发人员名称:(预先填充)
审核者:
[Bug Id]:
[更改 Bug 状态]:
已知问题:
受影响的文件: (预先填充)
将来,我希望 [Bug Id] 和 [Bug State] 提供信息以触发 Bug 跟踪系统的自动更新。 此外,开发人员名称和受影响的文件应预先填充 svn 用户和用户提交的文件。
请发送您可能拥有的任何链接或样本。
I'm using Visual SVN Server and Tortoise SVN (client) for source control. I would like all developers to standardize on a consistent format for checkin notes.
For Example I want their Commit Message to default to...
Synopsis:
Developer Name: (pre-populated)
Reviewed By:
[Bug Id]:
[Change Bug State]:
Known Issues:
Affected Files: (pre-populated)
In the future I'd like [Bug Id] and [Bug State] to supply the information to trigger an automated update to the Bug Tracking system. Also Developer Name and Affected Files should be prepopulated with the svn user and files that the user is commiting.
Please send any links or samples you may have.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现它使用:
文件夹右键-> 属性-> 新... -> 高级-> 属性名称:tsvn:logtemplate -> 输入属性值 -> 好的-> 好的。
I found it using:
Folder right-click -> Properties -> New... -> Advanced -> Property name: tsvn:logtemplate -> enter a Property value -> OK -> OK.
取自 如何创建 Tortoise SVN 签入模板(已修改以适应最新版本):
Taken from How to create a Tortoise SVN Checkin Template (modified to fit to more current versions):
使用命令行执行此操作的一种方法是更改 SVN_EDITOR 环境变量,如下所述:
http://svn.haxx.se/dev/archive-2006-02/0487.shtml
A way to do this with the command line is to change the SVN_EDITOR environment variable, described here:
http://svn.haxx.se/dev/archive-2006-02/0487.shtml
或者,为了进一步方便 SVN_EDITOR (例如,在必须使用 SvnBridge 的情况下正确链接到 TFS 工作项),可以将以下脚本存储为 ~/bin/svn_editor :
然后只需
在 ~/.bashrc 或类似的目录中 执行。
即使从 Firefox TFS Web 界面中查看的当前工作项页面也能保持工作项编号文件更新的奖励积分(我认为可能有一种方法与 Firefox 通信以获取页面标题等)。
或者只是让此脚本启动第一个初始编辑器在持久工作项文件上运行,然后让它在自定义提交模板上运行第二个编辑器。
Or, for further SVN_EDITOR comfort (e.g. properly linking to the TFS work item in the case of having to use SvnBridge), one could store the following script as ~/bin/svn_editor :
and then simply do
in ~/.bashrc or some such.
Bonus points for keeping the work item number file updated even from the current work item page as viewed in Firefox TFS web interface (I think there possibly is a way to communicate with Firefox to get page titles etc.).
Or simply have this script start a first initial editor run on the persistent work item file and then let it do the second editor run on the customized commit template.