gitweb: Extend project_index file format by project description
Change format of $projects_list file from
<URI-encoded path> SPC <URI-encoded owner> LF
to
<URI-encoded path> SPC \
<URI-encoded owner> [SPC <URI-encoded description>] LF
with optional project description. Please remember that only single line of repository (project) description is supported. Note that SPC can be replaced by any whitespace character.
This change required modifying git_get_projects_list() subroutine (part when $projects_list is a file, and not a directory to be scanned), and git_get_project_description() subroutine.
The 'project_index' action now creates projects list index file in the new format, with project description. Also, it now does only minimal level of escaping / encoding.
While at it, add some comments describing changes and changed subroutines. Update and extend information about $projects_list format in gitweb/README and in gitweb/INSTALL.
---
This is an RFC mainly because I don't know if it wouldn't conflict with Lea Wiemann work on adding caching support to gitweb; if it would, I'll send separately the parts that enhance documentation (modified of course to not include new feature).
The goal is to first, improve performance; and second, to be possible to have single place for all info (well, amost all info) needed to generate projects list.
I plan to submit to contrib small Perl script which would generate projects list given (as argument) $projectroot, with minimal dependencies, and minimal footprint. The question is how to name it...
gitweb/INSTALL | 10 +++++-- gitweb/README | 50 +++++++++++++++++++++++++++++++---- gitweb/gitweb.perl | 74 ++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 112 insertions(+), 22 deletions(-)
gitweb/INSTALL +7 -3
@@ -140,9 +140,13 @@ Gitweb repositories Each line of the projects list file should consist of the url-encoded path to the project repository database (relative to projectroot), followed - by the url-encoded project owner on the same line (separated by a space). - Spaces in both project path and project owner have to be encoded as either - '%20' or '+'. + by the url-encoded project owner on the same line (separated by a space), + and optionally followed by the url-encoded project description (separated + by space). Spaces in project path, project owner and project description + have to be encoded as either '%20' or '+'. Other whitespace (separator), + plus sign '+' (used as replacement for spaces), and percent sign '%' (used + for encoding / escaping) have to be url-encoded, i.e. replaced by '%' + followed by two-digit character number in octal. You can generate the projects list index file using the project_index action (the 'TXT' link on projects list page) directly from gitweb.
gitweb/README +44 -6
74 lines not on this page · raw message
gitweb/gitweb.perl +61 -13
124 lines not on this page · raw message
Signature · 1 line
1.5.6
Quoted 2 lines · Jakub Narebski
This is an RFC mainly because I don't know if it wouldn't conflict with Lea Wiemann work on adding caching support to gitweb;
If you're talking about merge conflicts, it applies fine on my current working copy. (There's trailing whitespace on the "@pr_info =" line, by the way.)
Quoted 3 lines
The goal is to first, improve performance; and second, to be possible to have single place for all info (well, amost all info) needed to generate projects list.
I'm not sure if I understand your objective correctly. If this is exclusively about performance, may I suggest you wait with this till I have implemented caching? Regenerating the project list might end up being fast enough that it won't matter at all; so no reason to complicate the code.
If it's about the convenience of maintaining project descriptions in a central place, sure, that's fine.
-- Lea
Quoted 6 lines · Lea Wiemann
Quoted 4 lines · Jakub Narebski
The goal is to first, improve performance; and second, to be possible to have single place for all info (well, amost all info) needed to generate projects list.
Quoted 8 lines
I'm not sure if I understand your objective correctly. If this is exclusively about performance, may I suggest you wait with this till I have implemented caching? Regenerating the project list might end up being fast enough that it won't matter at all; so no reason to complicate the code.
If it's about the convenience of maintaining project descriptions in a central place, sure, that's fine.
It is about both, but I think mainly about convenience of maintaining (having) all static data about project in one place (well, almost all:
there is README.html, but it is not visible in projects list page).
What we gain in performance generating projects list (when caching is disabled for some reason, like limited quota or/and not installed memcached), we might lose when generating project pages (with project description).
Signature · 2 lines
Jakub Narebski Poland