git-annex/Utility
Joey Hess bca3fd65b9 fix key directory hash calculation code
Fix Key directory hash calculation code to behave as it did before version
3.20120227 when a key contains non-ascii.

The hash directories for a given Key are based on its md5sum.
Prior to ghc 7.4, Keys contained raw, undecoded bytes, so the md5sum was
taken of each byte in turn. With the ghc 7.4 filename encoding change,
keys contains decoded unicode characters (possibly with surrigates for
undecodable bytes). This changes the result of the md5sum, since the md5sum
used is pure haskell and supports unicode. And that won't do, as git-annex
will start looking in a different hash directory for the content of a key.

The surrigates are particularly bad, since that's essentially a ghc
implementation detail, so could change again at any time. Also, changing
the locale changes how the bytes are decoded, which can also change
the md5sum.

Symptoms would include things like:

* git annex fsck would complain that no copies existed of a file,
  despite its symlink pointing to the content that was locally present
* git annex fix would change the symlink to use the wrong hash
  directory.

Only WORM backend is likely to have been affected, since only it tends
to include much filename data (SHA1E could in theory also be affected).

I have not tried to support the hash directories used by git-annex versions
3.20120227 to 3.20120308, so things added with those versions with WORM
will require manual fixups. Sorry for the inconvenience!
2012-03-09 20:03:51 -04:00
..
Base64.hs rename 2011-07-05 20:24:10 -04:00
CoProcess.hs refactor 2012-02-20 15:22:21 -04:00
CopyFile.hs remove Utility.Conditional and use IfElse 2012-01-24 16:22:07 -04:00
DataUnits.hs hslint 2011-12-09 01:57:13 -04:00
Directory.hs IO exception rework 2012-02-03 16:47:24 -04:00
Dot.hs finished hlint pass 2011-07-15 12:47:14 -04:00
Exception.hs IO exception rework 2012-02-03 16:47:24 -04:00
FileMode.hs make unused check branches and tags too 2011-09-28 16:43:10 -04:00
FileSystemEncoding.hs fix key directory hash calculation code 2012-03-09 20:03:51 -04:00
Format.hs hlint 2012-02-16 00:44:51 -04:00
Gpg.hs don't use GPG_AGENT_INFO to force batch mode in test suite 2012-01-09 18:19:29 -04:00
JSONStream.hs go go gadget hlint 2011-09-20 23:24:48 -04:00
Matcher.hs go go gadget hlint 2011-09-20 23:24:48 -04:00
Misc.hs factor out Utility.FileSystemEncoding 2012-03-09 19:08:10 -04:00
Monad.hs treak 2012-01-21 02:49:32 -04:00
PartialPrelude.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Path.hs Fix a bug in symlink calculation code, that triggered in rare cases where an annexed file is in a subdirectory that nearly matched to the .git/annex/object/xx/yy subdirectories. 2012-03-05 12:42:52 -04:00
RsyncFile.hs Avoid excessive escaping for rsync special remotes that are not accessed over ssh. 2011-11-18 12:53:48 -04:00
SafeCommand.hs add safeSystem 2011-11-09 17:28:35 -04:00
State.hs switch to the strict state monad 2012-01-29 22:55:06 -04:00
StatFS.hsc fix key directory hash calculation code 2012-03-09 20:03:51 -04:00
TempFile.hs IO exception rework 2012-02-03 16:47:24 -04:00
Touch.hsc factor out Utility.FileSystemEncoding 2012-03-09 19:08:10 -04:00
Url.hs hlint 2012-02-16 00:44:51 -04:00