W dniu 21.09.2016 o 20:04, Ævar Arnfjörð Bjarmason pisze: > On Wed, Sep 21, 2016 at 6:26 PM, Jakub Narębski <jnareb@xxxxxxxxx> wrote: > >> P.S. I have reworking of commit message parsing and enhancement in my >> long, long and dated gitweb TODO list :-( > > Anything specific you could share? Some of TODO I would have to bring from backups, as the computer on which I did majority of gitweb development has since died (from old age). The list includes: - implement caching of gitweb output - revamp handling of encoding (UTF-8 with fallback encoding) - split gitweb into modules, while maintaining ease of install - refactor handling of diffs - better handling of config files - document URI structure, perhaps revamp URI parsing and generation - make commit message transformation generic (see below) > > One thing that would be a lot faster in Perl is if we didn't have to > pass the log around as split-up lines and could just operate on it as > one big string. Well, there are a few transformations that commit message undergoes in gitweb, including linking SHA1, optional linking of bug numbers to bug tracker, and syntax highlighting of signoff lines (trailer lines). I would like to have this cleaned up, and refactored. With all those transformations we would need to keep account which parts are HTML, and which not and need escaping (note: URI escape != HTML escape). > > It would make some code like git_print_log() a bit more complex / > fragile, since it would have to work on multi-line strings, but > anything that needed to do a regex match / replacement would be much > faster. Would it? Did you perform any synthetic micro-benchmark? > > But OTOH I think perhaps we're worrying about nothing when it comes to > the performance. I haven't been able to make gitweb display more than > a 100 or so commits at a time (haven't found where exactly in the code > these limits are), any munging we do on the log messages would have to > be pretty damn slow to matter. sub git_log_generic { # [...] my @commitlist = parse_commits($commit_hash, 101, (100 * $page), defined $file_name ? ($file_name, "--full-history") : ()); Here you have it (it probably should be a constant; this number can be found in a few other places). Best, -- Jakub Narębski