git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH gitweb] Visually indicating patch size with horizontal bars

From
CSChris 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
Previous: Petr BaudisNext: Josef Weidendorfer
Message 26 of 27 in “Visually indicating patch size with horizontal bars”
  1. Visually indicating patch size with horizontal barsChris Shoemaker, Oct 27, 2005
  2. Junio C HamanoOct 27, 2005
  3. Chris ShoemakerOct 27, 2005
  4. Linus TorvaldsOct 28, 2005
  5. Chris ShoemakerOct 28, 2005
  6. Martin LanghoffOct 28, 2005
  7. H. Peter AnvinOct 28, 2005
  8. Andreas EricssonOct 28, 2005
  9. Junio C HamanoOct 28, 2005
  10. Martin LanghoffOct 28, 2005
  11. Linus TorvaldsOct 28, 2005
  12. Junio C HamanoOct 28, 2005
  13. Linus TorvaldsOct 28, 2005
  14. Kay SieversOct 28, 2005
  15. Chris ShoemakerOct 28, 2005
  16. Petr BaudisNov 1, 2005
  17. Martin LanghoffNov 1, 2005
  18. Petr BaudisNov 1, 2005
  19. Andreas EricssonNov 2, 2005
  20. Johannes SchindelinNov 2, 2005
  21. Andreas EricssonNov 2, 2005
  22. Johannes SchindelinNov 2, 2005
  23. Chris ShoemakerNov 2, 2005
  24. Kay SieversNov 2, 2005
  25. Petr BaudisDec 5, 2005
  26. Chris ShoemakerDec 5, 2005
  27. Josef WeidendorferOct 28, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.