kmartin has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I am trying to take a log from Subversion and extract all the JIRA issue tags in the commit messages. I would have thought this would be a common task but I can't seem to find anyone else who's done this. I've got something that works for one issue, but it's where there are multiples that I'm stuck. Here is what I have so far
But that doesn't get the 2nd or more when they're in the same line. ie. BACKLOG-123, BACKLOG-124, BACKLOG-125 only returns the first result. Thanks in advance.my @logs = `svn log $url -r $oldRev:$currRev`; my @tickets; foreach $log(@logs) { chomp $log; print "$log\n"; $log =~ /([A-Z]+-\d+)/; push(@tickets, $1); } my %hash = map{$_, 1} @tickets; my @master_tickets = keys %hash; my @sorted = sort @master_tickets; foreach $ticket(@sorted) { print ("$ticket\n"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Grepping SVN log for JIRA issues
by toolic (Bishop) on Feb 22, 2011 at 18:49 UTC | |
by kmartin (Initiate) on Feb 22, 2011 at 18:57 UTC | |
by happy.barney (Friar) on Feb 22, 2011 at 19:58 UTC | |
Re: Grepping SVN log for JIRA issues
by Fletch (Bishop) on Feb 22, 2011 at 19:35 UTC | |
Re: Grepping SVN log for JIRA issues
by dHarry (Abbot) on Feb 23, 2011 at 13:24 UTC |
Back to
Seekers of Perl Wisdom