def get_parentdirs(path):
    """Generate a list of all parent directories for a path.

    :param path: Path to find parent directories for.
    :return: List of all parent directories for the path (including the path).
    """
    # Split path into a list for each level
    path_split = [x + '/' for x in path.split('/')[:-1]]

    # Build up all parent directories and return as a list
    parentdirs = []
    for path in path_split[1:]:
        parentdirs.append(''.join(path_split))
        path_split = path_split[:-1]

    return parentdirs