[PATCH] graph: avoid infinite loop in graph_show_commit()

2012-09-22 Thread Nguyễn Thái Ngọc Duy
The loop can be triggered with "git diff-tree --graph commit" where the commit is a non-merge. It goes like this - graph_show_commit - graph_next_line - graph_output_padding_line The last function quits because graph->commit is NULL, but graph_next_line() does not return "shown", so the loop i

Re: [PATCH] graph: avoid infinite loop in graph_show_commit()

2012-09-23 Thread Nguyen Thai Ngoc Duy
On Sun, Sep 23, 2012 at 6:55 PM, Michal Kiedrowicz wrote: > Nguyễn Thái Ngọc Duy gmail.com> writes: > >> >> The loop can be triggered with "git diff-tree --graph commit" where >> the commit is a non-merge. It goes like this > > > Isn't this the same issue as in > http://article.gmane.org/gmane.co

Re: [PATCH] graph: avoid infinite loop in graph_show_commit()

2012-09-24 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Sun, Sep 23, 2012 at 6:55 PM, Michal Kiedrowicz > wrote: >> Nguyễn Thái Ngọc Duy gmail.com> writes: >> >>> >>> The loop can be triggered with "git diff-tree --graph commit" where >>> the commit is a non-merge. It goes like this >> >> >> Isn't this the same issu

Re: [PATCH] graph: avoid infinite loop in graph_show_commit()

2012-09-25 Thread Junio C Hamano
Junio C Hamano writes: > Has either of you tried the patch with the problematic case the > other patch tries to solve? Michal's old patch does smell like it > is going in the better direction in that it stops looping when we > know we would only be showing the padding, which is a sign that we >