log: clarify comment about reflog cycles
authorJeff King <peff@peff.net>
Sun, 9 Jul 2017 10:13:51 +0000 (06:13 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 9 Jul 2017 17:00:05 +0000 (10:00 -0700)
When we're walking reflogs, we leave the commit buffer and
parents in place. A comment explains that this is due to
"cycles". But the interesting thing is the unsaid
implication: that the cycles (plus our clearing of the SEEN
flag) will cause us to show commits multiple times. Let's
spell it out.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c
index 8ca1de98943bdc62248ddd31708a6632557c61de..cf303b2c06d24778d70b65427db1e23b5dfd9dcf 100644 (file)
@@ -372,7 +372,10 @@ static int cmd_log_walk(struct rev_info *rev)
                         */
                        rev->max_count++;
                if (!rev->reflog_info) {
-                       /* we allow cycles in reflog ancestry */
+                       /*
+                        * We may show a given commit multiple times when
+                        * walking the reflogs.
+                        */
                        free_commit_buffer(commit);
                }
                free_commit_list(commit->parents);