summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-30 18:55:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-30 18:55:38 (GMT)
commit6296062285e07051a5a46cbbd74c67a10bf2ac16 (patch)
tree1d4bb7d5ce2595bf288c3eac5f4e45e5673ea4e4 /builtin
parent304d8b6256db7aca7772c0a994a7c1c987eabd97 (diff)
parent6d158cba282f22fa1548af1188f78042fed30aed (diff)
downloadgit-6296062285e07051a5a46cbbd74c67a10bf2ac16.zip
git-6296062285e07051a5a46cbbd74c67a10bf2ac16.tar.gz
git-6296062285e07051a5a46cbbd74c67a10bf2ac16.tar.bz2
Merge branch 'tr/rev-list-count'
* tr/rev-list-count: bash completion: Support "divergence from upstream" messages in __git_ps1 rev-list: introduce --count option Conflicts: contrib/completion/git-completion.bash
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rev-list.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 51ceb19..efe9360 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)
@@ -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;
}