Skip to content

Commit

Permalink
log: clarify comment about reflog cycles
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
peff authored and gitster committed Jul 9, 2017
1 parent 82fd0f4 commit 822601e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 822601e

Please sign in to comment.