Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

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

From: Charles Bailey <hidden>
Date: 2016-06-15 22:44:20

On Mon, Mar 03, 2008 at 11:33:28PM +0100, Jakub Narebski wrote:
Charles Bailey [off-list ref] writes:
quoted
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.
quoted
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.
[...]

+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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help