git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH 1/4] textconv: make the API public

From
ABAxel Bonnet <axel.bonnet@ensimag.imag.fr>
Date
Jun 3, 2010, 10:47 UTC
Message-ID
<1275562038-7468-2-git-send-email-axel.bonnet@ensimag.imag.fr>
In-Reply-To
<1275562038-7468-1-git-send-email-axel.bonnet@ensimag.imag.fr>

The textconv functionality allows one to convert a file into text before running diff. But this functionality can be useful to other features such as blame.

Signed-off-by: Diane Gasselin <diane.gasselin@ensimag.imag.fr>
Signed-off-by: Clément Poulain <clement.poulain@ensimag.imag.fr>
Signed-off-by: Axel Bonnet <axel.bonnet@ensimag.imag.fr>
---
 diff.c |   12 ++++--------
 diff.h |    8 ++++++++
 2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/diff.c b/diff.c
index 494f560..b4a830f 100644
--- a/diff.c
+++ b/diff.c
@@ -43,10 +43,6 @@ static char diff_colors[][COLOR_MAXLEN] = {
 	GIT_COLOR_NORMAL,	/* FUNCINFO */
 };
 
-static void diff_filespec_load_driver(struct diff_filespec *one);
-static size_t fill_textconv(struct userdiff_driver *driver,
-			    struct diff_filespec *df, char **outbuf);
-
 static int parse_diff_color_slot(const char *var, int ofs)
 {
 	if (!strcasecmp(var+ofs, "plain"))
@@ -1629,7 +1625,7 @@ void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const
 		options->b_prefix = b;
 }
 
-static struct userdiff_driver *get_textconv(struct diff_filespec *one)
+struct userdiff_driver *get_textconv(struct diff_filespec *one)
 {
 	if (!DIFF_FILE_VALID(one))
 		return NULL;
@@ -4002,9 +3998,9 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
 	return strbuf_detach(&buf, outsize);
 }
 
-static size_t fill_textconv(struct userdiff_driver *driver,
-			    struct diff_filespec *df,
-			    char **outbuf)
+size_t fill_textconv(struct userdiff_driver *driver,
+		     struct diff_filespec *df,
+		     char **outbuf)
 {
 	size_t size;
 
diff --git a/diff.h b/diff.h
index 9ace08c..2a0e36d 100644
--- a/diff.h
+++ b/diff.h
@@ -9,6 +9,8 @@
 struct rev_info;
 struct diff_options;
 struct diff_queue_struct;
+struct diff_filespec;
+struct userdiff_driver;
 
 typedef void (*change_fn_t)(struct diff_options *options,
 		 unsigned old_mode, unsigned new_mode,
@@ -287,4 +289,10 @@ extern void diff_no_index(struct rev_info *, int, const char **, int, const char
 
 extern int index_differs_from(const char *def, int diff_flags);
 
+extern size_t fill_textconv(struct userdiff_driver *driver,
+			    struct diff_filespec *df,
+			    char **outbuf);
+
+extern struct userdiff_driver *get_textconv(struct diff_filespec *one);
+
 #endif /* DIFF_H */
-- 
1.6.6.7.ga5fe3
Previous: Axel BonnetNext: Axel Bonnet
Message 2 of 16 in “textconv support for blame”
  1. 0/4 textconv support for blameAxel Bonnet, Jun 3, 2010
  2. 1/4 textconv: make the API publicAxel Bonnet, Jun 3, 2010
  3. 2/4 textconv: make diff_options accessible from blameAxel Bonnet, Jun 3, 2010
  4. 3/4 textconv: support for blameAxel Bonnet, Jun 3, 2010
  5. 4/4 t/t8006: test textconv support for blameAxel Bonnet, Jun 3, 2010
  6. Johannes SixtJun 3, 2010
  7. Diane GasselinJun 4, 2010
  8. Matthieu MoyJun 4, 2010
  9. Matthieu MoyJun 4, 2010
  10. Junio C HamanoJun 4, 2010
  11. Diane GasselinJun 4, 2010
  12. Jeff KingJun 6, 2010
  13. Junio C HamanoJun 4, 2010
  14. Matthieu MoyJun 4, 2010
  15. bonnetaJun 4, 2010
  16. Matthieu MoyJun 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.