aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-05-05 16:23:47 -0400
committerJoey Hess <joey@kitenet.net>2011-05-05 16:23:47 -0400
commite3596dbaecb69711616b7bf3b3ef363ee5929293 (patch)
tree35fc13cc2e780ec91f8cfd413687fc57eb93b085
parent4a27adfa72b66dea7972a1e6d946655da6882e72 (diff)
parent01783bacf854f6daa0771dba10e859f46a3ccc9c (diff)
downloadikiwiki-e3596dbaecb69711616b7bf3b3ef363ee5929293.tar
ikiwiki-e3596dbaecb69711616b7bf3b3ef363ee5929293.tar.gz
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
-rw-r--r--doc/ikiwikiusers.mdwn12
-rw-r--r--doc/todo/headless_git_branches.mdwn53
-rw-r--r--doc/todo/pagespec_aliases.mdwn93
-rw-r--r--doc/todo/pagespec_aliases/discussion.mdwn13
4 files changed, 149 insertions, 22 deletions
diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn
index 9b339c1e4..659c26cb4 100644
--- a/doc/ikiwikiusers.mdwn
+++ b/doc/ikiwikiusers.mdwn
@@ -22,7 +22,7 @@ Projects & Organizations
<!-- * [NetBSD wiki](http://wiki.netbsd.org) -->
* The [GNU Hurd](http://www.gnu.org/software/hurd/)
* [DragonFly BSD](http://www.dragonflybsd.org/)
-* [Monotone](http://monotone.ca/wiki/FrontPage/)
+* [Monotone](http://wiki.monotone.ca/)
* The [Free Software Foundation](http://fsf.org) uses it for their internal wiki, with subversion.
* The [cairo graphics library](http://cairographics.org/) website.
* The [Portland State Aerospace Society](http://psas.pdx.edu) website. Converted from a combination of TWiki and MoinMoin to ikiwiki, including full history ([[rcs/Git]] backend).
@@ -42,7 +42,11 @@ Projects & Organizations
* The [libkdtree project](http://libkdtree.alioth.debian.org)
* The [pcc](http://pcc.ludd.ltu.se/) (Portable C Compiler) project. (Simple rcs backend)
* [The TOVA Company](http://www.tovatest.com) public site. We also use it for internal documentation and issue tracking, all with a [[rcs/Git]] backend.
-* Technical support websites for [Homebase](http://support.homebase.dk) and [Kaospilotene](http://support.kaospilot.no) (each with [source](http://source.homebase.dk/) [provided](http://source.kaospilot.no/))
+* Reusable technical support websites, developed for [Redpill](http://redpill.dk/) realms:
+ * [master demo site](http://support.redpill.dk/) ([source](http://source.redpill.dk/))
+ * [Homebase](http://support.homebase.dk/) ([source](http://source.homebase.dk/))
+ * [Bitbase](http://support.bitbase.dk/) ([source](http://source.bitbase.dk/))
+ * [Børneuniversitetet](http://support.borneuni.dk/) ([source](http://source.borneuni.dk/))
* [CampusGrün Hamburg](http://www.campusgruen.org/)
* The [awesome window manager homepage](http://awesome.naquadah.org/)
* [Enemies of Carlotta](http://www.e-o-c.org/)
@@ -79,6 +83,7 @@ Projects & Organizations
* [TenderWarehouse Community](http://community.tenderwarehouse.org/)
* [AntPortal](http://antportal.com/wiki/) - also see our templates and themes on [github](https://github.com/AntPortal/ikiwiked)
* [The Amnesic Incognito Live System](https://tails.boum.org/index.en.html)
+* [The Progress Linux OS wiki](http://wiki.progress-linux.org/)
Personal sites and blogs
========================
@@ -179,4 +184,5 @@ Personal sites and blogs
* [Øyvind A. Holm (sunny256)](http://www.sunbase.org) — Read my Ikiwiki praise [here](http://www.sunbase.org/blog/why_ikiwiki/).
* [Mirco Bauer (meebey)](http://www.meebey.net/)
* [Richard "RichiH" Hartmann](http://richardhartmann.de/blog) - I thought I had added myself a year ago. Oups :)
-
+* [Jonas Smedegaard](http://dr.jones.dk/) multilingual "classic" website w/ blog
+* [Siri Reiter](http://sirireiter.dk/) portfolio website with a blog (in danish)
diff --git a/doc/todo/headless_git_branches.mdwn b/doc/todo/headless_git_branches.mdwn
index e97b59900..1dd867765 100644
--- a/doc/todo/headless_git_branches.mdwn
+++ b/doc/todo/headless_git_branches.mdwn
@@ -6,49 +6,63 @@ Ikiwiki should really survive being asked to work with a git branch that has no
git clone barerepo.git srcdir
ikiwiki --rcs=git srcdir destdir
-I've fixed this initial construction case, and, based on my testing, I've also fixed the post-update executing on a new master, and ikiwiki.cgi executing on a non-existent master cases. Unfortunately these cases still generate a lot of warnings from recentchanges; I suspect a much more invasive patch would be needed to shut those up.
+I've fixed this initial construction case, and, based on my testing, I've also fixed the post-update executing on a new master, and ikiwiki.cgi executing on a non-existent master cases.
Please commit so my users stop whining at me about having clean branches to push to, the big babies.
-Summary: Change three scary loud failure cases related to empty branches into three scary loud success cases.
+Summary: Change three scary loud failure cases related to empty branches into three mostly quiet success cases.
[[!tag patch]]
<pre>
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
-index cf7fbe9..5b1e334 100644
+index cf7fbe9..e5bafcf 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
-@@ -439,10 +439,13 @@ sub git_commit_info ($;$) {
+@@ -439,17 +439,21 @@ sub git_commit_info ($;$) {
my @opts;
push @opts, "--max-count=$num" if defined $num;
-+ my @raw_lines;
-
+-
- my @raw_lines = run_or_die('git', 'log', @opts,
- '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c',
- '-r', $sha1, '--', '.');
-+ if (-e $config{srcdir} . "/.git/refs/heads/" . $config{gitmaster_branch}) {
-+ @raw_lines = run_or_die('git', 'log', @opts,
-+ '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c',
-+ '-r', $sha1, '--', '.');
-+ };
-
+-
++ my @raw_lines;
my @ci;
- while (my $parsed = parse_diff_tree(\@raw_lines)) {
-@@ -474,7 +477,10 @@ sub rcs_update () {
+- while (my $parsed = parse_diff_tree(\@raw_lines)) {
+- push @ci, $parsed;
+- }
++
++ # Test to see if branch actually exists yet.
++ if (run_or_non('git', 'show-ref', '--quiet', '--verify', '--', 'refs/heads/' . $config{gitmaster_branch}) ) {
++ @raw_lines = run_or_die('git', 'log', @opts,
++ '--pretty=raw', '--raw', '--abbrev=40', '--always', '-c',
++ '-r', $sha1, '--', '.');
++
++ while (my $parsed = parse_diff_tree(\@raw_lines)) {
++ push @ci, $parsed;
++ }
+
+- warn "Cannot parse commit info for '$sha1' commit" if !@ci;
++ warn "Cannot parse commit info for '$sha1' commit" if !@ci;
++ };
+
+ return wantarray ? @ci : $ci[0];
+ }
+@@ -474,7 +478,10 @@ sub rcs_update () {
# Update working directory.
if (length $config{gitorigin_branch}) {
- run_or_cry('git', 'pull', '--prune', $config{gitorigin_branch});
-+ run_or_cry('git', 'fetch', '--prune', $config{gitorigin_branch});
-+ if (-e $config{srcdir} . '/.git/refs/remotes/' . $config{gitorigin_branch} . '/' . $config{gitmaster_branch}) {
-+ run_or_cry('git', 'merge', $config{gitorigin_branch} . '/' . $config{gitmaster_branch});
-+ }
++ run_or_cry('git', 'fetch', '--prune', $config{gitorigin_branch});
++ if (run_or_non('git', 'show-ref', '--quiet', '--verify', '--', 'refs/remotes/' . $config{gitorigin_branch} . '/' . $config{gitmaster_branch}) ) {
++ run_or_cry('git', 'merge', $config{gitorigin_branch} . '/' . $config{gitmaster_branch});
++ }
}
}
-@@ -559,7 +565,7 @@ sub rcs_commit_helper (@) {
+@@ -559,7 +566,7 @@ sub rcs_commit_helper (@) {
# So we should ignore its exit status (hence run_or_non).
if (run_or_non('git', 'commit', '-m', $params{message}, '-q', @opts)) {
if (length $config{gitorigin_branch}) {
@@ -56,4 +70,5 @@ index cf7fbe9..5b1e334 100644
+ run_or_cry('git', 'push', $config{gitorigin_branch}, $config{gitmaster_branch});
}
}
+
</pre>
diff --git a/doc/todo/pagespec_aliases.mdwn b/doc/todo/pagespec_aliases.mdwn
new file mode 100644
index 000000000..2db53d545
--- /dev/null
+++ b/doc/todo/pagespec_aliases.mdwn
@@ -0,0 +1,93 @@
+[[!tag patch wishlist]]I quite often find myself repeating a boiler-plate
+pagespec chunk, e.g.
+
+ and !*.png and !*.jpg...
+
+it would be quite nice if I could conveniently bundle them together into a
+pagespec "alias", and instead write
+
+ and !image()...
+
+I wrote the following plugin to achieve this:
+
+ commit f3a9dd113338fe5d2b717de1dc69679ff74e2f8d
+ Author: Jon Dowland <jmtd@debian.org>
+ Date: Tue May 3 17:40:16 2011 +0100
+
+ new plugin: alias.pm - pagespec aliases
+
+ diff --git a/IkiWiki/Plugin/alias.pm b/IkiWiki/Plugin/alias.pm
+ new file mode 100644
+ index 0000000..b8d4574
+ --- /dev/null
+ +++ b/IkiWiki/Plugin/alias.pm
+ @@ -0,0 +1,47 @@
+ +package IkiWiki::Plugin::alias;
+ +
+ +use warnings;
+ +use strict;
+ +use IkiWiki '3.00';
+ +
+ +sub import {
+ + hook(type => "getsetup", id=> "alias", call => \&getsetup);
+ + hook(type => "checkconfig", id=> "alias", call => \&checkconfig);
+ +}
+ +
+ +sub getsetup () {
+ + return
+ + plugin => {
+ + description => "allows the definition of pagespec aliases",
+ + safe => 1,
+ + rebuild => 1,
+ + section => "misc",
+ + },
+ + pagespec_aliases => {
+ + type => "string",
+ + example => {"image" => "*jpg or *jpeg or *png or *gif or *ico" },
+ + description => "a set of mappings from alias name to pagespec",
+ + safe => 1,
+ + rebuild => 0,
+ + },
+ +}
+ +
+ +sub checkconfig () {
+ + no strict 'refs';
+ + no warnings 'redefine';
+ +
+ + if ($config{pagespec_aliases}) {
+ + foreach my $key (keys %{$config{pagespec_aliases}}) {
+ + my $value = ${$config{pagespec_aliases}}{$key};
+ + # XXX: validate key?
+ + my $subname = "IkiWiki::PageSpec::match_$key";
+ + *{ $subname } = sub {
+ + my $path = shift;
+ + return IkiWiki::pagespec_match($path, $value);
+ + }
+ + }
+ + }
+ +}
+ +
+ +1;
+
+I need to reflect on this a bit more before I send a pull request. In
+particular I imagine the strict/warnings stuff will make you puke. Also, I'm
+not sure whether I should name-grab 'alias' since [[todo/alias_directive]] is
+an existing wishlist item.
+
+Here's an example setup chunk:
+
+ pagespec_aliases:
+ image: "*.png or *.jpg or *.jpeg or *.gif or *.ico"
+ helper: "*.css or *.js"
+ boring: "image() or helper()"
+
+The above demonstrates self-referential dynamic pagespec aliases. It doesn't work,
+however, to add ' or internal()' to `boring`, for some reason.
+
+-- [[Jon]]
+
+> another useful pagespec alias for large maps:
+
+ basewiki: "sandbox or templates or templates/* or ikiwiki or ikiwiki/* or shortcuts or recentchanges or wikiicons/*"
+
+> -- [[Jon]]
diff --git a/doc/todo/pagespec_aliases/discussion.mdwn b/doc/todo/pagespec_aliases/discussion.mdwn
new file mode 100644
index 000000000..abbe80e6a
--- /dev/null
+++ b/doc/todo/pagespec_aliases/discussion.mdwn
@@ -0,0 +1,13 @@
+Something which is similar to aliases is the "trail" concept I use in the [[plugins/contrib/report]] plugin. (Also my "pmap" plugin, but that's only in my "experimental" branch on github). One can define a "trail" by making a report with the "doscan" option (I should probably change the name of that) and then that page has a "trail" which matches the pagespec in that report.
+Then one can reference that page as a "trail" without having to reuse that pagespec.
+(It's also very useful in speeding up the processing, because the matching pages have been remembered, and one doesn't have to search for them again).
+
+So, for example, one could make a page "all_images" and have a report (or pmap, which is simpler) like so:
+
+ \[[!pmap pages="*.png or *.jpg or *.jpeg or *.gif or *.ico"]]
+
+And then later, somewhere else
+
+ \[[!report template="images.tmpl" trail="all_images" pages="album/*"]]
+
+and that would show all the images under "album".