CI to automate build of cargo lockfiles on different Alpine releases for git-annex aports https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/community/git-annex
Find a file
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
Annex Avoid repeated location log commits when a remote is receiving files. 2012-01-28 15:41:52 -04:00
Backend fsck --from 2012-01-19 15:24:05 -04:00
Build moved files around 2011-08-20 16:11:42 -04:00
Command support all filename encodings with ghc 7.4 2012-02-03 16:23:20 -04:00
Common lint 2011-11-11 01:52:58 -04:00
debian remove; unused 2012-01-30 13:20:36 -04:00
doc Added a comment 2012-01-29 01:51:37 +00:00
Git support all filename encodings with ghc 7.4 2012-02-03 16:23:20 -04:00
Logs tweaks 2012-01-11 00:06:54 -04:00
Messages find --json 2011-12-23 01:08:19 -04:00
Remote faster local-local dropping 2012-01-28 16:00:20 -04:00
Types rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Upgrade Avoid repeated location log commits when a remote is receiving files. 2012-01-28 15:41:52 -04:00
Utility support all filename encodings with ghc 7.4 2012-02-03 16:23:20 -04:00
.gitattributes decruft 2011-06-22 18:56:08 -04:00
.gitignore update ignores 2012-01-05 23:21:03 -04:00
Annex.hs switch to the strict state monad 2012-01-29 22:55:06 -04:00
Backend.hs type alias cleanup 2011-12-31 04:11:58 -04:00
CHANGELOG symlinks 2010-10-27 15:14:59 -04:00
Checks.hs layout 2012-01-06 21:53:47 -04:00
CmdLine.hs Avoid repeated location log commits when a remote is receiving files. 2012-01-28 15:41:52 -04:00
Command.hs break module dependancy loop 2012-01-10 13:32:38 -04:00
Common.hs switch to the strict state monad 2012-01-29 22:55:06 -04:00
Config.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
configure.hs add a configure check for StatFS 2012-01-15 13:49:32 -04:00
Crypto.hs split out Utility.Gpg with the generic gpg interface, from Crypto 2011-12-20 23:24:06 -04:00
git-annex-shell.hs Avoid repeated location log commits when a remote is receiving files. 2012-01-28 15:41:52 -04:00
git-annex.cabal remove Utility.Conditional and use IfElse 2012-01-24 16:22:07 -04:00
git-annex.hs renamed GitRepo to Git 2011-06-30 13:21:39 -04:00
git-union-merge.hs git-annex, git-union-merge: Support GIT_DIR and GIT_WORK_TREE. 2012-01-13 12:52:09 -04:00
Git.hs Support unescaped repository urls, like git does. 2012-01-05 14:32:20 -04:00
GitAnnex.hs Avoid repeated location log commits when a remote is receiving files. 2012-01-28 15:41:52 -04:00
GPL symlinks 2010-10-27 15:14:59 -04:00
Init.hs split out Git/Ref.hs 2011-12-12 18:30:33 -04:00
INSTALL symlinks 2010-10-27 15:14:59 -04:00
Limit.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Locations.hs ssh connection caching 2012-01-20 17:14:56 -04:00
Makefile add a configure check for StatFS 2012-01-15 13:49:32 -04:00
mdwn2man mwdn2man: Fix a bug in newline supression. Closes: #606578 2010-12-10 17:27:02 -04:00
Messages.hs support all filename encodings with ghc 7.4 2012-02-03 16:23:20 -04:00
NEWS update NEWS 2012-01-19 15:27:39 -04:00
Option.hs tweak 2012-01-06 10:57:57 -04:00
README add README 2011-05-13 19:20:54 -04:00
Remote.hs fsck --from remote --fast 2012-01-20 13:23:11 -04:00
Seek.hs rename readMaybe to readish 2012-01-23 17:00:10 -04:00
Setup.hs cabal can now be used to build git-annex. 2011-06-30 14:55:03 -04:00
test.hs add a test case for adding a file with a unicode filename 2012-01-31 16:34:04 -04:00
Types.hs tweak 2012-01-06 10:57:57 -04:00
Upgrade.hs tweaks 2012-01-11 00:06:54 -04:00
Usage.hs log --before=date 2012-01-06 21:32:08 -04:00

git-annex allows managing files with git, without checking the file
contents into git. While that may seem paradoxical, it is useful when
dealing with files larger than git can currently easily handle, whether due
to limitations in memory, checksumming time, or disk space.

For documentation, see doc/ or <http://git-annex.branchable.com/>