X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Frev-list.c;h=efe9360e2fdb9aac3bae0c61c85531041f24708a;hb=ccdc4ec3044bd108ae1e20d772f078c10df114b3;hp=5679170e82ed644d4c3eb4f71f26aa0ac9acce24;hpb=4e7d08a229a531f8d7841a8a1a892d5989130d67;p=git.git diff --git a/builtin/rev-list.c b/builtin/rev-list.c index 5679170e8..efe9360e2 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -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) @@ -133,9 +142,12 @@ static void show_commit(struct commit *commit, void *data) */ if (graph_show_remainder(revs->graph)) putchar('\n'); + if (revs->commit_format == CMIT_FMT_ONELINE) + putchar('\n'); } } else { - if (buf.len) + if (revs->commit_format != CMIT_FMT_USERFORMAT || + buf.len) printf("%s%c", buf.buf, info->hdr_termination); } strbuf_release(&buf); @@ -313,7 +325,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); init_revisions(&revs, prefix); - revs.abbrev = 0; + revs.abbrev = DEFAULT_ABBREV; revs.commit_format = CMIT_FMT_UNSPECIFIED; argc = setup_revisions(argc, argv, &revs, NULL); @@ -397,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; }