Re: [BUG/PATCH 0/5] t4214: cleanup and demonstrate graph bug
- From
Denton Liu <liu.denton@gmail.com>
- Date
- Sep 25, 2019, 17:09 UTC
- Message-ID
- <20190925170902.GA11547@dentonliu-ltm.internal.salesforce.com>
- In-Reply-To
- <cover.1569407150.git.liu.denton@gmail.com>
On Wed, Sep 25, 2019 at 03:26:57AM -0700, Denton Liu wrote:
> I tried my hand at fixing the bug but in the hour I spent going at it, I > couldn't fix the logic up. The buggy logic is in graph.c: > graph_draw_octopus_merge() in case anyone is interested.
I guess for the record, this was the final patch that I ended up with. Two issues with it, though:
1. It assumes that there can be no parallel paths on the right side, which I'm not sure is a correct assumption.
2. It _still_ fails my last proposed test case.
-- >8 --
diff --git a/graph.c b/graph.c index f53135485f..f9395a2327 100644 --- a/graph.c +++ b/graph.c @@ -881,8 +881,7 @@ static int graph_draw_octopus_merge(struct git_graph *graph, /* * In both cases, commit_index corresponds to the edge labeled "0". */ - int first_col = graph->commit_index + dashless_parents - - parent_in_old_cols; + int first_col = graph->num_new_columns - dashful_parents; int i; for (i = 0; i < dashful_parents; i++) {