From: Junio C Hamano Date: Sat, 07 Jun 2008 00:14:35 GMT Subject: Re: [PATCH 08/10] Introduce commit_list_append() in commit.c Message-ID: <7viqwmqexg.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080606235239.GY29404@genesis.frugalware.org> Miklos Vajna writes: > On Thu, Jun 05, 2008 at 04:16:46PM -0700, Junio C Hamano wrote: >> Do you have a caller of this function that keeps a pointer to commit_list >> that needs to be appended at the tail or inserted at the beginning >> depending on the phase of the moon, or does the caller always append to >> that list? > > The later. I use it for appending a new parent for the merge commit and > after parsing a new remote head. In both cases I always append a list. If that is the case, you might want to check how parse_commit_buffer() in commit.c builds "parents" list. It is a standard pattern to append to the list using commit_list_insert() and that is the reason why it returns a pointer.