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

Re: [PATCHv2 4/6] gitweb: rss channel date

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Feb 6, 2009, 11:10 UTC
Message-ID
<cb7bb73a0902060310s3fa19788t7f4ad0d39928d77@mail.gmail.com>
In-Reply-To
<200902050024.43634.jnareb@gmail.com>
On Thu, Feb 5, 2009 at 12:24 AM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 14 quoted lines
> On Mon, 26 Jan 2009, Giuseppe Bilotta wrote:
>
>> The RSS 2.0 specifications defines not one but _two_ dates for its
>> channel element! Woohoo! Luckily, it seems that consensus seems to be
>> that if both are present they should be equal, except for some very
>> obscure and discouraged cases. Since lastBuildDate would make more sense
>> for us and pubDate seems to be the most commonly used, we defined both
>> and make them equal.
>
> Perhaps it would make sense to quote RSS 2.0 standard format here
> in the commit message, e.g.:
>
>  pubDate        The publication date for the content in the channel.
>  lastBuildDate  The last time the content of the channel changed.

That sort of spoils the very non-technical tone of the message, but you're probably right 8-D

Show 20 quoted lines
>> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>> ---
>>  gitweb/gitweb.perl |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
>> index cc6d0fb..756868a 100755
>> --- a/gitweb/gitweb.perl
>> +++ b/gitweb/gitweb.perl
>> @@ -6087,6 +6087,10 @@ XML
>>                             "<link>$alt_url</link>\n" .
>>                             "</image>\n";
>>               }
>> +             if (%latest_date) {
>> +                     print "<pubDate>$latest_date{'rfc2822'}</pubDate>\n";
>> +                     print "<lastBuildDate>$latest_date{'rfc2822'}</lastBuildDate>\n";
>> +             }
>
> I think it is good approximation of intended meaning of those two
> elements.

However, this is still not perfect. While this is absolutely fine for rss feeds that point at an explicit commit hash, rss feeds that point to a dynamic ref (some branch head or whatever) can get an interesting but confusing situation:

A updates his local clone of the repo.
B gets the feed of the repo, which is not updated to include A changes.
A pushes.

B gets the feed: the dates are actually BEFORE the date he last retrieved the feed, although they are after the date shown the last time he retrieved the feed.

Ideally, when the rss is publishing a dynamic ref, we should as buildDate (and as Last-modified: HTTP header!) the date when the ref was changed (e.g. the date of the push). However, I couldn't really think of a robust way of getting such a date, which is why I'm using the commit date which is what comes closest.

-- 
Giuseppe "Oblomov" Bilotta
Previous: Jakub NarebskiNext: Jakub Narebski
Message 24 of 37 in “[PATCHv2 0/6] gitweb: feed metadata enhancements”
  1. Giuseppe BilottaJan 26, 2009
  2. 1/6 gitweb: channel image in rss feedGiuseppe Bilotta, Jan 26, 2009
  3. 2/6 gitweb: feed generator metadataGiuseppe Bilotta, Jan 26, 2009
  4. 3/6 gitweb: rss feed managingEditorGiuseppe Bilotta, Jan 26, 2009
  5. 4/6 gitweb: rss channel dateGiuseppe Bilotta, Jan 26, 2009
  6. 5/6 gitweb: last-modified time should be commiter, not authorGiuseppe Bilotta, Jan 26, 2009
  7. 6/6 gitweb: check if-modified-since for feedsGiuseppe Bilotta, Jan 26, 2009
  8. Jakub NarebskiFeb 5, 2009
  9. Giuseppe BilottaFeb 6, 2009
  10. Jakub NarebskiFeb 4, 2009
  11. Giuseppe BilottaFeb 6, 2009
  12. Jakub NarebskiFeb 6, 2009
  13. Giuseppe BilottaFeb 6, 2009
  14. Deskin MillerFeb 11, 2009
  15. Giuseppe BilottaFeb 11, 2009
  16. Jakub NarebskiFeb 11, 2009
  17. Giuseppe BilottaFeb 11, 2009
  18. Deskin MillerFeb 12, 2009
  19. Jakub NarebskiFeb 12, 2009
  20. Giuseppe BilottaFeb 12, 2009
  21. Jakub NarebskiFeb 12, 2009
  22. Giuseppe BilottaFeb 12, 2009
  23. Jakub NarebskiFeb 4, 2009
  24. Giuseppe BilottaFeb 6, 2009
  25. Jakub NarebskiFeb 4, 2009
  26. Giuseppe BilottaFeb 6, 2009
  27. Jakub NarebskiFeb 4, 2009
  28. Giuseppe BilottaFeb 6, 2009
  29. Jakub NarebskiFeb 6, 2009
  30. Jakub NarebskiFeb 4, 2009
  31. Giuseppe BilottaFeb 6, 2009
  32. Junio C HamanoJan 28, 2009
  33. Jakub NarebskiJan 28, 2009
  34. Giuseppe BilottaJan 28, 2009
  35. Junio C HamanoJan 28, 2009
  36. Jakub NarebskiFeb 6, 2009
  37. Junio C HamanoFeb 7, 2009

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.