On Fri, Oct 12, 2007 at 11:13:14PM -0500, Dan Zwell wrote:Neat, thanks for working on this. I believe it's because add--interactive parses the output of git-diff-files, so it expects unadorned diffs. I think you may be stuck re-coloring the diffs yourself, which is a little ugly. Two suggestions: - every color should be configurable (e.g., see diff color options) - where possible, use existing color config (e.g., for diffs) You will never come up with a color scheme that satisfies everyone (e.g., white text on black background versus black text on white background), so configurability is a good idea (not to mention that nobody will ever agree on what looks "good"). Shouldn't these just be 'eq' instead of a regex? ISTR some terminals had issues with leaving ANSI attributes set across a newline. That was the reason for the color_fprintf_ln business in color.[ch]. You might replace this with something like: print_color_ln 'bold', $opts->{HEADER}; where "print_color_ln" turns off the attribute before the newline. See how we are pulling the diff into lines? Look a few lines below and you will see that we start parsing without regard to the color. Unfortunately, that parsed form ends up being output to the user, so we will have to do colorization at that point (fortunately, diff colorization with regexes isn't _that_ hard). Hrm, splitting this with print_color_ln as I mentioned above would be a little painful. Maybe something like this (totally untested): # Turn on ansi attributes at the beginning of the string and at # the beginning of each line, but then turn them off before each # newline. This should give the effect of covering the whole string # with the attribute, but not have attributes cross newline boundaries. sub color_print { my $attr = shift; local $_ = shift; if ($use_color) { s/^/Term::ANSIColor::color($attr)/mge; s/\n/Term::ANSIColor::color('reset') . $&/ge; } print $_; } -Peff - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Mark Lord | 2.6.25-rc8: FTP transfer errors |
| Kamalesh Babulal | Re: 2.6.23-rc6-mm1 |
| Greg Kroah-Hartman | [PATCH 025/196] paride: Convert from class_device to device for block/paride |
| Stephen Rothwell | Announce: Linux-next (Or Andrew's dream :-)) |
git: | |
| Linus Torvalds | Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49 |
| David Miller | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
