aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-04-16 17:02:29 -0400
committerJoey Hess <joey@gnu.kitenet.net>2010-04-16 17:02:29 -0400
commitb14f84c4acccbc8450a9102b3b647013989b27bb (patch)
treebc02d7e1c6228775b46040de2945382324a0c4a9 /doc
parent6c5c0f8c682a2727bb71652668fef90a40d99f25 (diff)
downloadikiwiki-b14f84c4acccbc8450a9102b3b647013989b27bb.tar
ikiwiki-b14f84c4acccbc8450a9102b3b647013989b27bb.tar.gz
--gettime revamp
* Rename --getctime to --gettime. (The old name still works for backwards compatability.) * --gettime now also looks up last modification time. * Add rcs_getmtime to plugin API; currently only implemented for git.
Diffstat (limited to 'doc')
-rw-r--r--doc/forum/How_does_ikiwiki_remember_times__63__.mdwn25
-rw-r--r--doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn4
-rw-r--r--doc/plugins/write.mdwn7
-rw-r--r--doc/rcs.mdwn8
-rw-r--r--doc/tips/Importing_posts_from_Wordpress.mdwn2
-rw-r--r--doc/tips/inside_dot_ikiwiki/discussion.mdwn7
-rw-r--r--doc/todo/auto_getctime_on_fresh_build.mdwn8
-rw-r--r--doc/usage.mdwn10
8 files changed, 35 insertions, 36 deletions
diff --git a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn
index 6ce576db1..6b7739fd0 100644
--- a/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn
+++ b/doc/forum/How_does_ikiwiki_remember_times__63__.mdwn
@@ -20,15 +20,17 @@ Do I have it right?
> Some VCS, like git, set the file mtimes to the current time
> when making a new checkout, so they will be lost if you do that.
> The creation times can be retrived using the `--getctime` option.
-> I suppose it might be nice if there were a `--getmtime` that pulled
-> true modification times out of the VCS, but I haven't found it a big
-> deal in practice for the last modification times to be updated to the
-> current time when rebuilding a wiki like this. --[[Joey]]
+> --[[Joey]]
>
> > Thanks for the clarification. I ran some tests of my own to make sure I understand it right, and I'm satisfied
> > that the order of posts in my blog can be retrieved from the VCS using the `--getctime` option, at least if I
> > choose to order my posts by creation time rather than modification time. But I now know that I can't rely on
> > page modification times in ikiwiki as these can be lost permanently.
+>
+> > > Update: It's now renamed to `--gettime`, and pulls both the creation
+> > > and modification times. Also, per [[todo/auto_getctime_on_fresh_build]],
+> > > this is now done automatically the first time ikiwiki builds a
+> > > srcdir. So, no need to worry about this any more! --[[Joey]]
> >
> > I would suggest that there should at least be a `--getmtime` option like you describe, and perhaps that
> > `--getctime` and `--getmtime` be _on by default_. In my opinion the creation times and modification times of
@@ -91,19 +93,6 @@ Do I have it right?
> A quick workaround for me to get modification times right is the following
> little zsh script, which unfortunately only works for git:
- #!/usr/bin/env zsh
-
- set +x
-
- for FILE in **/*(.); do
- TIMES="`git log --pretty=format:%ai $FILE`"
- MTIME="`echo $TIMES | head -n1`"
-
- if [ ! -z $MTIME ]; then
- echo touch -m -d "$MTIME" $FILE
- touch -m -d "$MTIME" $FILE
- fi
-
- done
+>> Elided; no longer needed since --gettime does that, and much faster! --[[Joey]]
> --[[David_Riebenbauer]]
diff --git a/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn b/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn
index fe67e6aba..d7a33b526 100644
--- a/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn
+++ b/doc/forum/Migrating_old_repository_to_new_ikiwiki_system__63__.mdwn
@@ -20,10 +20,6 @@ How do I set up an ikiwiki system using a pre-existing repository (instead of cr
> recreate the ikiwiki srcdir
> 3. `git clone` from the bare git repository a second time,
> to create a checkout you can manually edit (optional)
-> 4. run `ikiwiki --getctime --setup your.setup`
-> The getctime will ensure page creation times are accurate
-> by putting the info out of the git history,
-> and only needs to be done once.
>
> If you preserved your repository, but not the setup file,
> the easiest way to make one is probably to run
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index 707622956..cf7044b2c 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -1085,6 +1085,13 @@ it up in the history.
It's ok if this is not implemented, and throws an error.
+#### `rcs_getmtime($)`
+
+This is used to get the page modification time for a file from the RCS, by
+looking it up in the history.
+
+It's ok if this is not implemented, and throws an error.
+
#### `rcs_receive()`
This is called when ikiwiki is running as a pre-receive hook (or
diff --git a/doc/rcs.mdwn b/doc/rcs.mdwn
index 4e7a8d2a6..b5bfc2414 100644
--- a/doc/rcs.mdwn
+++ b/doc/rcs.mdwn
@@ -14,8 +14,10 @@ use, some advanced or special features are not supported in all of them.
Lack of support in [[ikiwiki-makerepo]] or auto.setup can make it harder to
set up a wiki using that revision control system. The `rcs_commit_staged`
hook is needed to use [[attachments|plugins/attachment]] or
-[[plugins/comments]]. And so on. The table below summarises this for each
-revision control system and links to more information about each.
+[[plugins/comments]]. `rcs_getctime` may be implemented in a fast way
+(ie, one log lookup for all files), or very slowly (one lookup per file).
+And so on. The table below summarises this for each revision control
+system and links to more information about each.
[[!table data="""
feature |[[git]]|[[svn]]|[[bzr]] |[[monotone]]|[[mercurial]]|[[darcs]]|[[tla]] |[[cvs]]
@@ -25,6 +27,8 @@ auto.setup |yes |yes |incomplete|yes |incomplete |yes
`rcs_rename` |yes |yes |yes |yes |no |yes |no |yes
`rcs_remove` |yes |yes |yes |yes |no |yes |no |yes
`rcs_diff` |yes |yes |yes |yes |no |yes |yes |yes
+`rcs_getctime` |fast |slow |slow |slow |slow |slow |slow |slow
+`rcs_getmtime` |fast |no |no |no |no |no |no |no
anonymous push |yes |no |no |no |no |no |no |no
conflict handling |yes |yes |yes |buggy |yes |yes |yes |yes
"""]]
diff --git a/doc/tips/Importing_posts_from_Wordpress.mdwn b/doc/tips/Importing_posts_from_Wordpress.mdwn
index 59330caa4..8774c9723 100644
--- a/doc/tips/Importing_posts_from_Wordpress.mdwn
+++ b/doc/tips/Importing_posts_from_Wordpress.mdwn
@@ -1,6 +1,6 @@
Use case: You want to move away from Wordpress to Ikiwiki as your blogging/website platform, but you want to retain your old posts.
-[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's <tt>--getctime</tt> to get the preserve creation times on checkout.
+[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file. It retains creation time of each post, so you can use Ikiwiki's <tt>--gettime</tt> to get the preserve creation times on checkout.
WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned.
diff --git a/doc/tips/inside_dot_ikiwiki/discussion.mdwn b/doc/tips/inside_dot_ikiwiki/discussion.mdwn
index 34d5b9252..69df369ec 100644
--- a/doc/tips/inside_dot_ikiwiki/discussion.mdwn
+++ b/doc/tips/inside_dot_ikiwiki/discussion.mdwn
@@ -6,14 +6,15 @@ My database appears corrupted:
No idea how this happened. I've blown it away and recreated it but, for future reference, is there any less violent way to recover from this situation? I miss having the correct created and last edited times. --[[sabr]]
> update: fixed ctimes and mtimes using [these instructions](http://u32.net/Mediawiki_Conversion/Git_Import/#Correct%20Creation%20and%20Last%20Edited%20time) --[[sabr]]
-> That's overly complex. Just run `ikiwiki -setup your.setup -getctime`.
+> That's overly complex. Just run `ikiwiki -setup your.setup -gettime`.
> BTW, I'd be interested in examining such a corrupt storable file to try
> to see what happened to it. --[[Joey]]
->> --getctime appears to only set the last edited date. It's not supposed to set the creation date, is it? The only place that info is stored is in the git repo.
+>> --gettime appears to only set the last edited date. It's not supposed to set the creation date, is it? The only place that info is stored is in the git repo.
>>> Pulling the page creation date out of the git history is exactly what
->>> --getctime does. --[[Joey]]
+>>> --gettime does. (It used to be called --getctime, and only do that; now
+>>> it also pulls out the last modified date). --[[Joey]]
>> Alas, I seem to have lost the bad index file to periodic /tmp wiping; I'll send it to you if it happens again. --[[sabr]]
diff --git a/doc/todo/auto_getctime_on_fresh_build.mdwn b/doc/todo/auto_getctime_on_fresh_build.mdwn
index ea95fb8c9..760c56fa1 100644
--- a/doc/todo/auto_getctime_on_fresh_build.mdwn
+++ b/doc/todo/auto_getctime_on_fresh_build.mdwn
@@ -1,9 +1,13 @@
[[!tag wishlist]]
-It might be a good idea to enable --getctime when `.ikiwiki` does not
+It might be a good idea to enable --gettime when `.ikiwiki` does not
exist. This way a new checkout of a `srcdir` would automatically get
-ctimes right. (Running --getctime whenever a rebuild is done would be too
+ctimes right. (Running --gettime whenever a rebuild is done would be too
slow.) --[[Joey]]
Could this be too annoying in some cases, eg, checking out a large wiki
that needs to get set up right away? --[[Joey]]
+
+> Not for git with the new, optimised --getctime. For other VCS.. well,
+> pity they're not as fast as git ;), but it is a one-time expense...
+> [[done]] --[[Joey]]
diff --git a/doc/usage.mdwn b/doc/usage.mdwn
index db1e36a10..553fef01e 100644
--- a/doc/usage.mdwn
+++ b/doc/usage.mdwn
@@ -320,13 +320,11 @@ also be configured using a setup file.
intercepted. If you enable this option then you must run at least the
CGI portion of ikiwiki over SSL.
-* --getctime
+* --gettime
- Pull creation time for each new page out of the revision control
- system. This rarely used option provides a way to get the real creation
- times of items in weblogs, such as when building a wiki from a new
- VCS checkout. It is unoptimised and quite slow. It is best used
- with --rebuild, to force ikiwiki to get the ctime for all pages.
+ Extract creation and modification times for each new page from the
+ the revision control's log. This is done automatically when building a
+ wiki for the first time, so you normally do not need to use this option.
* --set var=value