summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Rcs/Stub.pm1
-rw-r--r--IkiWiki/Rcs/git.pm4
-rw-r--r--IkiWiki/Rcs/mercurial.pm2
-rw-r--r--IkiWiki/Rcs/monotone.pm2
-rw-r--r--IkiWiki/Rcs/svn.pm3
-rw-r--r--IkiWiki/Rcs/tla.pm3
-rw-r--r--doc/bugs/git_mail_notification_race.mdwn9
-rw-r--r--doc/todo/recentchanges.mdwn57
8 files changed, 75 insertions, 6 deletions
diff --git a/IkiWiki/Rcs/Stub.pm b/IkiWiki/Rcs/Stub.pm
index 19ecfa88d..a979ce3fe 100644
--- a/IkiWiki/Rcs/Stub.pm
+++ b/IkiWiki/Rcs/Stub.pm
@@ -37,6 +37,7 @@ sub rcs_recentchanges ($) {
# Examine the RCS history and generate a list of recent changes.
# The data structure returned for each change is:
# {
+ # id => # the RCSs id for this commit
# user => # name of user who made the change,
# committype => # either "web" or the name of the rcs,
# when => # time when the change was made,
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
index 98c9a5eae..9640acfbe 100644
--- a/IkiWiki/Rcs/git.pm
+++ b/IkiWiki/Rcs/git.pm
@@ -407,7 +407,7 @@ sub rcs_recentchanges ($) { #{{{
}
push @rets, {
- rev => $sha1,
+ id => $sha1,
user => $user,
committype => $type,
when => $when,
@@ -441,7 +441,7 @@ sub rcs_notify () { #{{{
my ($user, $message);
if (@{ $ci->{'comment'} }[0] =~ m/$config{web_commit_regexp}/) {
- $user = defined $2 ? "$2" : "$3";
+ $user = defined $2 ? $2 : $3;
$message = $4;
}
else {
diff --git a/IkiWiki/Rcs/mercurial.pm b/IkiWiki/Rcs/mercurial.pm
index 15edb3245..e5258b111 100644
--- a/IkiWiki/Rcs/mercurial.pm
+++ b/IkiWiki/Rcs/mercurial.pm
@@ -139,7 +139,7 @@ sub rcs_recentchanges ($) { #{{{
$user =~ s/^\s*//;
push @ret, {
- rev => $info->{"changeset"},
+ id => $info->{"changeset"},
user => $user,
committype => "mercurial",
when => time - str2time($info->{"date"}),
diff --git a/IkiWiki/Rcs/monotone.pm b/IkiWiki/Rcs/monotone.pm
index 5717e0043..e0f2e046a 100644
--- a/IkiWiki/Rcs/monotone.pm
+++ b/IkiWiki/Rcs/monotone.pm
@@ -438,7 +438,7 @@ sub rcs_recentchanges ($) { #{{{
}
push @ret, {
- rev => $rev,
+ id => $rev,
user => $user,
committype => $committype,
when => $when,
diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm
index 987469ba0..a32b0a840 100644
--- a/IkiWiki/Rcs/svn.pm
+++ b/IkiWiki/Rcs/svn.pm
@@ -203,7 +203,8 @@ sub rcs_recentchanges ($) { #{{{
diffurl => $diffurl,
} if length $file;
}
- push @ret, { rev => $rev,
+ push @ret, {
+ id => $rev,
user => $user,
committype => $committype,
when => $when,
diff --git a/IkiWiki/Rcs/tla.pm b/IkiWiki/Rcs/tla.pm
index 1dbc006c1..5275500c3 100644
--- a/IkiWiki/Rcs/tla.pm
+++ b/IkiWiki/Rcs/tla.pm
@@ -145,7 +145,8 @@ sub rcs_recentchanges ($) {
diffurl => $diffurl,
} if length $file;
}
- push @ret, { rev => $change,
+ push @ret, {
+ id => $change,
user => $user,
committype => $committype,
when => $when,
diff --git a/doc/bugs/git_mail_notification_race.mdwn b/doc/bugs/git_mail_notification_race.mdwn
index eddc0181e..3538b0764 100644
--- a/doc/bugs/git_mail_notification_race.mdwn
+++ b/doc/bugs/git_mail_notification_race.mdwn
@@ -44,3 +44,12 @@ edits. At least one of the two commits has to be a non-web commit.
A related problem is that if two commits are made separately but then
pushed in together, the commit code only looks at the HEAD commit, which
is the second one. No notification is sent for the first.
+
+----
+
+Based on all of these problems with using the post-update hook, ikiwiki
+should be changed to use the post-receive hook, which provides enough
+information to avoid the assumuptions that led to these problems.
+Transitioning existing wikis to using a new hook will be interesting. Also,
+this hook is only present in git >= 1.5.0.7.
+--[[Joey]]
diff --git a/doc/todo/recentchanges.mdwn b/doc/todo/recentchanges.mdwn
index d46c0d9a8..bdd7948e4 100644
--- a/doc/todo/recentchanges.mdwn
+++ b/doc/todo/recentchanges.mdwn
@@ -86,3 +86,60 @@ your pages. --Ethan
> backend.
>
> -- CharlesMauch
+
+----
+
+Here's a full design for redoing recentchanges, based on Ethan's ideas:
+
+* Add a recentchanges plugin that has a preprocessor directive:
+ \[[recentchanges num=100 pages=* template=recentchanges.tmpl]]
+ If put on the [[recentchanges]] page, this would result in up to 100
+ recentchanges/change_$id.mdwn files being created.
+* Which means the plugin has to store state and use a checkconfig hook
+ or the like to create the requested pages (and delete old ones) when
+ the wiki is rebuilt and when the post_commit hook is run.
+* Then it's a simple matter of using inline on the recentchanges page
+ to display the changes. (With a special template to display nicely.)
+* Rss/atom comes for free..
+* So drop mail notifications.
+* If someone wants to subscribe to notifications for only a subset
+ of pages, they can either filter the recentchanges in their rss
+ aggregator, or they can set up their own page that uses the recentchanges
+ directive for only the pages they want.
+* The `rcs_notify` functions will be removed.
+* `rcs_getchange` is passed a change id (as returned from rcs_recentchanges)
+ and a partially filled out HTML::Template and fills out the remainer of the
+ template. So if a template is used that includes diffs, it will need to run
+ some expensive diffing operation, wikis with less resources can use a
+ template that doesn't include diffs and avoid that overhead.
+* So to update the changes files, just call `rcs_recentchanges`, create
+ files for each new id, and delete files for each id that is no longer
+ included.
+* The cgi support for recentchanges can be dropped, or moved to a different
+ plugin.
+
+I'm unsure how fast this will all be, but by using regular pages, there's
+cacheing, at least. The main slowdown might turn out to be the inlining and
+not the generation of the changes pages. The current cgi recentchanges
+code saves a tenth of a second or so by memoizing htmllink, an optimisation
+that won't be available when using the more general inlining code.
+
+An obvious optimisation, and one implied by this design, is that each change
+file is only written once. This assumes that the data in them doesn't ever
+change, which actually isn't true (svn commit messages can be changed), but
+is probably close enough to true for our purposes.
+
+Another optimisation would be to htmlize the change files when they're
+written out -- avoids re-rendering a given file each time a new change is
+made (thus doing 1/100th the work).
+
+Links in the change files to the changed pages will need special handling.
+These links should not generate backlinks. They probably shouldn't be
+implemented as wikiliks at all. Instead, they should be raw, absolute
+html links to the pages that were changed.
+
+Only problem with this approach is that the links break if the changed
+page later gets deleted. I think that's acceptable. It could link to
+`ikiwiki.cgi?do=redir&page=foo`, but that's probably overkill.
+
+--[[Joey]]