Re: [PATCH 6/9] ref-filter: introduce format_ref_array_item()
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Oct 5, 2015, 07:49 UTC
- Message-ID
- <CAOLa=ZTMf9i=+9Rgi9oO==vr_JGtG3J9DvQWk18Zx-yd5_35XA@mail.gmail.com>
- In-Reply-To
- <vpqoagg9n2l.fsf@grenoble-inp.fr>
On Sat, Oct 3, 2015 at 5:32 PM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 11 quoted lines
> Karthik Nayak <karthik.188@gmail.com> writes: > >> Introduce format_ref_array_item() which will output the details of a >> given ref_array_item as per the given format and quote_style to the >> given strbuf. > > Why do you need it in this series and you could do without for tag? > > Going through PATCH 8/9, I guess there's something related to --column, > but tag also has --column so I'm puzzled. >
The problem is with colors which tag.c doesn't use by default. Here we need to print colors only if we're printing to a tty which supports colors. which does not play well with the implementation of --column as done in tag.c. Where, If I'm not wrong the --column option captures all output, formats it and then prints it to stdout. Hence when using colors, we're told that the printing isn't done to a tty which supports colors, hence we lose out on colors.
I was trying something where we have a variable which knows when the column option is used and hence explicitly lets us use colors, but seemed like a mess. This was a clean of going about it.
-- Regards, Karthik Nayak