From 20a5fd881a98cfe153fa5a81754994c7046a6e41 Mon Sep 17 00:00:00 2001
From: Junio C Hamano <gitster@pobox.com>
Date: Tue, 18 Feb 2020 13:21:46 -0800
Subject: [PATCH] rev-list --count: comment on the use of count_right++

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/rev-list.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 35e14ad2ed..f520111eda 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -262,6 +262,13 @@ static void show_object(struct object *obj, const char *name, void *cb_data)
 		return;
 
 	if (revs->count) {
+		/*
+		 * The object count is always accumulated in the .count_right
+		 * field for traversal that is not a left-right traversal,
+		 * and cmd_rev_list() made sure that a .count request that
+		 * wants to count non-commit objects, which is handled by
+		 * the show_object() callback, does not ask for .left_right.
+		 */
 		revs->count_right++;
 		return;
 	}
-- 
2.32.0.93.g670b81a890