threads / discuss / 29618

GitWeb and atom feed links

Subject: GitWeb and atom feed links

## tl;dr

2 messages between Feb 13, 2012 and Feb 13, 2012.

replies: 1people: 2as markdown or json

Heiko W. Rupp· Feb 13, 2012, 20:43 UTC · lore
Hi,
( got this email from Junio )

when you e.g. look at http://git.kernel.org/?p=git/git.git;a=summary and then the lower right, there are two buttons for feeds. If you click on e.g. atom, you end up with an url of http://git.kernel.org/?p=git/git.git;a=atom where the output is not a feed in atom format, but plain html with tables etc.

If you change the url to http://git.kernel.org/?p=git/git.git&a=atom
the output is a correct atom feed (same for rss).
I've traced it down in my copy of gitweb to 
sub git_footer_html {
...
                     $href_params{'action'} = lc($format);
                      print $cgi->a({-href => href(%href_params),
                                    -title => "$href_params{'-title'} $format feed",
                                    -class => $feed_class}, $format)."\n";
and here to the usage of href()
Locally I've modified that to 
                     $href_params{'action'} = lc($format);
                      my $hr = "?p=$project&a="; 
                      $hr .= lc($format);
                      print $cgi->a({-href => $hr,
                                    -title => "$href_params{'-title'} $format feed",
                                    -class => $feed_class}, $format)."\n";
and it works.
Attached is a patch against current master that reflects above change
   Heiko
-- 
Heiko Rupp   hwr@pilhuhn.de
Blog: http://javablogs.com/ViewBlog.action?id=14468
Jakub Narebski· Feb 13, 2012, 22:17 UTC · re: Heiko W. Rupp · lore

Re: GitWeb and atom feed links

Heiko W. Rupp wrote:
> 
> when you e.g. look at http://git.kernel.org/?p=git/git.git;a=summary
> and then the lower right, there are two buttons for feeds.
Yes, [Atom] and [RSS], for different formats of the same feed.
Show 7 quoted lines
> If you click on e.g. atom, you end up with an url of
> http://git.kernel.org/?p=git/git.git;a=atom  
> where the output is not a feed in atom format, but plain html with
> tables etc. 
> 
> If you change the url to http://git.kernel.org/?p=git/git.git&a=atom
> the output is a correct atom feed (same for rss).

I don't know what is the source of bug you are seeing; I suspect some trouble with output caching that git.kernel.org fork of gitweb has added, but this isn't it. Those two forms of 'atom' URL are equivalent.

Wikipedia says in  http://en.wikipedia.org/wiki/Query_string:
 "* The query string is composed of a series of field-value pairs.
  * The field-value pairs are each separated by an equals sign. The
    equals sign may be omitted if the value is an empty string.
  * The series of pairs is separated by the ampersand, '&' or
    semicolon, ';'.
  [...]
  W3C recommends that all web servers support semicolon separators
  in the place of ampersand separators.[4]"
[4]: http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2
 "B.2.2 Ampersands in URI attribute values
  ----------------------------------------
  The URI that is constructed when a form is submitted may be used as an
  anchor-style link (e.g., the href attribute for the A element).
  Unfortunately, the use of the "&" character to separate form fields
  interacts with its use in SGML attribute values to delimit character
  entity references. For example, to use the URI "http://host/?x=1&y=2"
  as a linking URI, it must be written <A href="http://host/?x=1&#38;y=2">
  or <A href="http://host/?x=1&amp;y=2">.
  We recommend that HTTP server implementors, and in particular, CGI
  implementors support the use of ";" in place of "&" to save authors
  the trouble of escaping "&" characters in this manner."
CGI(3pm) says:
 "-newstyle_urls
      Separate the name=value pairs in CGI parameter query strings with semi-
      colons rather than ampersands.  For example:
          ?name=fred;age=24;favorite_color=3
      Semicolon-delimited query strings are always accepted, and will be
      emitted by self_url() and query_string(). newstyle_urls became the
      default in version 2.64."
-- 
Jakub Narebski
Poland

← back to recent threads