Re: [PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-12 Thread Karthik Nayak
On Wed, Aug 12, 2015 at 9:59 PM, Junio C Hamano wrote: > Karthik Nayak writes: > + format_quote_value(atomv, quote_style, &output); >>> >>> If the one to add a literal string (with %hex escaping) is called "append_", >>> then this should be called append_quoted_atom() or somethin

Re: [PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-12 Thread Junio C Hamano
Karthik Nayak writes: >>> + format_quote_value(atomv, quote_style, &output); >> >> If the one to add a literal string (with %hex escaping) is called "append_", >> then this should be called append_quoted_atom() or something, no? > > Although it does append like "append_non_atom" this

Re: [PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-12 Thread Karthik Nayak
On Tue, Aug 11, 2015 at 11:30 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> @@ -1283,9 +1279,11 @@ void show_ref_array_item(struct ref_array_item *info, >> const char *format, int qu >> if (color_parse("reset", color) < 0) >> die("BUG: couldn't parse

Re: [PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-12 Thread Karthik Nayak
On Tue, Aug 11, 2015 at 11:26 PM, Junio C Hamano wrote: > Karthik Nayak writes: > >> -static void print_value(struct atom_value *v, int quote_style) >> +static void format_quote_value(struct atom_value *v, int quote_style, >> struct strbuf *output) >> { > > Hmph... > >> -static void emit(const

Re: [PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-11 Thread Junio C Hamano
Karthik Nayak writes: > @@ -1283,9 +1279,11 @@ void show_ref_array_item(struct ref_array_item *info, > const char *format, int qu > if (color_parse("reset", color) < 0) > die("BUG: couldn't parse 'reset' as a color"); > resetv.s = color; > -

Re: [PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-11 Thread Junio C Hamano
Karthik Nayak writes: > -static void print_value(struct atom_value *v, int quote_style) > +static void format_quote_value(struct atom_value *v, int quote_style, struct > strbuf *output) > { Hmph... > -static void emit(const char *cp, const char *ep) > +static void append_non_atom(const char *

[PATCH v10 02/13] ref-filter: print output to strbuf for formatting

2015-08-09 Thread Karthik Nayak
Introduce a strbuf `output` which will act as a substitute rather than printing directly to stdout. This will be used for formatting eventually. Rename some functions to reflect the changes made: print_value() -> format_quote_value() emit()-> append_non_atom() Mentored-by: Christian Coude