From: Allan Caffee <allan.caffee@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [RFC/PATCH] graph API: Use horizontal lines for more compact graphs
Date: Mon, 20 Apr 2009 22:23:20 -0400 [thread overview]
Message-ID: <b2e43f8f0904201923hd97f3e3v66addf59daa3956f@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0904210255280.10279@pacific.mpi-cbg.de>
On Mon, Apr 20, 2009 at 8:56 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 20 Apr 2009, Allan Caffee wrote:
>
>> diff --git a/graph.c b/graph.c
>> index d4571cf..597e545 100644
>> --- a/graph.c
>> +++ b/graph.c
>> @@ -47,20 +47,6 @@ static void graph_show_strbuf(struct git_graph *graph, struct strbuf const *sb);
>> * - Limit the number of columns, similar to the way gitk does.
>> * If we reach more than a specified number of columns, omit
>> * sections of some columns.
>> - *
>> - * - The output during the GRAPH_PRE_COMMIT and GRAPH_COLLAPSING states
>> - * could be made more compact by printing horizontal lines, instead of
>> - * long diagonal lines. For example, during collapsing, something like
>> - * this: instead of this:
>> - * | | | | | | | | | |
>> - * | |_|_|/ | | | |/
>> - * |/| | | | | |/|
>> - * | | | | | |/| |
>> - * |/| | |
>> - * | | | |
>> - *
>> - * If there are several parallel diagonal lines, they will need to be
>> - * replaced with horizontal lines on subsequent rows.
>
> I like it!
:) Good!
>> + for (j = (target * 2)+3; j < (i - 2); j += 2)
>
> This (target*2)+3 is a bit too magical for me to understand. But maybe I
> am just too tired?
It is a little magical. Here target is an index into
graph->new_columns so we double that to get the actual location of the
edge in the string for this line. So if we take the example that was
in the original TODO:
t(c)
| t(c) + 3 (i.e. the first horizontal edge)
| |
v..v c
| | | | |
| |_|_|/
|/| | |
| | | |
Where c is the "horizontal_edge", t(c) is the target of the
"horizontal_edge" and t(c) + 3 is the location of the first horizontal
segment. And then of course the += 2 is because we don't want to
change the mappings of the existing vertical edges. This could really
probably use a comment (suggestions welcome).
Hope that clears things up,
~Allan
next prev parent reply other threads:[~2009-04-21 2:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-21 0:40 [RFC/PATCH] graph API: Use horizontal lines for more compact graphs Allan Caffee
2009-04-21 0:56 ` Johannes Schindelin
2009-04-21 2:23 ` Allan Caffee [this message]
2009-04-21 8:13 ` Johannes Schindelin
2009-04-21 12:47 ` [RFC/PATCH v2] " Allan Caffee
2009-04-21 13:17 ` Johannes Schindelin
2009-04-21 13:36 ` Bug in colored "log --graph" implementation Teemu Likonen
2009-04-21 18:34 ` [PATCH] graph API: fix extra space during pre_commit_line state Allan Caffee
2009-04-22 3:25 ` Teemu Likonen
2009-04-22 19:38 ` Allan Caffee
2009-04-22 19:52 ` [PATCH 2/3] " Allan Caffee
2009-04-22 21:27 ` [PATCH 1/3] t4202-log: extend test coverage of graphing Allan Caffee
2009-04-22 21:27 ` [PATCH 2/3] graph API: fix extra space during pre_commit_line state Allan Caffee
2009-04-22 21:27 ` [PATCH 3/3] graph API: fix a bug in the rendering of octopus merges Allan Caffee
2009-04-22 21:28 ` [RFC/PATCH v2] graph API: Use horizontal lines for more compact graphs Allan Caffee
2009-04-27 15:43 ` [PATCH v2 (resend)] " Allan Caffee
2009-04-27 16:35 ` 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=b2e43f8f0904201923hd97f3e3v66addf59daa3956f@mail.gmail.com \
--to=allan.caffee@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/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).