def morph_name(file_path, common_prefix):
    """
    Returns a unique name by finding the unique part of a file's path and
    combining it into a hyphen separated file name
    """
    unique_part = file_path.replace(common_prefix, "")
    dir_levels = unique_part.count("/")
    if dir_levels == 0:
        new_name = unique_part
    else:
        # Common prefix may have split a directory name, so derive the new name
        # from the original path instead to ensure full names are used
        new_name = "-".join(file_path.split("/")[-(dir_levels + 1) :])
    return new_name