int prepare_revision_walk(struct rev_info *revs) { int nr = revs->pending.nr; struct object_array_entry *e, *list; e = list = revs->pending.objects; revs->pending.nr = 0; revs->pending.alloc = 0; revs->pending.objects = NULL; while (--nr >= 0) { struct commit *commit = handle_commit(revs, e->item, e->name); if (commit) { if (!(commit->object.flags & SEEN)) { commit->object.flags |= SEEN; insert_by_date(commit, &revs->commits); } } e++; } free(list); if (revs->no_walk) return 0; if (revs->limited) if (limit_list(revs) < 0) return -1; if (revs->topo_order) sort_in_topological_order(&revs->commits, revs->lifo); if (revs->simplify_merges) simplify_merges(revs); if (revs->children.name) set_children(revs); return 0; }
static void handle_tail(struct object_array *commits, struct rev_info *revs) { struct commit *commit; while (commits->nr) { commit = (struct commit *)commits->objects[commits->nr - 1].item; if (has_unshown_parent(commit)) return; handle_commit(commit, revs); commits->nr--; } }
static void handle_tail(struct object_array *commits, struct rev_info *revs, struct string_list *paths_of_changed_objects) { struct commit *commit; while (commits->nr) { commit = (struct commit *)object_array_pop(commits); if (has_unshown_parent(commit)) { /* Queue again, to be handled later */ add_object_array(&commit->object, NULL, commits); return; } handle_commit(commit, revs, paths_of_changed_objects); } }