X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=revision.c;h=7e82efd9324e84582732485c53c6c25a24c29997;hb=dd1e5b313a0aef5d22cd9909c14e4b1b6dcbea79;hp=96d7fa7f143b8680fe638e1ea69f4ec172fcedad;hpb=cb7529e13bce186f8b883c9fbb08602cd3a0795f;p=git.git diff --git a/revision.c b/revision.c index 96d7fa7f1..7e82efd93 100644 --- a/revision.c +++ b/revision.c @@ -1162,18 +1162,22 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg if (!prefixcmp(arg, "--max-count=")) { revs->max_count = atoi(arg + 12); + revs->no_walk = 0; } else if (!prefixcmp(arg, "--skip=")) { revs->skip_count = atoi(arg + 7); } else if ((*arg == '-') && isdigit(arg[1])) { /* accept -, like traditional "head" */ revs->max_count = atoi(arg + 1); + revs->no_walk = 0; } else if (!strcmp(arg, "-n")) { if (argc <= 1) return error("-n requires an argument"); revs->max_count = atoi(argv[1]); + revs->no_walk = 0; return 2; } else if (!prefixcmp(arg, "-n")) { revs->max_count = atoi(arg + 2); + revs->no_walk = 0; } else if (!prefixcmp(arg, "--max-age=")) { revs->max_age = atoi(arg + 10); } else if (!prefixcmp(arg, "--since=")) { @@ -1249,6 +1253,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->boundary = 1; } else if (!strcmp(arg, "--left-right")) { revs->left_right = 1; + } else if (!strcmp(arg, "--count")) { + revs->count = 1; } else if (!strcmp(arg, "--cherry-pick")) { revs->cherry_pick = 1; revs->limited = 1; @@ -1308,8 +1314,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg else strbuf_addstr(&buf, "refs/notes/"); strbuf_addstr(&buf, arg+13); - string_list_append(strbuf_detach(&buf, NULL), - revs->notes_opt.extra_notes_refs); + string_list_append(revs->notes_opt.extra_notes_refs, + strbuf_detach(&buf, NULL)); } else if (!strcmp(arg, "--no-notes")) { revs->show_notes = 0; revs->show_notes_given = 1; @@ -1884,7 +1890,7 @@ int prepare_revision_walk(struct rev_info *revs) enum rewrite_result { rewrite_one_ok, rewrite_one_noparents, - rewrite_one_error, + rewrite_one_error }; static enum rewrite_result rewrite_one(struct rev_info *revs, struct commit **pp)