path: root/userdiff.h
diff options
authorJeff King <>2016-02-22 18:28:54 (GMT)
committerJunio C Hamano <>2016-02-22 18:40:35 (GMT)
commita64e6a44c63a965c5bc26242ddd3ed049b42e117 (patch)
tree7bf3c3388e48bcbc548da65a688ba2425afc42f0 /userdiff.h
parenta2558fb8e1e387b630312311e1d22c95663da5d0 (diff)
diff: clarify textconv interface
The memory allocation scheme for the textconv interface is a bit tricky, and not well documented. It was originally designed as an internal part of diff.c (matching fill_mmfile), but gradually was made public. Refactoring it is difficult, but we can at least improve the situation by documenting the intended flow and enforcing it with an in-code assertion. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'userdiff.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/userdiff.h b/userdiff.h
index 4a7e78f..2ef0ce5 100644
--- a/userdiff.h
+++ b/userdiff.h
@@ -23,6 +23,10 @@ int userdiff_config(const char *k, const char *v);
struct userdiff_driver *userdiff_find_by_name(const char *name);
struct userdiff_driver *userdiff_find_by_path(const char *path);
+ * Initialize any textconv-related fields in the driver and return it, or NULL
+ * if it does not have textconv enabled at all.
+ */
struct userdiff_driver *userdiff_get_textconv(struct userdiff_driver *driver);
#endif /* USERDIFF */