Skip to content

Commit 822601e

Browse files
peffgitster
authored andcommitted
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>
1 parent 82fd0f4 commit 822601e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builtin/log.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ static int cmd_log_walk(struct rev_info *rev)
372372
*/
373373
rev->max_count++;
374374
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+
*/
376379
free_commit_buffer(commit);
377380
}
378381
free_commit_list(commit->parents);

0 commit comments

Comments
 (0)