| 140 | } |
| 141 | |
| 142 | static void show_list(const char *debug, int counted, int nr, |
| 143 | struct commit_list *list) |
| 144 | { |
| 145 | struct commit_list *p; |
| 146 | |
| 147 | if (!DEBUG_BISECT) |
| 148 | return; |
| 149 | |
| 150 | fprintf(stderr, "%s (%d/%d)\n", debug, counted, nr); |
| 151 | |
| 152 | for (p = list; p; p = p->next) { |
| 153 | struct commit_list *pp; |
| 154 | struct commit *commit = p->item; |
| 155 | unsigned commit_flags = commit->object.flags; |
| 156 | enum object_type type; |
| 157 | size_t size; |
| 158 | char *buf = odb_read_object(the_repository->objects, |
| 159 | &commit->object.oid, &type, |
| 160 | &size); |
| 161 | const char *subject_start; |
| 162 | int subject_len; |
| 163 | |
| 164 | if (!buf) |
| 165 | die(_("unable to read %s"), oid_to_hex(&commit->object.oid)); |
| 166 | |
| 167 | fprintf(stderr, "%c%c%c ", |
| 168 | (commit_flags & TREESAME) ? ' ' : 'T', |
| 169 | (commit_flags & UNINTERESTING) ? 'U' : ' ', |
| 170 | (commit_flags & COUNTED) ? 'C' : ' '); |
| 171 | if (*commit_weight_at(&commit_weight, p->item)) |
| 172 | fprintf(stderr, "%3d", weight(p)); |
| 173 | else |
| 174 | fprintf(stderr, "---"); |
| 175 | fprintf(stderr, " %.*s", 8, oid_to_hex(&commit->object.oid)); |
| 176 | for (pp = commit->parents; pp; pp = pp->next) |
| 177 | fprintf(stderr, " %.*s", 8, |
| 178 | oid_to_hex(&pp->item->object.oid)); |
| 179 | |
| 180 | subject_len = find_commit_subject(buf, &subject_start); |
| 181 | if (subject_len) |
| 182 | fprintf(stderr, " %.*s", subject_len, subject_start); |
| 183 | fprintf(stderr, "\n"); |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | static struct commit_list *best_bisection(struct commit_list *list, int nr) |
| 188 | { |
no test coverage detected