From: Jeff King Date: Tue, 23 Oct 2007 06:41:07 GMT Subject: Re: [PATCH 1/2] Added basic color support to git add --interactive Message-ID: <20071023064106.GA30351@coredump.intra.peff.net> In-Reply-To: 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. > Having said that, I think this kind of function belongs in Git.pm, and the Yes! Most of this is obviously library-ish code, and should go into the library. > dependency on Term::ANSIColor should be replaced with dependency-free code > that generates the colors itself; this should be easy because the number of Out of curiosity, are people really running perl < 5.6? Term::ANSIColor has been in the base distribution for 7 years now. -Peff