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

Re: [PATCH] gitweb: add a setting to control the tabstop width

From
Charles Bailey <charles@hashpling.org>
Date
Mar 3, 2008, 22:52 UTC
Message-ID
<20080303225200.GA8145@hashpling.org>
In-Reply-To
<200803032333.29426.jnareb@gmail.com>
On Mon, Mar 03, 2008 at 11:33:28PM +0100, Jakub Narebski wrote:
Show 11 quoted lines
> Charles Bailey <charles@hashpling.org> writes:
> > 
> > The untabify function seems the sensible place to make the change. As
> > untabify is called once per line from various different locations it
> > also makes sense to cache the result of the config lookup in a package
> > variable, though this makes the change slightly less neat.
> 
> Since b201927 (gitweb: Read repo config using 'git config -z -l')
> repository config is cached in %config hash (per repository), so
> I don't think global / package variable $tabstop_width is really
> needed...

Fair point, although we still save the cost of some 'is the config variable overrideable and if so is it overriden' logic. Untabify is a once per line call which is more frequesnt than most gitweb config checking calls.

Show 7 quoted lines
> > This change should have a minimal impact on performance but it would
> > appreciate some more eyes and ideally some performance testing on
> > heavier systems than my own. 
> 
> ...but it would be better if you have checked at least on your system
> if it does affect performance or not.
> 

Not noticeably (on an old AMD Duron 900MHz), but my tests have been unscientific.

Show 5 quoted lines
> [...]
> 
> +our $tabstop_width;
> 
> I think I would write "our $tabstop_width = 8;" here.

Currently, I use the fact that it is initially 'undef' to know that I haven't checked the config yet. The config is then checked on the first time through untabify.

Charles.
Previous: Jakub NarebskiNext: Jakub Narebski
Message 3 of 10 in “gitweb: add a setting to control the tabstop width”
  1. gitweb: add a setting to control the tabstop widthCharles Bailey, Mar 3, 2008
  2. Jakub NarebskiMar 3, 2008
  3. Charles BaileyMar 3, 2008
  4. Jakub NarebskiMar 4, 2008
  5. Jakub NarebskiMar 3, 2008
  6. Junio C HamanoMar 3, 2008
  7. Martin LanghoffMar 4, 2008
  8. Jakub NarebskiMar 4, 2008
  9. Charles BaileyMar 4, 2008
  10. Charles BaileyMar 4, 2008

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.