Try to find which version control system contains the cwd directory.

        Returns the VersionControl superclass e.g. Git, if none were
        found this will raise a NotImplementedError.

def which(cwd=None):  # pragma: no cover
        """Try to find which version control system contains the cwd directory.

        Returns the VersionControl superclass e.g. Git, if none were
        found this will raise a NotImplementedError.

        """
        if cwd is None:
            cwd = os.getcwd()
        for (k, using_vc) in globals().items():
            if k.startswith('using_') and using_vc(cwd=cwd):
                return VersionControl.from_string(k[6:])

        # Not supported (yet)
        raise NotImplementedError("Unknown version control system, "
                                  "or you're not in the project directory.")