From: Allan Caffee <allan.caffee@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Jeff King <peff@peff.net>, Nanako Shiraishi <nanako3@lavabit.com>,
Teemu Likonen <tlikonen@iki.fi>
Subject: Re: [PATCH v3] graph API: Added logic for colored edges
Date: Sun, 12 Apr 2009 13:43:19 -0400 [thread overview]
Message-ID: <b2e43f8f0904121043o425ac311ib32c18625fac2c0e@mail.gmail.com> (raw)
In-Reply-To: <7vhc0u9s86.fsf@gitster.siamese.dyndns.org>
On Sun, 12 Apr 2009, Junio C Hamano wrote:
> Allan Caffee <allan.caffee@gmail.com> writes:
>
> > diff --git a/graph.c b/graph.c
> > index 162a516..beb622a 100644
> > --- a/graph.c
> > +++ b/graph.c
> > @@ -1,5 +1,6 @@
> > #include "cache.h"
> > #include "commit.h"
> > +#include "color.h"
> > #include "graph.h"
> > #include "diff.h"
> > #include "revision.h"
> > @@ -72,11 +69,14 @@ struct column {
> > */
> > struct commit *commit;
> > /*
> > - * XXX: Once we add support for colors, struct column could also
> > - * contain the color of its branch line.
> > + * The color to (optionally) print this column in. This is an
> > + * index into column_colors.
> > */
> > + unsigned short color;
> > };
> >
> > +const unsigned short GIT_NOT_A_COLOR = -1;
>
> That (-1) is an unusual value for an *unsigned* short variable.
Perhaps you would prefer USHRT_MAX? I noticed that none of the existing
code #includes limits.h. Is it safe to assume this header is present?
> > @@ -714,10 +790,30 @@ static void graph_output_commit_char(struct git_graph *graph, struct strbuf *sb)
> > strbuf_addch(sb, '*');
> > }
> >
> > +inline void graph_draw_octopus_merge(const struct git_graph *graph,
> > + struct strbuf *sb)
> > +{
> > + /*
> > + * Here dashless_commits represents the number of parents
> > + * which don't need to have dashes (because their edges fit
> > + * neatly under the commit).
> > + */
> > + const int dashless_commits = 2;
> > + int col_num, i;
> > + int num_dashes =
> > + ((graph->num_parents - dashless_commits) * 2) - 1;
> > + for (i = 0; i < num_dashes; i++) {
> > + col_num = (i / 2) + dashless_commits;
> > + strbuf_write_column(sb, &graph->new_columns[col_num], '-');
>
> graph.c: In function 'graph_draw_octopus_merge':
> graph.c:807: error: 'strbuf_write_column' is static but used in inline function 'graph_draw_octopus_merge' which is not static
> graph.c:810: error: 'strbuf_write_column' is static but used in inline function 'graph_draw_octopus_merge' which is not static
> make: *** [graph.o] Error 1
>
> In general, I'd prefer people not to say "inline" unless (1) they know
> what they are doing, and (2) the code is really performance critical.
>
> At least I do not think the colored commit graph is performance critical,
> especially a function that only deals with octopus merges.
Okay. I'll remove the inline specifier from all the functions I added.
next prev parent reply other threads:[~2009-04-12 17:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090331235922.GA7411@linux.vnet>
2009-04-07 18:57 ` [PATCH] graph API: Added logic for colored edges Allan Caffee
2009-04-08 7:59 ` Junio C Hamano
2009-04-08 21:41 ` Allan Caffee
2009-04-09 0:29 ` Junio C Hamano
2009-04-09 22:22 ` [PATCH v3] " Allan Caffee
2009-04-12 8:44 ` Junio C Hamano
2009-04-12 17:43 ` Allan Caffee [this message]
2009-04-12 18:45 ` Junio C Hamano
2009-04-12 20:27 ` [PATCH v4] " Allan Caffee
2009-04-12 21:59 ` Junio C Hamano
2009-04-13 19:53 ` [PATCH v5] " Allan Caffee
2009-04-09 17:58 ` [PATCH] " Teemu Likonen
2009-04-09 22:08 ` Allan Caffee
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=b2e43f8f0904121043o425ac311ib32c18625fac2c0e@mail.gmail.com \
--to=allan.caffee@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nanako3@lavabit.com \
--cc=peff@peff.net \
--cc=tlikonen@iki.fi \
/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).