Re: [PATCH 08/10] Introduce commit_list_append() in commit.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 7, 2008, 00:14 UTC
- Message-ID
- <7viqwmqexg.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080606235239.GY29404@genesis.frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
Show 8 quoted lines
> On Thu, Jun 05, 2008 at 04:16:46PM -0700, Junio C Hamano <gitster@pobox.com> 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.