Skip to content

Instantly share code, notes, and snippets.

@smirn0v
Created November 6, 2015 16:45
Show Gist options
  • Save smirn0v/cfb3110b8ec14fa2c49c to your computer and use it in GitHub Desktop.
Save smirn0v/cfb3110b8ec14fa2c49c to your computer and use it in GitHub Desktop.
Affected tasks
#!/usr/bin/env ruby
require 'set'
require_relative 'issue-tracking'
files = `git log --name-only --oneline HEAD^..HEAD | tail -n+2`.split("\n")
head_hash = `git rev-parse HEAD`
tasks_affected=Set.new
files.each{|f|
affected = `git log --follow --format="%H" --since="3 weeks ago" "#{f}"`.split("\n")
affected.each{|sha|
unless sha==head_hash then
task = `git show -s --format=%B #{sha}`[/(IOSMAIL-\d+):/,1]
unless task == nil then
tasks_affected.add(task)
end
end
}
}
if tasks_affected.size > 0 then
qa_notification="За последние 3 недели те же файлы, что и в этой задаче менялись в рамках следующих задач:\n"
tasks_affected.each {|task|
qa_notification+="#{task}: #{IOSMail::IssueTracking.instance.get_summary(task)}\n"
}
print qa_notification
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment