From 822601e8303270aebed493b11e0988a75f2646b8 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 9 Jul 2017 06:13:51 -0400 Subject: [PATCH] log: clarify comment about reflog cycles 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 Signed-off-by: Junio C Hamano --- builtin/log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/log.c b/builtin/log.c index 8ca1de9894..cf303b2c06 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -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); -- 2.43.2