def METHOD_NAME(sha):
  cmd = ['git', 'log', '-1', '--format=%s', sha]
  proc = subprocess.Popen(" ".join(cmd), stdin = subprocess.PIPE, stdout = subprocess.PIPE, shell=True)
  commitMessage = proc.communicate()[0].decode("utf-8").strip()
  if len(commitMessage) == 0:
    sys.exit("Could not find info for commit " + sha)
  # If commit message contains multiple PR links (in case of backports), remove the earlier one
  pattern = " \(#\d+\)"
  if len(re.findall(pattern, commitMessage)) > 1:
    commitMessage = re.sub(pattern, "", commitMessage, 1)
  return commitMessage