{"id":56,"date":"2014-03-31T01:43:11","date_gmt":"2014-03-31T01:43:11","guid":{"rendered":"http:\/\/blog.catalystlogic.com.au\/?p=56"},"modified":"2026-03-01T01:44:18","modified_gmt":"2026-02-28T14:44:18","slug":"slack-collaboration-with-visual-svn-integration-via-commit-hooks-a-perl-script","status":"publish","type":"post","link":"http:\/\/54.253.247.134\/?p=56","title":{"rendered":"Slack Collaboration with Visual SVN Integration via Commit Hooks &#038; a Perl script"},"content":{"rendered":"<h3>Finding a Suitable Collaborative Chat Tool<\/h3>\n<p>After trying <a href=\"http:\/\/www.campfirenow.com\">Campfire<\/a>, <a href=\"https:\/\/www.bitrix24.com\/\u200e\">Bitrix24 <\/a>and <a href=\"https:\/\/www.hipchat.com\/\u200e\">HipChat<\/a>, I finally settled on Slack as my preference for a collaboration tool for our team.<\/p>\n<p>Campfire was very bare bones, and the various window client options just didn't do it for me.<\/p>\n<p>Hipchat had huge potential, though when i get into it, most of the features I wanted where not in the software, but on their <a href=\"http:\/\/help.hipchat.com\/forums\/138883-suggestions-issues\">suggestions page<\/a>. Some with hundreds of votes but no reply.<\/p>\n<p>Bitrix was close, but is a whole intranet in the cloud so was a bit of overkill. I only needed the chat. and it does that ok, though didn't have the IRC like room set up I was after.<\/p>\n<h3>Slack<\/h3>\n<p>Slack was everything I was after. I was a bit critical when the instructions for the windows client consisted of how to turn the webpage into a chrome application shortcut. I originally wanted something that would give the taskbar a notify glow (not a blink as some clients did) so the dev's new that there was a conversation going on, but not annoying enough ot break them out of the zone if there were not participating.<\/p>\n<p>A quick search confirmed that neither a script, or extension that would glow the task bar, though the use of notifications would likely do the job, if not a bit more distracting than I would like.<\/p>\n<p>The chat, room and search features were everything I wanted, but the real power cam via the <a href=\"https:\/\/slack.com\/integrations\">integration <\/a>tools.<\/p>\n<p>In a few clicks a Jira channel was showing new &amp; closed tickets from my on premises install. Though I was sure to vote for confluence integration in their\u00a0<a href=\"https:\/\/www.surveyplanet.com\/survey\/dcac34f0db8a7327de1c380d61894791\">integration feedback survey<\/a>, as that was not out of the box,. though likely not difficult to craft my own.<\/p>\n<h3>SVN Integration<\/h3>\n<p>Next was SVN, this was a bit trickier as the instructions for integration was a <a href=\"https:\/\/github.com\/tinyspeck\/services-examples\/blob\/master\/subversion.pl\">perl script on github<\/a>.<\/p>\n<p>The next challenge was that I was not suing SVN on a linux box,. but SVN server in windows. This meant that Visual SVN called a batch file, passed in the repository name and revision as arguments, which needed that to fire the Perlscript.<\/p>\n<p>First of all, I needed Perl. and grabbed a download of <a href=\"http:\/\/www.activestate.com\/activeperl\/downloads\">Active State Perl<\/a><\/p>\n<p>Next, triggering the script via Visual SVN.<\/p>\n<p>Right clicking on the repository in Visual SVN, then <strong>Properties<\/strong> then the <strong>Hooks<\/strong> tab brought up a window, where i could <strong>Edit<\/strong> the <strong>Post-commit hook<\/strong>.<\/p>\n<p>Here I entered the DOS command to fire my batch file.<\/p>\n<pre class=\"toolbar:2 lang:default highlight:0 decode:true\">c:\ncd\\Program Files (x86)\\VisualSVN Server\\bin\\\nhook %1 %2<\/pre>\n<p>Next I created hook.bat and placed it in the folder above. This woulds take the 2 args and pass it to the PERL script.<\/p>\n<pre class=\"toolbar:2 lang:default highlight:0 decode:true\">\"C:\\Perl\\bin\\perl.exe\" \"C:\\Program Files (x86)\\VisualSVN Server\\bin\\svn.pl\" %1 %2<\/pre>\n<p>With the plumbing ot the Perl script out of the way,\u00a0I modified the PERL script to run on windows, which involved changing the linux friendly...<\/p>\n<pre class=\"toolbar:2 lang:perl decode:true\">my $log = `\/usr\/bin\/svnlook log -r $ARGV[1] $ARGV[0]`;\nmy $who = `\/usr\/bin\/svnlook author -r $ARGV[1] $ARGV[0]`;<\/pre>\n<p>To the more windows command line friendly...<\/p>\n<pre class=\"toolbar:2 lang:perl decode:true crayon-selected\">my $log = `svnlook log -r $ARGV[1] $ARGV[0]`;\nmy $who = `svnlook author -r $ARGV[1] $ARGV[0]`;<\/pre>\n<p>&nbsp;<\/p>\n<p>After testing by firing my bat file manually, and a few SVN commits, I had all my SVN updates posted to their own channel in Slack.<\/p>\n<p><span style=\"font-size: 1rem; line-height: 1.8;\">Confluence is next, so that updates and new pages can go into\u00a0<\/span>their<span style=\"font-size: 1rem; line-height: 1.8;\">\u00a0own channel too.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finding a Suitable Collaborative Chat Tool After trying Campfire, Bitrix24 and HipChat, I finally settled on Slack as my preference for a collaboration tool for our team. Campfire was very bare bones, and the various window client options just didn't do it for me. Hipchat had huge potential, though when i get into it, most <a class=\"read-more\" href=\"http:\/\/54.253.247.134\/?p=56\">...continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,17],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-perl","category-svn"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56"}],"version-history":[{"count":1,"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":239,"href":"http:\/\/54.253.247.134\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions\/239"}],"wp:attachment":[{"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/54.253.247.134\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}