X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=rev-list.c;h=523fda07e1eef4b3a1a801abbf94358d06af17fd;hb=7626e49e9f04ac386965d16ae11e130e20ebd518;hp=c55e912be4faa81a70c9cc27ef44d72a74d49a41;hpb=8805ccac40348094d26b3b892c6ca3d08dc12ae0;p=git.git diff --git a/rev-list.c b/rev-list.c index c55e912b..523fda07 100644 --- a/rev-list.c +++ b/rev-list.c @@ -86,7 +86,7 @@ static int filter_commit(struct commit * commit) return CONTINUE; if (max_age != -1 && (commit->date < max_age)) { stop_traversal=1; - return merge_order?CONTINUE:STOP; + return CONTINUE; } if (max_count != -1 && !max_count--) return STOP; @@ -374,6 +374,8 @@ static struct commit_list *limit_list(struct commit_list *list) struct commit *commit = pop_most_recent_commit(&list, SEEN); struct object *obj = &commit->object; + if (max_age != -1 && (commit->date < max_age)) + obj->flags |= UNINTERESTING; if (unpacked && has_sha1_pack(obj->sha1)) obj->flags |= UNINTERESTING; if (obj->flags & UNINTERESTING) { @@ -382,6 +384,8 @@ static struct commit_list *limit_list(struct commit_list *list) break; continue; } + if (min_age != -1 && (commit->date > min_age)) + continue; p = &commit_list_insert(commit, p)->next; } if (tree_objects) @@ -494,10 +498,12 @@ int main(int argc, char **argv) } if (!strncmp(arg, "--max-age=", 10)) { max_age = atoi(arg + 10); + limited = 1; continue; } if (!strncmp(arg, "--min-age=", 10)) { min_age = atoi(arg + 10); + limited = 1; continue; } if (!strcmp(arg, "--header")) { @@ -561,6 +567,8 @@ int main(int argc, char **argv) struct commit *exclude = NULL; struct commit *include = NULL; *dotdot = 0; + if (!*next) + next = "HEAD"; exclude = get_commit_reference(arg, UNINTERESTING); include = get_commit_reference(next, 0); if (exclude && include) { @@ -569,7 +577,7 @@ int main(int argc, char **argv) handle_one_commit(include, &list); continue; } - *next = '.'; + *dotdot = '.'; } if (*arg == '^') { flags = UNINTERESTING;