ref-filter: introduce format_ref_array_item()
To allow column display, we will need to first render the output in a string list to allow print_columns() to compute the proper size of each column before starting the actual output. Introduce the function format_ref_array_item() that does the formatting of a ref_array_item to an strbuf. show_ref_array_item() is kept as a convenience wrapper around it which obtains the strbuf and prints it the standard output. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
d4919bb288
commit
99c6a71d4f
@ -100,6 +100,9 @@ int parse_ref_filter_atom(const char *atom, const char *ep);
|
||||
int verify_ref_format(const char *format);
|
||||
/* Sort the given ref_array as per the ref_sorting provided */
|
||||
void ref_array_sort(struct ref_sorting *sort, struct ref_array *array);
|
||||
/* Based on the given format and quote_style, fill the strbuf */
|
||||
void format_ref_array_item(struct ref_array_item *info, const char *format,
|
||||
int quote_style, struct strbuf *final_buf);
|
||||
/* Print the ref using the given format and quote_style */
|
||||
void show_ref_array_item(struct ref_array_item *info, const char *format, int quote_style);
|
||||
/* Callback function for parsing the sort option */
|
||||
|
||||
Reference in New Issue
Block a user