]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/pagemtime_in_refresh_mode.mdwn
Guessed right, but practically wrong => let's clear the mess and fix things up?
[ikiwiki.git] / doc / bugs / pagemtime_in_refresh_mode.mdwn
1 I'd like a way to always ask the RCS (Git) to update a file's mtime in
2 refresh mode.  This is currently only done on the first build, and later
3 for `--gettime --rebuild`.  But always rebuilding is too heavy-weight for
4 this use-case.  My options are to either manually set the mtime before
5 refreshing, or to have ikiwiki do it at command.  I used to do the
6 former, but would now like the latter, as ikiwiki now generally does this
7 timestamp handling.
8
9 From a quick look, the code in `IkiWiki/Render.pm:find_new_files` is
10 relevant: `if (! $pagemtime{$page}) { [...]`.
11
12 How would you like to tackle this?
13
14 --[[tschwinge]]
15
16 > This could be done via a `needsbuild` hook. The hook is passed 
17 > the list of changed files, and it should be safe to call `rcs_getmtime`
18 > and update the `pagemtime` for each.
19
20 > That lets the feature be done by a plugin, which seems good, since
21 > `rcs_getmtime` varies between very slow and not very fast, depending on 
22 > VCS.
23
24 > AFAICS, the only use case for doing this is if you commit changes and
25 > then delay pushing them to a DVCS repo. Since then the file mtime will
26 > be when the change was pushed, not when it was committed. But I've
27 > generally felt that recording when a change was published to the repo
28 > of a wiki as its mtime is good enough. --[[Joey]]