path: root/ref-filter.h
diff options
authorLukas Puehringer <>2017-01-17 23:37:19 (GMT)
committerJunio C Hamano <>2017-01-18 00:10:22 (GMT)
commit2111aa794bb420f767895682232b494d3461ab31 (patch)
tree4d3c95589c1045888eb23de32d43ba2a06e6605b /ref-filter.h
parent94240b918f70560393516aa8f98edb877d582c69 (diff)
ref-filter: add function to print single ref_array_item
ref-filter functions are useful for printing git object information using a format specifier. However, some other modules may not want to use this functionality on a ref-array but only print a single item. Expose a pretty_print_ref function to create, pretty print and free individual ref-items. Signed-off-by: Lukas Puehringer <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'ref-filter.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/ref-filter.h b/ref-filter.h
index 14d435e..3cf3d3f 100644
--- a/ref-filter.h
+++ b/ref-filter.h
@@ -107,4 +107,11 @@ struct ref_sorting *ref_default_sorting(void);
/* Function to parse --merged and --no-merged options */
int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
+ * Print a single ref, outside of any ref-filter. Note that the
+ * name must be a fully qualified refname.
+ */
+void pretty_print_ref(const char *name, const unsigned char *sha1,
+ const char *format);
#endif /* REF_FILTER_H */