def write_git_changelog():
 new_changelog = 'ChangeLog'
 git_dir = _get_git_directory()
 if (not os.getenv('SKIP_WRITE_GIT_CHANGELOG')):
  if git_dir:
   git_log_cmd = ('git --git-dir=%s log' % git_dir)
   changelog = _run_shell_command(git_log_cmd)
   mailmap = _parse_git_mailmap(git_dir)
   with open(new_changelog, 'w') as changelog_file:
    changelog_file.write(canonicalize_emails(changelog, mailmap))
 else:
  open(new_changelog, 'w').close()

def write_git_changelog ( ) : new_changelog = 'ChangeLog' git_dir = _get_git_directory ( ) if ( not os . getenv ( 'SKIP_WRITE_GIT_CHANGELOG' ) ) : if git_dir : git_log_cmd = ( 'git --git-dir=%s log' % git_dir ) changelog = _run_shell_command ( git_log_cmd ) mailmap = _parse_git_mailmap ( git_dir ) with open ( new_changelog , 'w' ) as changelog_file : changelog_file . write ( canonicalize_emails ( changelog , mailmap ) ) else : open ( new_changelog , 'w' ) . close ( )
write a changelog based on the git changelog .