def generate_desc(from_commit, to_commit, changelog):
 if from_commit.startswith(to_commit):
  desc = 'Pushing {0} again'.format(to_commit)
 else:
  bugs = extract_bugs(changelog.split('\n'))
  if bugs:
   bugs = ['bug #{0}'.format(bug) for bug in bugs]
   desc = 'Fixing: {0}'.format(', '.join(bugs))
  else:
   desc = get_random_desc()
 return desc

def generate_desc ( from_commit , to_commit , changelog ) : if from_commit . startswith ( to_commit ) : desc = 'Pushing {0} again' . format ( to_commit ) else : bugs = extract_bugs ( changelog . split ( '\n' ) ) if bugs : bugs = [ 'bug #{0}' . format ( bug ) for bug in bugs ] desc = 'Fixing: {0}' . format ( ', ' . join ( bugs ) ) else : desc = get_random_desc ( ) return desc
figures out a good description based on what were pushing out .