From: Jeff King Date: Wed, 29 Aug 2012 21:00:32 GMT Subject: Re: [PATCH 2/2] commit: use a priority queue in merge base functions Message-ID: <20120829210032.GA29179@sigill.intra.peff.net> In-Reply-To: <20120829205525.GA28696@sigill.intra.peff.net> On Wed, Aug 29, 2012 at 04:55:25PM -0400, Jeff King wrote: > On Wed, Aug 29, 2012 at 04:53:32PM -0400, Jeff King wrote: > > > > Thanks. This seems to break t6010-merge-base.sh for me, though... > > > > Interesting. It works fine here, even under --valgrind. Did you apply > > the patches directly on top of 1251cc7? > > Hmm, this does seem to break t6024 for me, though. Probably because: > /* Clean up the result to remove stale ones */ > - free_commit_list(list); > - list = result; result = NULL; > - while (list) { > - struct commit_list *next = list->next; > - if (!(list->item->object.flags & STALE)) > - commit_list_insert_by_date(list->item, &result); > - free(list); > - list = next; > - } > - return result; > + while (result.nr) > + commit_list_append(queue_pop(&result), &tail); > + queue_clear(&result); > + queue_clear(&list); > + return ret; I forgot to to port the STALE flag handling here. -Peff