<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def commit(self):
        '''
        Writes the current provenance stack to storage if it wasn't already there and returns it

        Returns (Tuple[bool, str, List[]]):
            Whether the stack was not cached, the iden of the prov stack, and the provstack
        '''
        providen, provstack = get()
        wasnew = (providen is None)
        if wasnew:
            providen = self.getProvIden(provstack)
            setiden(providen)
        return wasnew, s_common.ehex(providen), provstack