Re: [PATCH 1/2] Added basic color support to git add --interactive
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Oct 23, 2007, 07:44 UTC
- Message-ID
- <A225BBC0-2607-4952-8578-EC9A181C418E@wincent.com>
- In-Reply-To
- <20071023064106.GA30351@coredump.intra.peff.net>
El 23/10/2007, a las 8:41, Jeff King escribió:
Show 14 quoted lines
> On Tue, Oct 23, 2007 at 08:28:28AM +0200, Wincent Colaiuta wrote: > >> I did too, where you add a third, optional "trailer" parameter to the >> function where you pass the newline if there is one (following the >> style of >> the functions in color.c). Pasting it below. > > The problem with that approach is that you can only send in a single > line at a time (with the newline detached!), so it makes life > harder for > the caller. E.g., there is at least one spot that uses a here-doc with > many lines; splitting that into a bunch of print_ansi_color calls > would > be unnecessarily ugly.
Yes, I agree that it complicates things for the caller. I was just copying the model found in color.c; but seeing as this is Perl splitting into lines inside the printing function would be straightforward.
Cheers, Wincent