Subject: Re: [PATCHv2 2/6] gitweb: feed generator metadata

From: Jakub Narebski <[email-masked]>
Date: Fri, 6 Feb 2009 12:21:38 +0100

On Fri, 6 Feb 2009, Giuseppe Bilotta wrote:
> On Thu, Feb 5, 2009 at 12:15 AM, Jakub Narebski <[email-masked]> wrote:
>> On Mon, 26 Jan 2009, Giuseppe Bilotta wrote:
>>
>>> Add <generator> tag to RSS and Atom feed. Versioning info (gitweb/git
>>> core versions, separated by a literal slash) is stored in the
>>> appropriate attribute for the Atom feed, and in the tag content for the
>>> RSS feed.
>>
>> Very good idea. I haven't examined either specification, so I don't
>> know what conventions are used, though... and what conventions _should_
>> be used.
>>
>> By the way, gitweb uses in HTML header the following (see
>> git_header_html subroutine):
>>
>>  <meta name="generator" content="gitweb/$version git/$git_version$mod_perl_version"/>
>>
>> which tries to follow convention how _web servers_ like Apache return
>> version information in the 'Server:' HTTP response header (product
>> tokens). Because it was used on only one place, it was not put into
>> separate subroutine; should it now?
> 
> RSS 2.0 spec for generator @
> http://cyber.law.harvard.edu/rss/rss.html#optionalChannelElements
> seems to suggest that the content for the tag in RSS feeds is pretty
> much free-form and we might use the same string we have in HTML pages.
> Requirements for Atom (see
> http://www.atomenabled.org/developers/syndication/atom-format-spec.php#element.generator
> ) are rather more stringent, so it needs its own code anyway.

I don't see there in given above Atom spec _how_ 'version' attribute
should be formatted. Here is relevant excerpt from mentioned page:

  4.2.4 The "atom:generator" Element

  The "atom:generator" element's content identifies the agent used
  to generate a feed, for debugging and other purposes.
  [...]

  The content of this element, when present, MUST be a string that
  is a human-readable name for the generating agent.
  [...]

  The atom:generator element MAY have a "version" attribute that
  indicates the version of the generating agent.

So why not use something like:

  <generator version="gitweb/$version git/$git_version$mod_perl_version">
  gitweb v$version</generator>
 
for Atom? Perhaps with 'Server:'-like version generation refactored
to its own subroutine?

>>> +             print "<generator>gitweb v.$version/$git_version</generator>\n";
>>>       } elsif ($format eq 'atom') {

>>> +             print "<generator version='$version/$git_version'>gitweb</generator>\n";

-- 
Jakub Narebski
Poland