<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_hooklist(self, hooklist, msg):
 """ Encodes a list of commit hooks into their protobuf equivalent. Used in bucket properties. :param hooklist: a list of commit hooks :type hooklist: list :param msg: a protobuf field that is a list of commit hooks """

        for hook in hooklist:
            pbhook = msg.add()
            self.encode_hook(hook, pbhook)