git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, johan@herland.net,
	Lars Hjemli <hjemli@gmail.com>,
	nanako3@lavabit.com, adam@adamsimpkins.net
Subject: [PATCH 1/2] Make graph_next_line() available in the graph.h API
Date: Tue, 13 Jul 2010 23:23:38 +0200	[thread overview]
Message-ID: <1279056219-27096-2-git-send-email-johan@herland.net> (raw)
In-Reply-To: <1279056219-27096-1-git-send-email-johan@herland.net>

In order to successfully use the graph API from a context other than the
stdout/command-line scenario (where the graph_show_* functions are
suitable), we need direct access to graph_next_line(), to drive the
graph drawing process.

Signed-off-by: Johan Herland <johan@herland.net>
---
 graph.c |   13 +------------
 graph.h |   11 +++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/graph.c b/graph.c
index ac7c605..47397da 100644
--- a/graph.c
+++ b/graph.c
@@ -8,17 +8,6 @@
 /* Internal API */
 
 /*
- * Output the next line for a graph.
- * This formats the next graph line into the specified strbuf.  It is not
- * terminated with a newline.
- *
- * Returns 1 if the line includes the current commit, and 0 otherwise.
- * graph_next_line() will return 1 exactly once for each time
- * graph_update() is called.
- */
-static int graph_next_line(struct git_graph *graph, struct strbuf *sb);
-
-/*
  * Output a padding line in the graph.
  * This is similar to graph_next_line().  However, it is guaranteed to
  * never print the current commit line.  Instead, if the commit line is
@@ -1143,7 +1132,7 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf
 		graph_update_state(graph, GRAPH_PADDING);
 }
 
-static int graph_next_line(struct git_graph *graph, struct strbuf *sb)
+int graph_next_line(struct git_graph *graph, struct strbuf *sb)
 {
 	switch (graph->state) {
 	case GRAPH_PADDING:
diff --git a/graph.h b/graph.h
index b82ae87..f188168 100644
--- a/graph.h
+++ b/graph.h
@@ -32,6 +32,17 @@ void graph_update(struct git_graph *graph, struct commit *commit);
  */
 int graph_is_commit_finished(struct git_graph const *graph);
 
+/*
+ * Output the next line for a graph.
+ * This formats the next graph line into the specified strbuf.  It is not
+ * terminated with a newline.
+ *
+ * Returns 1 if the line includes the current commit, and 0 otherwise.
+ * graph_next_line() will return 1 exactly once for each time
+ * graph_update() is called.
+ */
+int graph_next_line(struct git_graph *graph, struct strbuf *sb);
+
 
 /*
  * graph_show_*: helper functions for printing to stdout
-- 
1.7.0.4

  reply	other threads:[~2010-07-13 21:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 21:23 [PATCH 0/2] Preparing the graph API for external users Johan Herland
2010-07-13 21:23 ` Johan Herland [this message]
2010-07-13 21:23 ` [PATCH 2/2] Enable custom schemes for column colors in the graph API Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 0/5] Commit graph on CGit's 'log' view Johan Herland
2010-07-13 22:57   ` Lars Hjemli
2010-07-14  5:59     ` Johan Herland
2010-07-18 13:26       ` Lars Hjemli
2010-07-13 21:40 ` [CGit RFC/PATCH 1/5] ui-stats: Remove unnecessary #include Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 2/5] ui-log: Move 'Age' column to the right of 'Author', like in gitk Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 3/5] ui-log: Refactor display of commit messages Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 4/5] ui-log: Implement support for commit graphs Johan Herland
2010-07-13 21:40 ` [CGit RFC/PATCH 5/5] ui-log: Colorize commit graph Johan Herland

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=1279056219-27096-2-git-send-email-johan@herland.net \
    --to=johan@herland.net \
    --cc=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hjemli@gmail.com \
    --cc=nanako3@lavabit.com \
    /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).