Re: [PATCH gitweb] Visually indicating patch size with horizontal bars
- From
- Chris Shoemaker <c.shoemaker@cox.net>
- Date
- Dec 5, 2005, 01:03 UTC
- Message-ID
- <20051205010335.GA4073@pe.Belkin>
- In-Reply-To
- <20051205000442.GB22159@pasky.or.cz>
On Mon, Dec 05, 2005 at 01:04:42AM +0100, Petr Baudis wrote:
Show 15 quoted lines
> Dear diary, on Wed, Nov 02, 2005 at 01:12:06AM CET, I got a letter > where Chris Shoemaker <c.shoemaker@cox.net> said that... > > On Wed, Nov 02, 2005 at 12:33:38PM +1300, Martin Langhoff wrote: > > > On 11/2/05, Petr Baudis <pasky@suse.cz> wrote: > > > > What about having the color indicate the number of affected files (let's > > > > say on a blue..red scale) and the width the size of patch? > > > > > > I'm a /little bit/ colour blind on the red scale -- so I vote for 2 > > > bars, each half the heigth of the current bar. ;-) > > > > I was going to use two bars for add vs. delete, but this could work, > > too. I'm intending on getting back to this ASAP, but for now my > > cvsimport problems are higher priority (see other post). > > Is there any progress, by the way?
A little. I decided to follow Junio's suggestion of caching the result of "git-diff-tree -r -p $commit | git-apply --numstat" in a BerkeleyDB. (I liked the idea of reusing the cached results on the commit page, too.) I got a script to populate the cache, then I suspect could be easily adapting into a commit-hook. Then I started working on the gitweb part and tried to follow another suggestion (Kay's, I think.) to use CSS instead of (yet another) embedded .png.
This is where I got hung up: I discovered something strange (to me, at least) about CSS/html: I'm using the <td></td> in the fifth column of the shortlog. I tried to use an anchor tag for the added count and one for the deleted count. Setting "display:block" and the different background-colors works (produces stacked horizontal bars), as does setting various widths (an essential point), but *ONLY* using "width" in the CSS. Using width anchor attribute simply doesn't work.
Honestly, html/css is not my strong suit and neither is perl, although the BerkeleyDB perl API seemed simple enough.
> If you didn't manage to finish it, no big deal - but it would be great > to have at least the last version you screenshotted, since IIRC I > couldn't find that one either, and I would like to play with it a bit.
I'm happy for anyone to take this over. Since my excursion into css didn't really work, I'd suggest starting with the gitweb-difftreeP.cgi version. I will send you (and anyone else who asks) that file and the cache population script.
-chris