How to get all SVN commits that do not include Jira bug key in the comment?

你离开我真会死。 提交于 2019-12-12 09:39:47

问题


I have Jira and Fisheye setup so that I can include Jira key in the commit comment (Smart Commits). Fisheye will link source code and Jira issue mentioned in the commit.

I would not like to use something like JIRA Commit Acceptance Plugin to decline commits without Jira keys. As it is too restrictive. But would still like to monitor commits without Jira keys.

How to get a report of all SVN commits that do not include Jira bug Key in the comment?


回答1:


You can run following command on UNIX in the directory with your working copy:

svn log | grep -v '\--' | awk 'ORS=(NR%3)?" ":"\n"' | grep -v "[ISSUE_PREFIX]"

where [ISSUE_PREFIX] is your JIRA issue prefix. For example, JPA for such issues as JPA-123.

It will have following output:

r33 | user3 | 2011-12-21 16:29:29 +0200 (Wed, 21 Dec 2011) | 1 line  Third commit log without JIRA key
r22 | user2 | 2011-12-21 16:28:19 +0200 (Wed, 21 Dec 2011) | 1 line  Second commit log without JIRA key
r11 | user1 | 2011-12-21 16:27:18 +0200 (Wed, 21 Dec 2011) | 1 line  First commit log without JIRA key


来源:https://stackoverflow.com/questions/9170571/how-to-get-all-svn-commits-that-do-not-include-jira-bug-key-in-the-comment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!