* GitWeb and atom feed links
@ 2012-02-13 20:43 Heiko W. Rupp
2012-02-13 22:17 ` Jakub Narebski
0 siblings, 1 reply; 2+ messages in thread
From: Heiko W. Rupp @ 2012-02-13 20:43 UTC (permalink / raw)
To: git; +Cc: jnareb
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GitWeb and atom feed links
2012-02-13 20:43 GitWeb and atom feed links Heiko W. Rupp
@ 2012-02-13 22:17 ` Jakub Narebski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Narebski @ 2012-02-13 22:17 UTC (permalink / raw)
To: Heiko W. Rupp; +Cc: git
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.
> 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&y=2">
or <A href="http://host/?x=1&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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-13 22:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-13 20:43 GitWeb and atom feed links Heiko W. Rupp
2012-02-13 22:17 ` Jakub Narebski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).