From: Derrick Stolee <stolee@gmail.com>
To: Jeff King <peff@peff.net>,
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, jcoglan@gmail.com,
Derrick Stolee <dstolee@microsoft.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/2] graph: fix collapse of multiple edges
Date: Wed, 8 Jan 2020 08:40:26 -0500 [thread overview]
Message-ID: <7a0e4637-85de-589f-df31-915b4603e45a@gmail.com> (raw)
In-Reply-To: <20200108072541.GC1675456@coredump.intra.peff.net>
On 1/8/2020 2:25 AM, Jeff King wrote:
> On Wed, Jan 08, 2020 at 04:27:55AM +0000, Derrick Stolee via GitGitGadget wrote:
>
>> Before this change:
>>
>> | | | | | | *
>> | |_|_|_|_|/|\
>> |/| | | | |/ /
>> | | | | |/| /
>> | | | |/| |/
>> | | |/| |/|
>> | |/| |/| |
>> | | |/| | |
>>
>> By adding the logic for "filling" a horizontal edge between the
>> target column and the current column, we are able to resolve the
>> issue.
>>
>> After this change:
>>
>> | | | | | | *
>> | |_|_|_|_|/|\
>> |/| | | | |/ /
>> | | |_|_|/| /
>> | |/| | | |/
>> | | | |_|/|
>> | | |/| | |
>
> Hmm. Your description and your diagrams make sense to me. But one
> curious thing is that the earlier test you added for 6_* does not need
> modified. Because it continues to show:
>
> | | | | * 6_F
> | |_|_|/|
> |/| | |/
> | | |/|
> | |/| |
> | * | | 6_D
>
> rather than adding a horizontal component to the second-parent line.
> That seems inconsistent.
The issue here is that there is not enough room for a second horizontal
line. The horizontal line can only start after the previous has completely
terminated, that is
| | | | * 6_F
| |_|_|/|
|/| | |/
at this point, the first horizontal line has terminated.
| | |/|
| |/| |
The remaining movement for the second line has no room for a horizontal
edge. The logic that I added is hit, but the for loop (over j) terminates
immediately without a single execution of the loop body.
If there was one more row to the example, then we would have:
| | | | | * 6_F
| |_|_|_|/|
|/| | | |/
| | |_|/|
| |/| | |
| * | | | 6_D
Thanks,
-Stolee
next prev parent reply other threads:[~2020-01-08 13:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 4:27 [PATCH 0/2] Graph horizontal fix Derrick Stolee via GitGitGadget
2020-01-08 4:27 ` [PATCH 1/2] graph: add test to demonstrate horizontal line bug Derrick Stolee via GitGitGadget
2020-01-08 4:27 ` [PATCH 2/2] graph: fix collapse of multiple edges Derrick Stolee via GitGitGadget
2020-01-08 7:25 ` Jeff King
2020-01-08 13:40 ` Derrick Stolee [this message]
2020-01-08 13:49 ` Jeff King
2020-01-08 18:06 ` [PATCH 0/2] Graph horizontal fix Junio C Hamano
2020-01-08 20:05 ` Derrick Stolee
2020-01-08 21:06 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7a0e4637-85de-589f-df31-915b4603e45a@gmail.com \
--to=stolee@gmail.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=jcoglan@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).