esc_html does to_utf8, so to_utf8 is unnecessary (and spurious).
Two unnecessary calls to git command. Use
my %difftree = parse_difftree_raw_line($line)
instead. The conditions would probably be
next if (!$difftree{'from_id'});
esc_url, not esc_html here. Or use the href() subroutine with -full=>1
option (after applying the patch I send which added this to href()).P.S. Please reply also to git mailing list.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git-
That's ok for rendered HTML output, but in my experience, the way feed
readers interpret that ranges from "badly" to "not at all"; it's better
to stick to explicit structure hints only in feeds. /-:I can see that, but it would be very useful on aggregation sites like
http://planet.sbcl.org/. You mentioned on IRC that you'd prefer to
forward-port the current RSS generation to a more modern feed format
like Atom 1.0.I took the liberty to back out that change from the RSS generator, and
implement Atom 1.0 output that is more fully featured. For testing, I
left both in. Both feeds validate at feedvalidator.org for me, theThanks for the hint; I included that in the Atom output and re-worked
Okay; I changed all occurrences of esc_html where URLs are escaped to
use esc_url.In addition to the above points, the attached patch emits a
Last-Changed: HTTP response header field, and doesn't compute the feed
body if the HTTP request type was HEAD. This helps keep the web server
load down for well-behaved feed readers that check if the feed needs
updating.Hope you like it,
--
Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs
Seems sane to me. Jakub, how do you like this one? If it looks
Ok to you, please arrange to include your one-liner that this
depends on and forward a readily applicable patch with
appropriate commit log message.-
True. "<pre>" in RSS feed is better (I don't know if you can give CSS
Which one liner? As far as I can see the patch does NOT use
href(-full=>1,...) but esc_url(...).Perhaps this is for next patch.
BTW I have encountered something calles Atom Publishing Protocol (APP):
perhaps we should also add this in addition to currently used OPML.
--
Jakub Narebski
Torun, Poland
ShadeHawk on #git
-
href subroutine by default generates absolute URL (generated using
CGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base;
add an option to generate full URL using $my_url as base.New feature usage: href(..., -full=>1)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 5875ba0..8739501 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -459,7 +459,8 @@ exit;sub href(%) {
my %params = @_;
- my $href = $my_uri;
+ # default is to use -absolute url() i.e. $my_uri
+ my $href = $params{-full} ? $my_url : $my_uri;# XXX: Warning: If you touch this, check the search form for updating,
# too.
--
1.4.3.4-
Add support for more modern Atom web feed format. Both RSS and Atom
feeds are generated by git_feed subroutine to avoid code duplication;
git_rss and git_atom are thin wrappers around git_feed. Add links to
Atom feed in HTML header and in page footer (but not in OPML; we
should use APP, Atom Publishing Proptocol instead).Allow for feed generation for branches other than current (HEAD)
branch, and for generation of feeds for file or directory history.Do not use "pre ${\sub_returning_scalar(...)} post" trick, but join
strings instead: "pre " . sub_returning_scalar(...) . " post".
Use href(-full=>1, ...) instead of hand-crafting gitweb urls.Make output prettier:
* Use title similar to the title of web page
* Use project description (if exists) for description/subtitle
* Do not add anything (committer name, commit date) to feed entry title
* Wrap the commit message in <pre>
* Make file names into an unordered list
* Add links (diff, conditional blame, history) to the file list.In addition to the above points, the attached patch emits a
Last-Changed: HTTP response header field, and doesn't compute the feed
body if the HTTP request type was HEAD. This helps keep the web server
load down for well-behaved feed readers that check if the feed needs
updating.If browser (feed reader) sent Accept: header, and it prefers 'text/xml' type
to 'application/rss+xml' (in the case of RSS feed) or 'application/atom+xml'
(in the case of Atom feed), then use 'text/xml' as content type.Both RSS and Atom feeds validate at http://feedvalidator.org
and at http://validator.w3.org/feed/Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Andreas Fuchs <asf@boinkor.net>
---
Compared to implementation by Andreas Fuchs (antifuchs on #git) in
Message-ID: <ejim5q$31b$1@sea.gmane.org>
http://permalink.gmane.org/gmane.comp.version-control.git/31624
this consolidates generation of RSS and Atom feeds, cleans up feed
generation code, and uses 'text/xml' as ...
| Benjamin Herrenschmidt | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Mariusz Kozlowski | [PATCH 03] drivers/sbus/char/bbc_envctrl.c: kmalloc + memset conversion to kzalloc |
| Yinghai Lu | [PATCH 02/16] x86: introduce nr_irqs for 64bit v3 |
git: | |
| Gerrit Renker | [PATCH 13/37] dccp: Deprecate Ack Ratio sysctl |
| James Morris | Re: [GIT]: Networking |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
