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

Re: [PATCH] gitweb: snapshot cleanups & support for offering multiple formats

From
Jakub Narebski <jnareb@gmail.com>
Date
Jul 19, 2007, 09:05 UTC
Message-ID
<200707191105.19735.jnareb@gmail.com>
In-Reply-To
<7vvech42nb.fsf@assigned-by-dhcp.cox.net>
On Thu, 19 July 2007, Junio C Hamano wrote:
Show 23 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> On Tue, 17 July 2007, Matt McCutchen napisał:
>> ...
>>> Alert for gitweb site administrators: This patch changes the format of
>>> $feature{'snapshot'}{'default'} in gitweb_config.perl from a list of
>>> three pieces of information about a single format to a list of one or
>>> more formats you wish to offer from the set ('tgz', 'tbz2', 'zip').
>>> Update your gitweb_config.perl appropriately.  The preferred names for
>>> gitweb.snapshot in repository configuration have also changed from
>>> 'gzip' and 'bzip2' to 'tgz' and 'tbz2', but the old names are still
>>> recognized for compatibility.
>>
>> This alert/warning should probably be put in RelNotes for when it would
>> be in git.git
> 
> Does anybody else worry about the backward imcompatibility, I
> wonder...  List?
> 
> I really hate to having to say something like that in the
> RelNotes.  I do not think this is a good enough reason to break
> existing configurations; I would not want to be defending that
> change.
[...]
> I am wondering if something like this patch (totally untested,
> mind you) to convert the old style %feature in configuration at
> the site at runtime would be sufficient.

Would it be sufficient to put above alert/warning in commit message, RelNotes and gitweb/INSTALL (or gitweb/README), and add rule to Makefile to convert old configuration, or at least check if GITWEB_CONFIG uses old snapshot configuration? This way if somebody is installing/upgrading gitweb by hand he/she would know what needs possibly to be changes, and if somebody uses "make gitweb/gitweb.cgi" he would get big fat warning, and info how to convert gitweb config.

By the way, I think it was a mistake to use different syntax in the %feature hash ([content-encoding, suffix, program]) than in repo config override (name).

Besides the proposed patch incurs performance penalty for all feature checks, not only for snapshot. I think it could be solved by using a hack of providing more aliases, so that 'gzip' (repo config) but also 'x-gzip', 'gz' and 'gzip' (gitweb config) would be aliases to 'tgz' snapshot, and we would perform "uniq" on the list of snapshot formats (assuming it is sorted). Or make 'x-gzip' and 'gz' aliases into undef, so 'gzip' from old configuration would be aliased to the new format name 'tgz'. What do you think about this?

Ooops, this has disadvantage of having to guess what could be put in the gitweb config regarding snapshot configuration, but I think we could assume that only the values enumerated in the old feature_snapshot would be used.

All said, I think it is a good change. I guess that gitweb admins would want to provide both tgz/tar.gz archives for the Unix crowd, and zip archives for MS Windows users...

P.S. I wonder why git-archive does not support tgz format. Git is linked to zlib, so...

-- 
Jakub Narebski
Poland
Previous: Jakub NarebskiNext: Junio C Hamano
Message 20 of 35 in “gitweb: snapshot cleanups & support for offering multiple formats”
  1. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jun 28, 2007
  2. Junio C HamanoJul 7, 2007
  3. Junio C HamanoJul 8, 2007
  4. Jakub NarebskiJul 11, 2007
  5. Junio C HamanoJul 11, 2007
  6. Matt McCutchenJul 12, 2007
  7. Jakub NarebskiJul 12, 2007
  8. Matt McCutchenJul 17, 2007
  9. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 17, 2007
  10. Jakub NarebskiJul 18, 2007
  11. Junio C HamanoJul 19, 2007
  12. Luben TuikovJul 19, 2007
  13. Jakub NarebskiJul 19, 2007
  14. Luben TuikovJul 19, 2007
  15. gitweb: Enable transparent compression form HTTP outputJakub Narebski, Jul 25, 2007
  16. Petr BaudisAug 25, 2007
  17. Jakub NarebskiAug 25, 2007
  18. Petr BaudisAug 25, 2007
  19. Jakub NarebskiAug 27, 2007
  20. Jakub NarebskiJul 19, 2007
  21. Junio C HamanoJul 20, 2007
  22. Jakub NarebskiJul 19, 2007
  23. gitweb: snapshot cleanups & support for offering multiple formatsJakub Narebski, Jul 21, 2007
  24. Junio C HamanoJul 22, 2007
  25. Matt McCutchenJul 22, 2007
  26. gitweb: Fix support for legacy gitweb config for snapshotsJakub Narebski, Jul 22, 2007
  27. Matt McCutchenJul 22, 2007
  28. Junio C HamanoJul 22, 2007
  29. Junio C HamanoJul 8, 2007
  30. Matt McCutchenJul 9, 2007
  31. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 9, 2007
  32. Jakub NarebskiJul 10, 2007
  33. Junio C HamanoJul 9, 2007
  34. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 10, 2007
  35. gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen, Jul 10, 2007

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.