[pmwiki-users] pruning by version (was pruning page histories)

Patrick R. Michaud pmichaud at pobox.com
Fri Jan 28 10:55:17 CST 2005


On Fri, Jan 28, 2005 at 10:23:52AM -0500, Russ Fink wrote:
> One possible solution is a union heuristic, "if revision older than 
> DiffKeepDays AND this revision number greater than DiffKeepRevs, then prune 
> it."  

Note that there's some potential confusion in that term "revision number".
Some people think of revisions numbers as going forward in history, so that
the first version of a page is revision 1, the second is revision 2, etc.
When looking at page history, however, we often think of revisions
as being "backwards in time", so that revision 1 is the most recent
revision, revision 2 is the next most recent, etc.

At any rate, the original question leading this thread was "make only
the last x amount of changes visible", so I'm assuming that the goal
is to get rid of any revisions greater than X.

However, the union heuristic actually doesn't work here.  As PmWiki's
variable names might indicate -- we're not really deciding what to
prune, we're deciding what to keep.  So, if we phrase the union heuristic
above in terms of what we want to keep instead of what to prune, it reads
"keep a revision if it was made within the last $DiffKeepDays days 
or the last $DiffKeepRevs revisions".

When phrased this way, it's clear that $DiffKeepRevs isn't specifying
a *maximum* number of revisions to keep; it's specifying a *minimum*
number -- which wasn't the original goal at all.  

Keeping revisions for a certain number of days is mutually exclusive
to restricting the maximum number of revisions, you can do one or the other
but not both.  As a result, PmWiki just needs the $DiffKeepDays variable.

> This should cover:
> * pages with highly infrequent edits (1/month or so).
> * pages with malicious edits (your "revision smashing" example above)
> * pages with frequent edits

The current algorithm using only $DiffKeepDays handles each of the above
just fine--adding $DiffKeepRevs doesn't make any improvement.  It
just potentially causes things to be kept beyond the minimum time 
given by $DiffKeepDays.

Pm



More information about the pmwiki-users mailing list