static char pretty_header[16384];
pretty_print_commit(commit_format, commit->buffer, ~0, pretty_header, sizeof(pretty_header));
printf("%s%c", pretty_header, hdr_termination);
- }
+ }
+ fflush(stdout);
}
static int filter_commit(struct commit * commit)
int main(int argc, char **argv)
{
struct commit_list *list = NULL;
+ struct commit_list *(*insert)(struct commit *, struct commit_list **);
int i, limited = 0;
+ insert = insert_by_date;
for (i = 1 ; i < argc; i++) {
int flags;
char *arg = argv[i];
limited = 1;
continue;
}
- if (!strncmp(arg, "--merge-order", 13)) {
+ if (!strcmp(arg, "--merge-order")) {
merge_order = 1;
+ insert = commit_list_insert;
continue;
}
- if (!strncmp(arg, "--show-breaks", 13)) {
+ if (!strcmp(arg, "--show-breaks")) {
show_breaks = 1;
continue;
}
commit = get_commit_reference(arg, flags);
if (!commit)
continue;
- commit_list_insert(commit, &list);
+ insert(commit, &list);
}
if (!merge_order) {