def METHOD_NAME(commit_id='HEAD', directory=None, date_format=None):
    """Returns metadata for the specified commit.
    :param commit_id: Commit id, by default HEAD is used.
    :param directory: Repository directory.
    :param date_format: Date format. Valid values are:
        relative, local, iso, iso-strict, rfc, short, raw, unix,
        format:...
    :returns: Commit metadata (e.g. sha, author, comitter, message, etc.)
    :rtype: dict
    """
    log_format = '%x1f'.join(v[1] for v in _LOG_FORMAT)
    cmd = ['git', 'log', '-1', '--format=' + log_format]
    if date_format:
        cmd.append('--date=' + date_format)
    cmd.append(commit_id)
    # TODO(cutwater): Replace `.decode('utf-8')` call with subprocess
    # parameter `encoding` after dropping Python 2.7 support.
    values = (subprocess.check_output(cmd, cwd=directory).decode('utf-8')
              .strip().split('\x1f'))
    return dict(zip((v[0] for v in _LOG_FORMAT), values))