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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jul 9, 2017 at 06:13 UTC
822601e8303270aebed493b11e0988a75f2646b8
1 file changed
+4
-1
builtin/log.c
+4
-1
@@ -372,7 +372,10 @@ static int cmd_log_walk(struct rev_info *rev)
372
*/
373
rev->max_count++;
374
if (!rev->reflog_info) {
375
- /* we allow cycles in reflog ancestry */
375
+ /*
376
+ * We may show a given commit multiple times when
377
+ * walking the reflogs.
378
+ */
379
free_commit_buffer(commit);
380
}
381
free_commit_list(commit->parents);