import re


def get_cherry_picked_commits(msg):
    """ Get set of commits that were cherrypicked for this commit"""
    picks = set()
    lines = msg.split('\n')
    for line in lines:
        m = re.match('.*\(cherry picked from commit ([0-9a-f]+)\).*', line, flags=re.IGNORECASE)
        if m:
            sha = m.group(1)
            picks.add(sha)

    return picks