From 6042e607f33966279f1360d42e46dd0bf7e439e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 20 Dec 2008 18:51:09 -0500 Subject: alternate idea --- doc/todo/comments.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/todo/comments.mdwn b/doc/todo/comments.mdwn index 3a18d63b8..12aef0bb3 100644 --- a/doc/todo/comments.mdwn +++ b/doc/todo/comments.mdwn @@ -31,6 +31,13 @@ Known issues with the [[plugins/comments]] plugin: >>> The new code produces links like /wikiisons/openid.png, which >>> fail if ikiwiki is not at the root of the web server. --[[Joey]] + >>> I got to wondering if the icons are needed. On my comments branch + >>> (not master), I've dropped the icons and info can be seen by hovering + >>> over the author's name. Idea being that you probably don't care how + >>> they authenticated unless something is weird, and in that case you + >>> can hover to check. Does that make sense, should I merge it? + >>> --[[Joey]] + * Should the comments be visually set off more from the page above? Rather than just a horizontal rule, I'm thinking put the comments in a box like is used for inlined pages. -- cgit v1.2.3 From faa01bd43243e789b92579a83a3e96c363ae096c Mon Sep 17 00:00:00 2001 From: "http://dtrt.org/" Date: Sat, 20 Dec 2008 19:36:15 -0500 Subject: Sort paramater not a problem; Revised steps to reprodce --- .../inline_sort_order_and_meta_date_value.mdwn | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn index 79d17ada2..ce87f9acb 100644 --- a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -57,3 +57,30 @@ out the sort option. --[[Joey]] return sprintf(gettext("unknown sort type %s"), $params{sort}); } +> On further testing, I find that the bug is limited to the first time +> creation time should be used and has nothing to do with setting the sort +> parameter. Revised steps to reproduce: --[David A. Harding](http://dtrt.org), 2008-12-20 +> +> 1. Create pages that sort different by mtime and ctime +> +> 2. inline pages="somepages/*" +> +> 3. ikiwiki --setup setup_file +> +> 4. Pages are output incorrectly in mtime order +> +> 5. ikiwiki --setup setup_file +> +> 6. Pages are output correctly in ctime order +> +> 7. Create new page in somepages/, set its ctime to earlier than another +> page in sompages/ +> +> 8. ikiwiki --setup setup_file +> +> 9. All previously sorted pages output correctly in ctime order but new +> page is output incorrectly at the top as if its mtime was its ctime +> +> 10. ikiwiki --setup setup_file +> +> 11. All pages, including new page, are output correctly in ctime order -- cgit v1.2.3 From 155ebc3dbdcb265d5afa61fd46b20bf2fd9387fb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 20 Dec 2008 20:27:42 -0500 Subject: response --- doc/bugs/inline_sort_order_and_meta_date_value.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn index ce87f9acb..d851ef397 100644 --- a/doc/bugs/inline_sort_order_and_meta_date_value.mdwn +++ b/doc/bugs/inline_sort_order_and_meta_date_value.mdwn @@ -84,3 +84,18 @@ out the sort option. --[[Joey]] > 10. ikiwiki --setup setup_file > > 11. All pages, including new page, are output correctly in ctime order + +You're confusing ctime and creation time. This is perhaps not suprising, as +ikiwiki uses the term 'ctime' to refer to creation time. However, the unix +ctime value is not the same thing. Unix ctime can change if a file changes +owner, or in some cases, permissions. Unix ctime also always changes +when the file is modified. Ikiwiki wants a first creation date of the file, +and it accomplishes this by recording the initial ctime of a file the first +time it processes it, and *preserving* that creation time forever, ignoring +later ctime changes. + +I suspect that this, coupled with the fact that ikiwiki sorts newest pages +first, explains everything you describe. If not, please send me a shell script +test case I can run, as instructions like "Create pages that sort different by +mtime and ctime" are not ones that I know how to follow (given that touch sets +*both*). --[[Joey]] -- cgit v1.2.3 From c53a3a1d3e028e4f27acb661cc19341a13801c2b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 20 Dec 2008 20:55:38 -0500 Subject: avoid storing transient state in pagestate None of the comment state needs to be stored through the a later run of ikiwiki, so move it all from pagestate to a more transient storage. This is assuming that we'll never want to add pagespecs to search against the comment state. Pagespecs like author() are why the meta plugin does store its meta data in pagestate -- the data can be needed later to match against. --- IkiWiki/Plugin/comments.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 4f3b76db3..644ef1be8 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -16,6 +16,7 @@ use constant POST_COMMENT => "Post comment"; use constant CANCEL => "Cancel"; my $postcomment; +my %commentstate; sub import { hook(type => "checkconfig", id => 'comments', call => \&checkconfig); @@ -152,7 +153,6 @@ sub preprocess { my $commentauthor; my $commentauthorurl; my $commentopenid; - if (defined $params{username}) { $commentuser = $params{username}; @@ -181,11 +181,11 @@ sub preprocess { $commentauthor = gettext("Anonymous"); } - $pagestate{$page}{comments}{commentuser} = $commentuser; - $pagestate{$page}{comments}{commentopenid} = $commentopenid; - $pagestate{$page}{comments}{commentip} = $commentip; - $pagestate{$page}{comments}{commentauthor} = $commentauthor; - $pagestate{$page}{comments}{commentauthorurl} = $commentauthorurl; + $commentstate{$page}{commentuser} = $commentuser; + $commentstate{$page}{commentopenid} = $commentopenid; + $commentstate{$page}{commentip} = $commentip; + $commentstate{$page}{commentauthor} = $commentauthor; + $commentstate{$page}{commentauthorurl} = $commentauthorurl; if (! defined $pagestate{$page}{meta}{author}) { $pagestate{$page}{meta}{author} = $commentauthor; } @@ -570,27 +570,27 @@ sub pagetemplate (@) { if ($template->query(name => 'commentuser')) { $template->param(commentuser => - $pagestate{$page}{comments}{commentuser}); + $commentstate{$page}{commentuser}); } if ($template->query(name => 'commentopenid')) { $template->param(commentopenid => - $pagestate{$page}{comments}{commentopenid}); + $commentstate{$page}{commentopenid}); } if ($template->query(name => 'commentip')) { $template->param(commentip => - $pagestate{$page}{comments}{commentip}); + $commentstate{$page}{commentip}); } if ($template->query(name => 'commentauthor')) { $template->param(commentauthor => - $pagestate{$page}{comments}{commentauthor}); + $commentstate{$page}{commentauthor}); } if ($template->query(name => 'commentauthorurl')) { $template->param(commentauthorurl => - $pagestate{$page}{comments}{commentauthorurl}); + $commentstate{$page}{commentauthorurl}); } } -- cgit v1.2.3