@staticmethod
    def fromphase(phase):
        """Factory method to return an appropriate input parser
        For example if the phase is 'post-update' and that the git env
        variables are set, we infer that we need a git postupdate
        inputparser"""
        phasemapping = {
            None: dummyinputparser,
            'applypatch-msg': applypatchmsginputparser,
            'pre-applypatch': preapplypatchinputparser,
            'post-applypatch': postapplypatchinputparser,
            'pre-commit': precommitinputparser,
            'prepare-commit-msg': preparecommitmsginputparser,
            'commit-msg': commitmsginputparser,
            'post-commit': postcommitinputparser,
            'pre-rebase': prerebaseinputparser,
            'pre-push': prepushinputparser,
            'pre-receive': prereceiveinputparser,
            'update': updateinputparser,
            'post-receive': postreceiveinputparser,
            'post-update': postupdateinputparser,
            'pre-auto-gc': preautogcinputparser,
        }
        try:
            return phasemapping[phase].findscm()
        except __HOLE__:
            raise NotImplementedError("Unsupported hook type %s" % phase)
dataset/ETHPy150Open charignon/hooklib/hooklib_input.py/inputparser.fromphase