summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-04 15:40:11 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-04 15:40:11 -0400
commit0accc932cb88a79829cf0cfb3f27b16b46e33140 (patch)
tree52623d4a44dbaa8328797c7c0f09dd39d08f8fcf
parent9b40cd7461cc7b384f21a428a6b99f33301d67dd (diff)
update
-rw-r--r--doc/design/assistant.mdwn7
-rw-r--r--doc/design/assistant/blog.mdwn1
-rw-r--r--doc/design/assistant/blog/day_1__inotify.mdwn57
-rw-r--r--doc/design/assistant/inotify.mdwn2
4 files changed, 67 insertions, 0 deletions
diff --git a/doc/design/assistant.mdwn b/doc/design/assistant.mdwn
index 7a720a5e0..69bf1da34 100644
--- a/doc/design/assistant.mdwn
+++ b/doc/design/assistant.mdwn
@@ -18,3 +18,10 @@ Feel free to chip in with comments! --[[Joey]]
* [[desymlink]]
* [[deltas]]
* In my overfunded nighmares: [[Windows]]
+
+## blog
+
+I'll be blogging about my progress here on a semi-daily basis. Follow
+along!
+
+[[!inline pages="page(design/assistant/blog/*)" show=30]]
diff --git a/doc/design/assistant/blog.mdwn b/doc/design/assistant/blog.mdwn
new file mode 100644
index 000000000..f51da3db4
--- /dev/null
+++ b/doc/design/assistant/blog.mdwn
@@ -0,0 +1 @@
+See [[assistant]].
diff --git a/doc/design/assistant/blog/day_1__inotify.mdwn b/doc/design/assistant/blog/day_1__inotify.mdwn
new file mode 100644
index 000000000..9935698e0
--- /dev/null
+++ b/doc/design/assistant/blog/day_1__inotify.mdwn
@@ -0,0 +1,57 @@
+First day of [Kickstarter funded work](http://www.kickstarter.com/projects/joeyh/git-annex-assistant-like-dropbox-but-with-your-own/)!
+
+Worked on [[inotify]] today. The `watch` branch in git now does a pretty
+good job of following changes made to the directory, annexing files
+as they're added and staging other changes into git. Here's a quick
+transcript of it in action:
+
+ joey@gnu:~/tmp>mkdir demo
+ joey@gnu:~/tmp>cd demo
+ joey@gnu:~/tmp/demo>git init
+ Initialized empty Git repository in /home/joey/tmp/demo/.git/
+ joey@gnu:~/tmp/demo>git annex init demo
+ init demo ok
+ (Recording state in git...)
+ joey@gnu:~/tmp/demo>git annex watch &
+ [1] 3284
+ watch . (scanning...) (started)
+ joey@gnu:~/tmp/demo>dd if=/dev/urandom of=bigfile bs=1M count=2
+ add ./bigfile 2+0 records in
+ 2+0 records out
+ 2097152 bytes (2.1 MB) copied, 0.835976 s, 2.5 MB/s
+ (checksum...) ok
+ (Recording state in git...)
+ joey@gnu:~/tmp/demo>ls -la bigfile
+ lrwxrwxrwx 1 joey joey 188 Jun 4 15:36 bigfile -> .git/annex/objects/Wx/KQ/SHA256-s2097152--e5ced5836a3f9be782e6da14446794a1d22d9694f5c85f3ad7220b035a4b82ee/SHA256-s2097152--e5ced5836a3f9be782e6da14446794a1d22d9694f5c85f3ad7220b035a4b82ee
+ joey@gnu:~/tmp/demo>git status -s
+ A bigfile
+ joey@gnu:~/tmp/demo>mkdir foo
+ joey@gnu:~/tmp/demo>mv bigfile foo
+ "del ./bigfile"
+ joey@gnu:~/tmp/demo>git status -s
+ AD bigfile
+ A foo/bigfile
+
+Due to Linux's inotify interface, this is suely some of the most subtle,
+race-heavy code that I'll need to deal with while developing the git annex
+assistant. But I can't start wading, need to jump off the deep end to make
+progress!
+
+The hardest problem today involved the case where a directory is moved
+outside of the tree that's being watched. Inotify will still send events
+for such directories, but it doesn't make sense to continue to handle them.
+
+Ideally I'd stop inotify watching such directories, but a lot of state
+would need to be maintained to know which inotify handle to stop watching.
+(Seems like Haskell's inotify API makes this harder than it needs to be...)
+
+Instead, I put in a hack that will make it detect inotify events from
+directories moved away, and ignore them. This is probably acceptable,
+since this is an unusual edge case.
+
+----
+
+The notable omission in the inotify code, which I'll work on next, is
+staging deleting of files. This is tricky because adding a file to the
+annex happens to cause a deletion event. I need to make sure there are no
+races where that deletion event causes data loss.
diff --git a/doc/design/assistant/inotify.mdwn b/doc/design/assistant/inotify.mdwn
index 166e5b7cd..e6335e045 100644
--- a/doc/design/assistant/inotify.mdwn
+++ b/doc/design/assistant/inotify.mdwn
@@ -28,6 +28,8 @@ really useful, it needs to:
- honor .gitignore, not adding files it excludes (difficult, probably
needs my own .gitignore parser to avoid excessive running of git commands
to check for ignored files)
+- Possibly, when a directory is moved out of the annex location,
+ unannex its contents.
Also to do: