Commit graph

3439 commits

Author SHA1 Message Date
Joey Hess
146c36ca54 IO exception rework
ghc 7.4 comaplains about use of System.IO.Error to catch exceptions.
Ok, use Control.Exception, with variants specialized to only catch IO
exceptions.
2012-02-03 16:47:24 -04:00
Joey Hess
05f89123e0 update; ghc7.4 branch fixes this pretty well now 2012-02-03 16:25:34 -04:00
Joey Hess
d8fb97806c support all filename encodings with ghc 7.4
Under ghc 7.4, this seems to be able to handle all filename encodings
again. Including filename encodings that do not match the LANG setting.
I think this will not work with earlier versions of ghc, it uses some ghc
internals.

Turns out that ghc 7.4 has a special filesystem encoding that it uses when
reading/writing filenames (as FilePaths). This encoding is documented
to allow  "arbitrary undecodable bytes to be round-tripped through it".

So, to get FilePaths from eg, git ls-files, set the Handle that is reading
from git to use this encoding. Then things basically just work.

However, I have not found a way to make Text read using this encoding.
Text really does assume unicode. So I had to switch back to using String
when reading/writing data to git. Which is a pity, because it's some
percent slower, but at least it works.

Note that stdout and stderr also have to be set to this encoding, or
printing out filenames that contain undecodable bytes causes a crash.
IMHO this is a misfeature in ghc, that the user can pass you a filename,
which you can readFile, etc, but that default, putStr of filename may
cause a crash!

Git.CheckAttr gave me special trouble, because the filenames I got back
from git, after feeding them in, had further encoding breakage.
Rather than try to deal with that, I just zip up the input filenames
with the attributes. Which must be returned in the same order queried
for this to work.

Also of note is an apparent GHC bug I worked around in Git.CheckAttr. It
used to forkProcess and feed git from the child process.  Unfortunatly,
after this forkProcess, accessing the `files` variable from the parent
returns []. Not the value that was passed into the function. This screams
of a bad bug, that's clobbering a variable, but for now I just avoid
forkProcess there to work around it. That forkProcess was itself only added
because of a ghc bug, #624389. I've confirmed that the test case for that
bug doesn't reproduce it with ghc 7.4. So that's ok, except for the new ghc
bug I have not isolated and reported. Why does this simple bit of code
magnet the ghc bugs? :)

Also, the symlink touching code is currently broken, when used on utf-8
filenames in a non-utf-8 locale, or probably on any filename containing
undecodable bytes, and I temporarily commented it out.
2012-02-03 16:23:20 -04:00
Joey Hess
fb78107f85 add a check for not utf-8 console 2012-02-03 01:41:14 -04:00
Joey Hess
94caa26883 update 2012-02-02 15:44:22 -04:00
Joey Hess
828df56453 update; newghc-edges branch 2012-02-02 15:41:22 -04:00
Joey Hess
fc8a1d213b update 2012-02-02 10:56:39 -04:00
Joey Hess
39e887e8e6 update; unix-compat gets some of the way 2012-02-02 10:56:23 -04:00
Joey Hess
33fd49703c update 2012-02-02 10:31:56 -04:00
Joey Hess
f2081ad056 update 2012-02-01 22:24:40 -04:00
Joey Hess
b91569ba98 spent 3 hours on this bug; developed two incomplete fixes 2012-02-01 16:26:23 -04:00
Joey Hess
3d49258e5b attempt at a quick, utf-8 only fix to the ghc 7.4 problem
If you have only utf-8 filenames, and need to build git-annex with ghc 7.4,
this will work. But, it will crash on non-utf-8 filenames.
2012-02-01 16:16:08 -04:00
Joey Hess
6c64a214fa add a test case for adding a file with a unicode filename
This fails with ghc 4.7.
2012-01-31 16:34:04 -04:00
Joey Hess
275391b1bf Merge branch 'master' of ssh://git-annex.branchable.com 2012-01-30 21:08:27 -04:00
Joey Hess
ed64bd8a4b remove; unused 2012-01-30 13:20:36 -04:00
Joey Hess
a964012fc3 switch to the strict state monad
I had not realized what a memory leak the lazy state monad could be,
although I have not seen much evidence of actual leaking in git-annex.
However, if running git-annex on a great many files, this could matter.

The additional Utility.State.changeState adds even more strictness,
avoiding a problem I saw in github-backup where repeatedly modifying
state built up a huge pile of thunks.
2012-01-29 22:55:06 -04:00
https://www.google.com/accounts/o8/id?id=AItOawk6QAwUsFHpr3Km1yQbg8hf3S7RDYf7hX4
b9a317cdbd Added a comment 2012-01-29 01:51:37 +00:00
Joey Hess
0609e10239 reopen
People seem to want to post comments here with vague details about a new
bug, rather than opening a new bug report.
2012-01-28 18:09:28 -04:00
Joey Hess
6e89064d27 fixed 2012-01-28 16:01:53 -04:00
Joey Hess
4fa4eeea0d Merge branch 'master' of ssh://git-annex.branchable.com 2012-01-28 16:01:03 -04:00
Joey Hess
775958b4dc faster local-local dropping
Dropping a key from a local remote ran git-annex-shell unnecessarily.

