diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-27 16:36:47 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-27 16:36:47 -0400 |
commit | f2817f13ac38144f316371826c0700888709a331 (patch) | |
tree | 53a9c1d9847c0614ad832715a04e4c95140ab33b | |
parent | 97209ac08dcfc005c3da2fa889275e618d892d31 (diff) | |
parent | ba6f01b137498b7df2191f050158f58052311624 (diff) |
Merge branch 'master' of ssh://git-annex.branchable.com
-rw-r--r-- | Remote/Bup.hs | 15 | ||||
-rw-r--r-- | doc/bugs/copy_doesn__39__t_scale.mdwn | 4 | ||||
-rw-r--r-- | doc/bugs/problems_with_utf8_names/comment_5_519cda534c7aea7f5ad5acd3f76e21fa._comment | 11 |
3 files changed, 29 insertions, 1 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs index 9b54d8c85..583358f24 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -11,6 +11,8 @@ import qualified Data.ByteString.Lazy.Char8 as L import System.IO.Error import qualified Data.Map as M import System.Process +import System.Posix.Env (getEnvironment) +import System.Path (brackettmpdir) import Common.Annex import Types.Remote @@ -83,10 +85,21 @@ bupParams :: String -> BupRepo -> [CommandParam] -> [CommandParam] bupParams command buprepo params = Param command : [Param "-r", Param buprepo] ++ params +isLocal :: BupRepo -> Bool +isLocal buprepo = not (elem ':' buprepo) + bup :: String -> BupRepo -> [CommandParam] -> Annex Bool bup command buprepo params = do showOutput -- make way for bup output - liftIO $ boolSystem "bup" $ bupParams command buprepo params + liftIO action + where + action | isLocal buprepo = runBup lparams buprepo + | otherwise = brackettmpdir "bupXXXXXX" $ runBup rparams + lparams = Param command : params + rparams = bupParams command buprepo params + runBup params bupdir = do + env <- getEnvironment + boolSystemEnv "bup" params (Just (("BUP_DIR", bupdir) : env)) pipeBup :: [CommandParam] -> Maybe Handle -> Maybe Handle -> IO Bool pipeBup params inh outh = do diff --git a/doc/bugs/copy_doesn__39__t_scale.mdwn b/doc/bugs/copy_doesn__39__t_scale.mdwn new file mode 100644 index 000000000..1a83ae548 --- /dev/null +++ b/doc/bugs/copy_doesn__39__t_scale.mdwn @@ -0,0 +1,4 @@ +It seems that git-annex copies every individual file in a separate transaction. This is quite costly for mass transfers: each file involves a separate rsync invocation and the creation of a new commit. Even with a meager thousand files or so in the annex, I have to wait for fifteen minutes to copy the contents to another disk, simply because every individual file involves some disk thrashing. Also, it seems suspicious that the git-annex branch would get a thousands commits of history from the simple procedure of copying everything to a new repository. Surely it would be better to first copy everything and then create only a single commit that registers the changes to the files' availability? + +(I'm also not quite clear on why rsync is being used when both repositories are local. It seems to be just overhead.) + diff --git a/doc/bugs/problems_with_utf8_names/comment_5_519cda534c7aea7f5ad5acd3f76e21fa._comment b/doc/bugs/problems_with_utf8_names/comment_5_519cda534c7aea7f5ad5acd3f76e21fa._comment new file mode 100644 index 000000000..96b0ffed0 --- /dev/null +++ b/doc/bugs/problems_with_utf8_names/comment_5_519cda534c7aea7f5ad5acd3f76e21fa._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawk6QAwUsFHpr3Km1yQbg8hf3S7RDYf7hX4" + nickname="Lauri" + subject="comment 5" + date="2012-01-26T22:13:18Z" + content=""" +I also encountered Adam's bug. The problem seems to be that communication with the git process is done with `Char8`-bytestrings. So, when `L.unpack` is called, all filenames that git outputs (with `ls-files` or `ls-tree`) are interpreted to be in latin-1, which wreaks havoc if they are really in UTF-8. + +I suspect that it would be enough to just switch to standard `String`s (or `Data.Text.Text`) instead of bytestrings for textual data, and to `Word8`-bytestrings for pure binary data. GHC should nowadays handle locale-dependent encoding of `String`s transparently. + +"""]] |