3

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?

Jordan Dea-Mattson
  • 5,791
  • 5
  • 38
  • 53
Daria Trainor
  • 5,545
  • 4
  • 23
  • 30
  • Would creating a post-commit hook that looks at the `svn:log` revision property of a revision, and email you (or someone who's interested) if there's no Jira ticket number in the commit comment be good enough? – David W. Feb 07 '12 at 20:55
  • David, yes that would be another good solution. Thank you. – Daria Trainor Feb 07 '12 at 21:42
  • And if you want to get fancy you can convert the regex that JIRA defines as an issue key to an Emacs regexp. – mdoar Feb 10 '12 at 23:10

1 Answers1

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
altern
  • 5,829
  • 5
  • 44
  • 72