summaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2011-04-26 08:24:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-04-26 20:13:20 (GMT)
commitb388e14b89f0a82b8067b3922a93cf2d1b013ff0 (patch)
treede39c28c8604f4c03270d50a1c3dcf49ec9cf196 /builtin/rev-list.c
parentec014eac0e9e6f30cbbca616090fa2ecf74797e7 (diff)
downloadgit-b388e14b89f0a82b8067b3922a93cf2d1b013ff0.zip
git-b388e14b89f0a82b8067b3922a93cf2d1b013ff0.tar.gz
git-b388e14b89f0a82b8067b3922a93cf2d1b013ff0.tar.bz2
rev-list --count: separate count for --cherry-mark
When --count is used with --cherry-mark, omit the patch equivalent commits from the count for left and right commits and print the count of equivalent commits separately. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 9bfb942..4be6699 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -55,7 +55,9 @@ static void show_commit(struct commit *commit, void *data)
graph_show_commit(revs->graph);
if (revs->count) {
- if (commit->object.flags & SYMMETRIC_LEFT)
+ if (commit->object.flags & PATCHSAME)
+ revs->count_same++;
+ else if (commit->object.flags & SYMMETRIC_LEFT)
revs->count_left++;
else
revs->count_right++;
@@ -406,8 +408,12 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
&info);
if (revs.count) {
- if (revs.left_right)
+ if (revs.left_right && revs.cherry_mark)
+ printf("%d\t%d\t%d\n", revs.count_left, revs.count_right, revs.count_same);
+ else if (revs.left_right)
printf("%d\t%d\n", revs.count_left, revs.count_right);
+ else if (revs.cherry_mark)
+ printf("%d\t%d\n", revs.count_left + revs.count_right, revs.count_same);
else
printf("%d\n", revs.count_left + revs.count_right);
}