X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Frev-list.c;h=158ce1111af12db1445d82cfa5728bc19837570d;hb=385cc9d8c44eb5be9d57e630129752a72c0a08c8;hp=51ceb19d88918445c90eccc37f1fe5f90cedd385;hpb=e1ba0f6340c1d72677c7792a0a82ecf05363026e;p=git.git diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 51ceb19d8..158ce1111 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -11,9 +11,9 @@ static const char rev_list_usage[] = "git rev-list [OPTION] ... [ -- paths... ]\n" " limiting output:\n" -" --max-count=nr\n" -" --max-age=epoch\n" -" --min-age=epoch\n" +" --max-count=\n" +" --max-age=\n" +" --min-age=\n" " --sparse\n" " --no-merges\n" " --remove-empty\n" @@ -33,7 +33,7 @@ static const char rev_list_usage[] = " --objects | --objects-edge\n" " --unpacked\n" " --header | --pretty\n" -" --abbrev=nr | --no-abbrev\n" +" --abbrev= | --no-abbrev\n" " --abbrev-commit\n" " --left-right\n" " special purpose:\n" @@ -50,6 +50,15 @@ static void show_commit(struct commit *commit, void *data) graph_show_commit(revs->graph); + if (revs->count) { + if (commit->object.flags & SYMMETRIC_LEFT) + revs->count_left++; + else + revs->count_right++; + finish_commit(commit, data); + return; + } + if (info->show_timestamp) printf("%lu ", commit->date); if (info->header_prefix) @@ -400,5 +409,12 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) quiet ? finish_object : show_object, &info); + if (revs.count) { + if (revs.left_right) + printf("%d\t%d\n", revs.count_left, revs.count_right); + else + printf("%d\n", revs.count_left + revs.count_right); + } + return 0; }