Now git-annex-shell is never used when acting on a local remote.
2012-01-28 16:00:20 -04:00
Joey Hess
b81d662cbf Avoid repeated location log commits when a remote is receiving files.
Done by adding a oneshot mode, in which location log changes are written to
the journal, but not committed. Taking advantage of git-annex's existing
ability to recover in this situation.

This is used by git-annex-shell and other places where changes are made to
a remote's location log.
2012-01-28 15:41:52 -04:00
http://joey.kitenet.net/
a75eff4a8e Added a comment 2012-01-28 19:40:34 +00:00
http://joey.kitenet.net/
2a6be431d4 Added a comment 2012-01-28 19:32:36 +00:00
Joey Hess
303666965a Revert "Avoid creating ~/.bup when initializing a bup remote"
This reverts commit 6da40100c9.

On closer examinaton, this change is wrong. The bup special remote
can be configured with "buprepo=", which makes it use the default
~/.bup repo. This change makes it use a different temp dir each time,
which I'm sure would not be appreciated by anyone with that
configuration.

Bup insisting in creating ~/.bup even when using a different repo
does seem like a bug in *something*, but I'm leaning toward the bug
being in bup itself.
2012-01-28 15:23:28 -04:00
https://www.google.com/accounts/o8/id?id=AItOawk6QAwUsFHpr3Km1yQbg8hf3S7RDYf7hX4
141718da73 Added a comment 2012-01-28 00:21:42 +00:00
https://www.google.com/accounts/o8/id?id=AItOawk6QAwUsFHpr3Km1yQbg8hf3S7RDYf7hX4
13e78fbf88 Added a comment 2012-01-28 00:17:38 +00:00
http://joey.kitenet.net/
0f8a8ef4a5 Added a comment 2012-01-27 21:00:06 +00:00
Joey Hess
0bb3a31a6e old version? 2012-01-27 16:50:27 -04:00
Joey Hess
f2817f13ac Merge branch 'master' of ssh://git-annex.branchable.com 2012-01-27 16:36:47 -04:00
https://www.google.com/accounts/o8/id?id=AItOawk6QAwUsFHpr3Km1yQbg8hf3S7RDYf7hX4
ba6f01b137 2012-01-27 08:12:48 +00:00
https://www.google.com/accounts/o8/id?id=AItOawk6QAwUsFHpr3Km1yQbg8hf3S7RDYf7hX4
9b91db8254 Added a comment 2012-01-26 22:13:19 +00:00
Lauri Alanko
6da40100c9 Avoid creating ~/.bup when initializing a bup remote 2012-01-26 01:11:57 -04:00
Joey Hess
97209ac08d fix error message 2012-01-25 20:43:01 -04:00
Joey Hess
3ca7cf5db1 export fromPath
Not used in git-annex, but I am using it in git-backup
2012-01-25 20:42:05 -04:00
Joey Hess
9b51ec9dbf add 2012-01-25 17:39:38 -04:00
Joey Hess
bc130e355e close 2012-01-24 16:22:24 -04:00
Joey Hess
ce5637498f remove Utility.Conditional and use IfElse
This drops the >>! and >>? with the nice low fixity. IfElse does have
undocumented >>=>>! and >>=>>? operators, but I deem that too fishy.
Anyway, using whenM and unlessM is easier; I sometimes mixed the operators
up.
2012-01-24 16:22:07 -04:00
Joey Hess
ba6088b249 rename readMaybe to readish
a stricter (but also partial) readMaybe is getting added to base
2012-01-23 17:00:10 -04:00
Joey Hess
5e172b43c4 a few things available elsewhere... 2012-01-23 16:57:45 -04:00
Joey Hess
bed495db64 add news item for git-annex 3.20120123 2012-01-23 15:10:10 -04:00
Joey Hess
20d0288802 releasing version 3.20120123 2012-01-23 15:09:50 -04:00
http://joey.kitenet.net/
549bf0cddb Added a comment 2012-01-23 19:00:40 +00:00
https://www.google.com/accounts/o8/id?id=AItOawlB7-aXsqwzOi2BIR_Q4sUF8sjj24H6F3c
ece239f086 2012-01-23 18:38:14 +00:00
Joey Hess
183bdacca2 treak 2012-01-21 02:49:32 -04:00
Joey Hess
eb9001044f order user provided params after connection caching params
So the user can override them.
2012-01-20 17:32:32 -04:00
Joey Hess
6ef82665de add annex.sshcaching config setting 2012-01-20 17:15:46 -04:00
Joey Hess
47250a153a ssh connection caching
Ssh connection caching is now enabled automatically by git-annex. Only one
ssh connection is made to each host per git-annex run, which can speed some
things up a lot, as well as avoiding repeated password prompts. Concurrent
git-annex processes also share ssh connections. Cached ssh connections are
shut down when git-annex exits.

Note: The rsync special remote does not yet participate in the ssh
connection caching.
2012-01-20 17:14:56 -04:00
Joey Hess
25f998679c typo 2012-01-20 15:06:17 -04:00
Joey Hess
61dbad505d fsck --from remote --fast
Avoids expensive file transfers, at the expense of checking file size
and/or contents.

Required some reworking of the remote code.
2012-01-20 13:23:11 -04:00