Re: [PATCH] Add color to git-add--interactive diffs (Take 2: now without spurious line break!)
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Oct 14, 2007, 21:01 UTC
- Message-ID
- <DFCD949F-2E7E-417A-9B58-A220A83695F5@wincent.com>
- In-Reply-To
- <Pine.LNX.4.64.0710141814100.25221@racer.site>
El 14/10/2007, a las 19:15, Johannes Schindelin escribió:
Show 18 quoted lines
> On Sun, 14 Oct 2007, Wincent Colaiuta wrote:
>
>>> +sub parse_color {
>>
>> You could simplify the manual escape sequence construction that
>> you're
>> doing here by using Term::ANSIColor like the other patches did. I see
>> that git-send-email.perl uses that module too, so I guess
>> depending on
>> that module is ok.
>
> Wrong. Depending on that module is not correct, you always have to
> wrap
> it into an "if (<is_color>) {...}".
>
> I use git add -i quite often, and I _never_ use git send-email. My
> guess
> is that I am not alone with that.In that case I propose factoring out the escape sequence generation into git.pm, where it can be used by git-send-email, git-add-- interactive, or any other Perl script in Git. Do you think that's a good idea? If so I'll try whipping up a patch along those lines.
Wincent