]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/git-annex_support.mdwn
todo entry
[ikiwiki.git] / doc / todo / git-annex_support.mdwn
index b6d814d91a3bbb6d0c1d4957a22b89f673cd7f77..2f636630ca71209d2e4620bb99605a220ff07e0a 100644 (file)
@@ -19,27 +19,81 @@ The crucial steps are:
 
  1. setup a git annex remote in `$srcdir`
 
-    cd $srcdir
-    git annex init
+ 2. configure direct mode because ikiwiki ignores symlinks for [[security]] reasons:
 
- 2. make the bare repository (the remote of `$srcdir`) ignored by git-annex:
+        cd $srcdir
+        git annex init
+        git annex direct
 
-    cd $srcdir
-    git config remote.origin.annex-ignore true
-    git config remote.origin.annex-sync false
+ 3. configure files to be considered by git-annex (those will be not committed into git directly):
 
-    (!) This needs to be done on *ANY* clone of the repository, which is annoying, but it's important because we don't want to see git-annex stuff in the bare repo. (why?)
+        git config annex.largefiles 'largerthan=100kb and not (include=*.mdwn or include=*.txt)'
+
+ 4. make the bare repository (the remote of `$srcdir`) ignored by git-annex:
 
- 3. enable direct mode on `$srcdir` because ikiwiki ignores symlinks for [[security]] reasons:
+        cd $srcdir
+        git config remote.origin.annex-ignore true
+        git config remote.origin.annex-sync false
 
-    cd $srcdir
-    git annex direct
+    (!) This needs to be done on *ANY* clone of the repository, which is annoying, but it's important because we don't want to see git-annex stuff in the bare repo. (why?)
 
+ 5. deploy the following crappy plugin to make commits work again and make sure the right files are added in git-annex:
+
+[[!format perl """
+#!/usr/bin/perl
+package IkiWiki::Plugin::gitannex;
+
+use warnings;
+use strict;
+use IkiWiki 3.00;
+
+sub import {
+        hook(type => "getsetup", id => "gitannex", call => \&getsetup);
+       hook(type => "savestate", id => "gitannex", call => \&rcs_commit);
+        # we need to handle all rcs commands maybe?
+}
+
+sub getsetup () {
+        return
+                plugin => {
+                        safe => 1, # rcs plugin
+                        rebuild => undef,
+                        section => "misc",
+                },
+}
+
+# XXX: we want to copy or reuse safe_git
+
+sub rcs_commit (@) {
+    chdir $config{srcdir};
+    `git annex add --auto`;
+    `git annex sync`;
+}
+
+sub rcs_commit_staged (@) {
+    rcs_commit($@);
+}
+
+1
+"""]]
 This assumes you know what `srcdir`, `repository` and so on mean, if you forgot (like me), see this reference: [[rcs/git/]].
 
-What remains to be clarified:
+
+What doesn't work
+-----------------
+
+ * the above plugin is kind of flaky and ugly.
+ * it's not an RCS plugin, but probably should be, replacing the git plugin, because really: git doesn't work at all anymore at this point
+
+What remains to be clarified
+----------------------------
 
  * how do files get pushed to the `$srcdir`? Only through the web interface?
  * why do we ignore the bare repository?
 
 See the [[discussion]] for a followup on that. --[[anarcat]]
+
+Alternative implementation
+==========================
+
+An alternative implementation, which remains to be detailed but is mentionned in [[forum/ikiwiki_and_big_files]], is to use the [[underlay]] feature combined with the `hardlink` option to deploy the git-annex'd files. Then git-annex is separate from the base ikiwiki git repo. --[[anarcat]]