From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: Bo Yang <struggleyb.nku@gmail.com>
Subject: [PATCH v7 3/5] Export three functions from diff.c
Date: Thu, 7 Jun 2012 12:23:27 +0200 [thread overview]
Message-ID: <3d2d6819e02104dc954bd56be996e664dba90c54.1339063659.git.trast@student.ethz.ch> (raw)
In-Reply-To: <cover.1339063659.git.trast@student.ethz.ch>
From: Bo Yang <struggleyb.nku@gmail.com>
Use fill_metainfo to fill the line level diff meta data,
emit_line to print out a line and quote_two to quote
paths.
Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
diff.c | 6 +++---
diff.h | 17 +++++++++++++++++
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/diff.c b/diff.c
index 77edd50..f9673f3 100644
--- a/diff.c
+++ b/diff.c
@@ -220,7 +220,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
return git_default_config(var, value, cb);
}
-static char *quote_two(const char *one, const char *two)
+char *quote_two(const char *one, const char *two)
{
int need_one = quote_c_style(one, NULL, NULL, 1);
int need_two = quote_c_style(two, NULL, NULL, 1);
@@ -410,7 +410,7 @@ static void emit_line_0(struct diff_options *o, const char *set, const char *res
fputc('\n', file);
}
-static void emit_line(struct diff_options *o, const char *set, const char *reset,
+void emit_line(struct diff_options *o, const char *set, const char *reset,
const char *line, int len)
{
emit_line_0(o, set, reset, line[0], line+1, len-1);
@@ -2925,7 +2925,7 @@ static int similarity_index(struct diff_filepair *p)
return p->score * 100 / MAX_SCORE;
}
-static void fill_metainfo(struct strbuf *msg,
+void fill_metainfo(struct strbuf *msg,
const char *name,
const char *other,
struct diff_filespec *one,
diff --git a/diff.h b/diff.h
index e027650..4a7d085 100644
--- a/diff.h
+++ b/diff.h
@@ -14,6 +14,7 @@
struct userdiff_driver;
struct sha1_array;
struct commit;
+struct diff_filepair;
typedef void (*change_fn_t)(struct diff_options *options,
unsigned old_mode, unsigned new_mode,
@@ -329,6 +330,22 @@ extern size_t fill_textconv(struct userdiff_driver *driver,
extern int parse_rename_score(const char **cp_p);
+/* some output functions line.c need */
+extern void fill_metainfo(struct strbuf *msg,
+ const char *name,
+ const char *other,
+ struct diff_filespec *one,
+ struct diff_filespec *two,
+ struct diff_options *o,
+ struct diff_filepair *p,
+ int *must_show_header,
+ int use_color);
+
+extern void emit_line(struct diff_options *o, const char *set, const char *reset,
+ const char *line, int len);
+
+extern char *quote_two(const char *one, const char *two);
+
extern int print_stat_summary(FILE *fp, int files,
int insertions, int deletions);
--
1.7.11.rc1.243.gbf4713c
next prev parent reply other threads:[~2012-06-07 10:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 10:23 [PATCH v7 0/5] git log -L, all new and shiny Thomas Rast
2012-06-07 10:23 ` [PATCH v7 1/5] Refactor parse_loc Thomas Rast
2012-06-07 10:23 ` [PATCH v7 2/5] blame: introduce $ as "end of file" in -L syntax Thomas Rast
2012-06-07 17:23 ` Junio C Hamano
2012-06-07 17:44 ` Thomas Rast
2012-06-07 10:23 ` Thomas Rast [this message]
2012-06-07 17:44 ` [PATCH v7 3/5] Export three functions from diff.c Junio C Hamano
2012-06-07 10:23 ` [PATCH v7 4/5] Export rewrite_parents() for 'log -L' Thomas Rast
2012-06-07 10:23 ` [PATCH v7 5/5] Implement line-history search (git log -L) Thomas Rast
2012-06-07 17:42 ` Junio C Hamano
2012-06-07 17:52 ` Thomas Rast
2012-06-10 9:38 ` Zbigniew Jędrzejewski-Szmek
2012-06-15 4:40 ` [PATCH v7 0/5] git log -L, all new and shiny Junio C Hamano
2012-06-15 13:29 ` Thomas Rast
2012-06-15 15:23 ` Junio C Hamano
2012-06-16 6:01 ` Junio C Hamano
2012-06-19 10:11 ` Thomas Rast
2012-06-19 10:33 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d2d6819e02104dc954bd56be996e664dba90c54.1339063659.git.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=struggleyb.nku@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).