def _get_changed_docs(self,
                          ancestral_commit_sha,
                          doc_id_from_repo_path,
                          doc_ids_to_check=None):
        """Returns the set of documents that have changed on the master since
        commit `ancestral_commit_sha` or `False` (on an error)

        'doc_id_from_repo_path' is a required function

        if `doc_ids_to_check` is passed in, it should be an iterable list of
            IDs. Only IDs in this list will be returned.
        """
        try:
            x = git(self.gitdir,
                    self.gitwd,
                    "diff-tree",
                    "--name-only",
                    "-r",
                    ancestral_commit_sha,
                    "master")
        except:
            _LOG.exception('diff-tree failed')
            return False
        touched = set()
        for f in x.split('\n'):
            found_id = doc_id_from_repo_path(f)
            if found_id:
                touched.add(found_id)

        if doc_ids_to_check:
            tc = set(doc_ids_to_check)
            return tc.intersection(touched)
        return touched