author | Adam Simpkins <adam@adamsimpkins.net> | |
Thu, 5 Jun 2008 08:56:19 +0000 (01:56 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 6 Jun 2008 16:23:09 +0000 (09:23 -0700) | ||
commit | a0ebe573a516a1530a2c072e513fa7f529781dd0 | |
tree | 6abb3e8790470c3ed3f7519b84472bad1e0e8906 | tree | snapshot |
parent | b7d9681974e61959f10c7b2c1063b7781c5b904e | commit | diff |
graph API: fix "git log --graph --first-parent"
This change teaches the graph API that only the first parent of each
commit is interesting when "--first-parent" was specified.
This change also consolidates the graph parent walking logic into two
new internal functions, first_interesting_parent() and
next_interesting_parent(). A simpler fix would have been to simply
break at the end of the 2 existing for loops when
graph->revs->first_parent_only is set. However, this change seems
nicer, especially if we ever need to add any new loops over the parent
list in the future.
Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This change teaches the graph API that only the first parent of each
commit is interesting when "--first-parent" was specified.
This change also consolidates the graph parent walking logic into two
new internal functions, first_interesting_parent() and
next_interesting_parent(). A simpler fix would have been to simply
break at the end of the 2 existing for loops when
graph->revs->first_parent_only is set. However, this change seems
nicer, especially if we ever need to add any new loops over the parent
list in the future.
Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
graph.c | diff | blob | history |