git-annex/Annex
Joey Hess 95ca3bb022 Fix encoding of data written to git-annex branch. Avoid truncating unicode characters to 8 bits.
Allow any encoding to be used, as with filenames (but utf8 is the sane
choice). Affects metadata and repository descriptions, and preferred
content expressions.

The question of what's the right encoding for the git-annex branch is a
vexing one. utf-8 would be a nice choice, but this leaves the possibility
of bad data getting into a git-annex branch somehow, and this resulting in
git-annex crashing with encoding errors, which is a failure mode I want to
avoid.

(Also, preferred content expressions can refer to filenames, and filenames
can have any encoding, so limiting to utf-8 would not be ideal.)

The union merge code already took care to not assume any encoding for a
file. Except it assumes that any \n is a literal newline, and not part of
some encoding of a character that happens to contain a newline. (At least
utf-8 avoids using newline for anything except liternal newlines.)
Adapted the git-annex branch code to use this same approach.

Note that there is a potential interop problem with Windows, since
FileSystemEncoding doesn't work there, and instead things are always
decoded as utf-8. If someone uses non-utf8 encoding for data on the
git-annex branch, this can lead to an encoding error on windows. However,
this commit doesn't actually make that any worse, because the union merge
code would similarly fail with an encoding error on windows in that
situation.

This commit was sponsored by Kyle Meyer.
2014-05-27 14:16:33 -04:00
..
Branch forget --drop-dead: Avoid removing the dead remote from the trust.log, so that if git remotes for it still exist anywhere, git annex info will still know it's dead and not show it. 2014-03-26 13:28:26 -04:00
Content random hlint (to give the autobuilder something new to build) 2014-02-11 00:41:19 -04:00
Direct fix reversion in relative paths to local remotes of direct mode repos 2013-11-26 19:33:26 -04:00
MetaData toplevel lastchanged field 2014-03-19 19:10:55 -04:00
View fix test to work on Windows 2014-02-25 18:09:45 -04:00
AutoMerge.hs style 2014-03-04 22:55:40 -04:00
Branch.hs Fix encoding of data written to git-annex branch. Avoid truncating unicode characters to 8 bits. 2014-05-27 14:16:33 -04:00
BranchState.hs
CatFile.hs Windows: Fix some filename encoding bugs. 2014-03-19 15:57:56 -04:00
CheckAttr.hs
CheckIgnore.hs hlint 2013-09-25 03:09:06 -04:00
Content.hs Fix direct mode getKeysPresent false positive & also sped up direct mode unused and unannex 2014-03-07 12:43:56 -04:00
Direct.hs finish fixing direct mode merge bug involving unstaged local files 2014-03-04 02:03:15 -04:00
Drop.hs remove some monkey faces 2014-02-01 17:14:38 -04:00
Environment.hs When init detects that git is not configured to commit, and sets user.email to work around the problem, also make it set user.name. 2014-04-20 14:17:57 -04:00
Exception.hs rework annexed object locking in direct mode & support Windows 2014-01-28 16:43:11 -04:00
FileMatcher.hs reorg matcher types; no non-type code changes 2014-03-29 14:43:34 -04:00
Hook.hs fix handling of nonexistant hook 2014-03-03 13:59:36 -04:00
Index.hs sync, assistant, remotedaemon: Use ssh connection caching for git pushes and pulls. 2014-04-12 15:59:34 -04:00
Init.hs reinit: New command that can initialize a new reposotory using the configuration of a previously known repository. Useful if a repository got deleted and you want to clone it back the way it was. 2014-04-15 20:13:35 -04:00
Journal.hs Fix encoding of data written to git-annex branch. Avoid truncating unicode characters to 8 bits. 2014-05-27 14:16:33 -04:00
Link.hs add git annex view command 2014-02-18 18:22:20 -04:00
LockPool.hs use locking on Windows 2014-01-28 14:42:03 -04:00
MetaData.hs Each for each metadata field, there's now an automatically maintained "$field-lastchanged" that gives the timestamp of the last change to that field. 2014-03-18 18:55:43 -04:00
Notification.hs Notification: Add action/status-dependent icon and urgency 2014-04-05 20:45:11 +03:00
Path.hs move programPath out of Config.Files to Annex.Path 2013-11-24 16:03:03 -04:00
Perms.hs Ensure execute bit is set on directories when core.sharedrepsitory is set. 2013-11-18 18:13:09 -04:00
Queue.hs
Quvi.hs Probe for quvi version at run time. 2014-02-28 14:54:02 -04:00
ReplaceFile.hs Put non-object tmp files in .git/annex/misctmp, leaving .git/annex/tmp for only partially transferred objects. 2014-02-26 16:52:56 -04:00
Ssh.hs support being run by ssh as ssh-askpass replacement 2014-04-29 18:08:10 -04:00
TaggedPush.hs remove Read instance for Ref 2014-02-19 01:19:57 -04:00
Transfer.hs notifications on drop 2014-03-22 15:01:48 -04:00
Url.hs add UrlOptions sum type 2014-02-24 22:00:25 -04:00
UUID.hs reinit: New command that can initialize a new reposotory using the configuration of a previously known repository. Useful if a repository got deleted and you want to clone it back the way it was. 2014-04-15 20:13:35 -04:00
VariantFile.hs sync: Fix bug in direct mode that caused a file not checked into git to be deleted when merging with a remote that added a file by the same name. (Thanks, jkt) 2014-03-03 14:57:16 -04:00
Version.hs Auto-upgrade v3 indirect repos to v5 with no changes. This also fixes a problem when a direct mode repo was somehow set to v3 rather than v4, and so the automatic direct mode upgrade to v5 was not done. 2013-12-29 13:06:23 -04:00
View.hs replace (Key, Backend) with Key 2014-04-17 18:03:39 -04:00
Wanted.hs fix transfers of key with no associated file 2014-01-23 16:44:02 -04:00