On Mon, Jun 09, 2008 at 04:20:10PM -0700, Junio C Hamano wrote: > > struct commit_list list = { two, NULL }; > > > > merge_bases_many(one, &list); > > But (1) that is not what f755fb6 does; it does commit_list_insert() that > has an allocation, and (2) how much work is to count, allocate and pass > array for slow and less frequent codepath which octopus-merge-base is? If (1) is the only problem, I can do it the way Dscho suggested, but I don't exactly see why using a commit_list* can slow merge_bases() down: for (i = 0; i < n; i++) { ... } is probably as fast as for (i = list; i; i = i->next) { ... } in case n = 0 / list->next is NULL.