summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-05 14:53:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-05 14:53:38 -0400
commit78f5f90c2495a5e30c0620816e2937567cd76ec0 (patch)
tree1ac9d578724f6fc9eb6cf12f706bafaf8f1fe4da
parentcbdaccd44aa8f0ca30afba23fc06dd244c242075 (diff)
parente771c645595fb6cedf0f0c5f2af393712013deb2 (diff)
Merge branch 'master' into watch
-rw-r--r--Remote/Hook.hs17
-rw-r--r--debian/changelog5
-rw-r--r--doc/bugs/subtle_build_issue_on_OSX_10.7_and_Haskell_Platform___40__if_you_have_the_32bit_version_installed__41__/comment_2_8765b6190e79251637bb59ba28f245c1._comment21
-rw-r--r--doc/design/assistant/blog.mdwn4
-rw-r--r--doc/design/assistant/inotify.mdwn40
-rw-r--r--doc/forum/Automatic___96__git_annex_get__96___after_invalidation_of_local_files_due_to_external_modification__63__/comment_2_b5faccf132fb47e3cda778a6600fd9ef._comment8
-rw-r--r--doc/news/version_3.20120406.mdwn4
-rw-r--r--doc/news/version_3.20120605.mdwn11
-rw-r--r--git-annex.cabal2
9 files changed, 95 insertions, 17 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index dcac9da88..1202c6087 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -10,6 +10,7 @@ module Remote.Hook (remote) where
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Map as M
import System.Exit
+import System.Environment
import Common.Annex
import Types.Remote
@@ -59,9 +60,12 @@ hookSetup u c = do
gitConfigSpecialRemote u c' "hooktype" hooktype
return c'
-hookEnv :: Key -> Maybe FilePath -> Maybe [(String, String)]
-hookEnv k f = Just $ fileenv f ++ keyenv
+hookEnv :: Key -> Maybe FilePath -> IO (Maybe [(String, String)])
+hookEnv k f = Just <$> mergeenv (fileenv f ++ keyenv)
where
+ mergeenv l = M.toList .
+ M.union (M.fromList l)
+ <$> M.fromList <$> getEnvironment
env s v = ("ANNEX_" ++ s, v)
keyenv =
[ env "KEY" (show k)
@@ -88,8 +92,9 @@ runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype h
where
run command = do
showOutput -- make way for hook output
- ifM (liftIO $ boolSystemEnv
- "sh" [Param "-c", Param command] $ hookEnv k f)
+ ifM (liftIO $
+ boolSystemEnv "sh" [Param "-c", Param command]
+ =<< hookEnv k f)
( a
, do
warning $ hook ++ " hook exited nonzero!"
@@ -129,14 +134,14 @@ checkPresent r h k = do
liftIO $ catchMsgIO $ check v
where
findkey s = show k `elem` lines s
- env = hookEnv k Nothing
check Nothing = error "checkpresent hook misconfigured"
check (Just hook) = do
(frompipe, topipe) <- createPipe
pid <- forkProcess $ do
_ <- dupTo topipe stdOutput
closeFd frompipe
- executeFile "sh" True ["-c", hook] env
+ executeFile "sh" True ["-c", hook]
+ =<< hookEnv k Nothing
closeFd topipe
fromh <- fdToHandle frompipe
reply <- hGetContentsStrict fromh
diff --git a/debian/changelog b/debian/changelog
index 52f6c3b97..fd4f7b98b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-git-annex (3.20120523) UNRELEASED; urgency=low
+git-annex (3.20120605) unstable; urgency=low
* sync: Show a nicer message if a user tries to sync to a special remote.
* lock: Reset unlocked file to index, rather than to branch head.
@@ -8,8 +8,9 @@ git-annex (3.20120523) UNRELEASED; urgency=low
unsupported backend.
* Require that the SHA256 backend can be used when building, since it's the
default.
+ * Preserve parent environment when running hooks of the hook special remote.
- -- Joey Hess <joeyh@debian.org> Sun, 27 May 2012 20:55:29 -0400
+ -- Joey Hess <joeyh@debian.org> Tue, 05 Jun 2012 14:03:39 -0400
git-annex (3.20120522) unstable; urgency=low
diff --git a/doc/bugs/subtle_build_issue_on_OSX_10.7_and_Haskell_Platform___40__if_you_have_the_32bit_version_installed__41__/comment_2_8765b6190e79251637bb59ba28f245c1._comment b/doc/bugs/subtle_build_issue_on_OSX_10.7_and_Haskell_Platform___40__if_you_have_the_32bit_version_installed__41__/comment_2_8765b6190e79251637bb59ba28f245c1._comment
new file mode 100644
index 000000000..cad802a88
--- /dev/null
+++ b/doc/bugs/subtle_build_issue_on_OSX_10.7_and_Haskell_Platform___40__if_you_have_the_32bit_version_installed__41__/comment_2_8765b6190e79251637bb59ba28f245c1._comment
@@ -0,0 +1,21 @@
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawkSq2FDpK2n66QRUxtqqdbyDuwgbQmUWus"
+ nickname="Jimmy"
+ subject="comment 2"
+ date="2012-06-05T14:07:26Z"
+ content="""
+FYI, (the follow is on OSX 10.7 on two different machines)
+
+On my 64bit install of haskell platform...
+
+ laplace:~ jtang$ ghc -e 'print System.Info.arch'
+ \"x86_64\"
+
+On my 32bit install of haskell platform...
+
+ x00:git-annex jtang$ ghc -e 'print System.Info.arch'
+ \"i386\"
+
+Running _cabal build_ or _cabal install git-annex_ as you suggest with the 32bit install does do the right thing.
+
+"""]]
diff --git a/doc/design/assistant/blog.mdwn b/doc/design/assistant/blog.mdwn
index f099e48be..ca9ba5919 100644
--- a/doc/design/assistant/blog.mdwn
+++ b/doc/design/assistant/blog.mdwn
@@ -1 +1,5 @@
+The git-annex assistant is being
+[crowd funded on Kickstarter](http://www.kickstarter.com/projects/joeyh/git-annex-assistant-like-dropbox-but-with-your-own/).
+I'll be blogging about my progress here on a semi-daily basis.
+
[[!inline pages="page(design/assistant/blog/*)" show=30]]
diff --git a/doc/design/assistant/inotify.mdwn b/doc/design/assistant/inotify.mdwn
index fe4c26d41..938aa2355 100644
--- a/doc/design/assistant/inotify.mdwn
+++ b/doc/design/assistant/inotify.mdwn
@@ -8,7 +8,7 @@ really useful, it needs to:
- on startup, fix the symlinks for any renamed links **done**
- on startup, stage any files that have been deleted since last run
(seems to require a `git commit -a` on startup, or at least a
- `git add --update`, which will notice deleted files)
+ `git add --update`, which will notice deleted files) **done**
- notice new files, and git annex add **done**
- notice renamed files, auto-fix the symlink, and stage the new file location
**done**
@@ -18,9 +18,13 @@ really useful, it needs to:
contents from the index **done**
- notice deleted files and stage the deletion
(tricky; there's a race with add since it replaces the file with a symlink..)
+ **done**
- periodically auto-commit staged changes (avoid autocommitting when
lots of changes are coming in)
- tunable delays before adding new files, etc
+- Coleasce related add/rm events. See commit
+ cbdaccd44aa8f0ca30afba23fc06dd244c242075 for some details of the problems
+ with doing this.
- don't annex `.gitignore` and `.gitattributes` files, but do auto-stage
changes to them
- configurable option to only annex files meeting certian size or
@@ -32,9 +36,37 @@ really useful, it needs to:
unannex its contents.
- Gracefully handle when the default limit of 8192 inotified directories
is exceeded. This can be tuned by root, so help the user fix it.
-
-Also to do:
-
- Support OSes other than Linux; it only uses inotify currently.
OSX and FreeBSD use the same mechanism, and there is a Haskell interface
for it,
+
+## the races
+
+Many races need to be dealt with by this code. Here are some of them.
+
+* File is added and then removed before the annex add finishes.
+
+ Currently unfixed; The annex add re-adds the file as a symlink and then
+ the remove event does nothing since the file exists.
+
+* File is added and then replaced with another file before the annex add
+ makes its symlink.
+
+ Currently unfixed; The annex add will fail creating its symlink since
+ the file exists. The second add event will add the new file.
+
+* File is added and then replaced with another file before the annex add
+ moves its content into the annex.
+
+ Currently unfixed; The new content will be moved to the annex under the
+ old checksum, and fsck will later catch this inconsistency.
+
+* File is removed and then re-added before the removal event finishes.
+
+ Not a problem; The removal event removes the old file from the index, and
+ the add event adds the new one.
+
+* File is removed and then re-added before the removal event starts.
+
+ Not a problem; The removal event does nothing since the file exists,
+ and the add event replaces it in git with the new one.
diff --git a/doc/forum/Automatic___96__git_annex_get__96___after_invalidation_of_local_files_due_to_external_modification__63__/comment_2_b5faccf132fb47e3cda778a6600fd9ef._comment b/doc/forum/Automatic___96__git_annex_get__96___after_invalidation_of_local_files_due_to_external_modification__63__/comment_2_b5faccf132fb47e3cda778a6600fd9ef._comment
new file mode 100644
index 000000000..2cd1001ef
--- /dev/null
+++ b/doc/forum/Automatic___96__git_annex_get__96___after_invalidation_of_local_files_due_to_external_modification__63__/comment_2_b5faccf132fb47e3cda778a6600fd9ef._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawlu7K3h7Ry1uDAU_ERYGuqt0LoGNJqGuRo"
+ nickname="Nathan"
+ subject="comment 2"
+ date="2012-06-04T21:01:52Z"
+ content="""
+Joey, that sounds reasonable; I'll try it. Thanks!
+"""]]
diff --git a/doc/news/version_3.20120406.mdwn b/doc/news/version_3.20120406.mdwn
deleted file mode 100644
index b3df304e2..000000000
--- a/doc/news/version_3.20120406.mdwn
+++ /dev/null
@@ -1,4 +0,0 @@
-git-annex 3.20120406 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * Disable diskfree on kfreebsd, as I have a build failure on kfreebsd-i386
- that is quite likely caused by it."""]] \ No newline at end of file
diff --git a/doc/news/version_3.20120605.mdwn b/doc/news/version_3.20120605.mdwn
new file mode 100644
index 000000000..ed0a09177
--- /dev/null
+++ b/doc/news/version_3.20120605.mdwn
@@ -0,0 +1,11 @@
+git-annex 3.20120605 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * sync: Show a nicer message if a user tries to sync to a special remote.
+ * lock: Reset unlocked file to index, rather than to branch head.
+ * import: New subcommand, pulls files from a directory outside the annex
+ and adds them.
+ * Fix display of warning message when encountering a file that uses an
+ unsupported backend.
+ * Require that the SHA256 backend can be used when building, since it's the
+ default.
+ * Preserve parent environment when running hooks of the hook special remote."""]] \ No newline at end of file
diff --git a/git-annex.cabal b/git-annex.cabal
index e5ad27d9d..114a4069f 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -1,5 +1,5 @@
Name: git-annex
-Version: 3.20120522
+Version: 3.20120605
Cabal-Version: >= 1.8
License: GPL
Maintainer: Joey Hess <joey@kitenet.net>