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 7390f08ef9 Use cryptohash rather than SHA for hashing.
This is a massive win on OSX, which doesn't have a sha256sum normally.

Only use external hash commands when the file is > 1 mb,
since cryptohash is quite close to them in speed.

SHA is still used to calculate HMACs. I don't quite understand
cryptohash's API for those.

Used the following benchmark to arrive at the 1 mb number.

1 mb file:

benchmarking sha256/internal
mean: 13.86696 ms, lb 13.83010 ms, ub 13.93453 ms, ci 0.950
std dev: 249.3235 us, lb 162.0448 us, ub 458.1744 us, ci 0.950
found 5 outliers among 100 samples (5.0%)
  4 (4.0%) high mild
  1 (1.0%) high severe
variance introduced by outliers: 10.415%
variance is moderately inflated by outliers

benchmarking sha256/external
mean: 14.20670 ms, lb 14.17237 ms, ub 14.27004 ms, ci 0.950
std dev: 230.5448 us, lb 150.7310 us, ub 427.6068 us, ci 0.950
found 3 outliers among 100 samples (3.0%)
  2 (2.0%) high mild
  1 (1.0%) high severe

2 mb file:

benchmarking sha256/internal
mean: 26.44270 ms, lb 26.23701 ms, ub 26.63414 ms, ci 0.950
std dev: 1.012303 ms, lb 925.8921 us, ub 1.122267 ms, ci 0.950
variance introduced by outliers: 35.540%
variance is moderately inflated by outliers

benchmarking sha256/external
mean: 26.84521 ms, lb 26.77644 ms, ub 26.91433 ms, ci 0.950
std dev: 347.7867 us, lb 210.6283 us, ub 571.3351 us, ci 0.950
found 6 outliers among 100 samples (6.0%)

import Crypto.Hash
import Data.ByteString.Lazy as L
import Criterion.Main
import Common

testfile :: FilePath
testfile = "/run/shm/data" -- on ram disk

main = defaultMain
        [ bgroup "sha256"
                [ bench "internal" $ whnfIO internal
                , bench "external" $ whnfIO external
                ]
        ]

sha256 :: L.ByteString -> Digest SHA256
sha256 = hashlazy

internal :: IO String
internal = show . sha256 <$> L.readFile testfile

external :: IO String
external = do
	s <- readProcess "sha256sum" [testfile]
        return $ fst $ separate (== ' ') s
2013-09-22 20:06:02 -04:00
Annex completely solve catKey memory leak 2013-09-19 20:09:03 -04:00
Assistant work around evilsplicer bug 2013-09-20 12:19:55 -04:00
Backend Use cryptohash rather than SHA for hashing. 2013-09-22 20:06:02 -04:00
Build add git-remote-gcrypt to bundle when available 2013-09-13 12:05:47 -04:00
Command list --allrepos 2013-09-19 21:42:03 -04:00
Common Use lower case hash directories for storing files on crippled filesystems, same as is already done for bare repositories. 2013-04-04 15:46:33 -04:00
Config webapp: When the user switches to display a different repository, that repository becomes the default repository to be displayed next time the webapp gets started. 2013-06-11 00:06:06 -04:00
debian Use cryptohash rather than SHA for hashing. 2013-09-22 20:06:02 -04:00
doc Merge branch 'master' of ssh://git-annex.branchable.com 2013-09-22 16:46:11 -04:00
Git Use cryptohash rather than SHA for hashing. 2013-09-22 20:06:02 -04:00
GitAnnex mirror: New command, makes two repositories contain the same set of files. 2013-08-20 15:46:35 -04:00
Logs sync, pre-commit, indirect: Avoid unnecessarily catting non-symlink files from git, which can be so large it runs out of memory. 2013-09-19 14:48:42 -04:00
Messages hlint 2013-04-03 03:52:41 -04:00
Remote Use cryptohash rather than SHA for hashing. 2013-09-22 20:06:02 -04:00
standalone fix typo in runshell (will update standalone builds for last release) 2013-09-22 09:45:50 -04:00
static animate syncing and other activity icons 2013-04-08 22:54:02 -04:00
templates webapp: Show encryption information when editing a remote. 2013-09-17 20:02:42 -04:00
Types note 2013-09-20 00:04:37 -04:00
Upgrade refactor git-annex branch log filename code into central location 2013-08-29 19:13:00 -04:00
Utility Use cryptohash rather than SHA for hashing. 2013-09-22 20:06:02 -04:00
.ghci workaround for ghci fragility in reusing objects compiled with ghc 2012-10-20 16:20:42 -04:00
.gitattributes decruft 2011-06-22 18:56:08 -04:00
.gitignore re-enable .o and .hi exclusion 2013-06-26 11:43:45 -04:00
Annex.hs gitignore support for the assistant and watcher 2013-08-02 20:37:03 -04:00
Assistant.hs assistant: Work around git-cat-file's not reloading the index after files are staged. 2013-05-25 00:37:41 -04:00
Backend.hs hlint 2013-04-03 03:52:41 -04:00
BuildFlags.hs Allow building without quvi support. 2013-09-09 02:16:22 -04:00
CHANGELOG symlinks 2010-10-27 15:14:59 -04:00
Checks.hs direct, indirect: Refuse to do anything when the assistant or git-annex watch daemon is running. 2013-04-22 16:41:46 -04:00
CmdLine.hs missed some __WINDOWS__ defines 2013-08-04 13:07:55 -04:00
Command.hs status: In local mode, displays information about variance from configured numcopies levels. 2013-09-15 19:10:38 -04:00
Common.hs fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Config.hs Support hot-swapping of removable drives containing gcrypt repositories. 2013-09-12 15:54:35 -04:00
configure.hs Rewrote free disk space checking code 2012-03-22 17:32:47 -04:00
COPYRIGHT Add link COPYRIGHT -> debian/copyright; add COPYRIGHT to sdist. 2012-06-11 23:27:00 -07:00
Creds.hs Allow public-key encryption of file content. 2013-09-03 14:34:16 -04:00
Crypto.hs rename constructor for clariy 2013-09-05 11:12:01 -04:00
Fields.hs safe recv-key in direct mode 2013-01-11 16:03:45 -04:00
ghci brought back fast ghci 2013-02-27 21:38:01 -04:00
git-annex.cabal Use cryptohash rather than SHA for hashing. 2013-09-22 20:06:02 -04:00
git-annex.hs try building test suite on windows 2013-05-17 16:45:44 -04:00
git-union-merge.hs factor out nukeFile 2012-06-06 13:13:13 -04:00
Git.hs squash compiler warnings on Windows 2013-08-04 13:18:05 -04:00
GitAnnex.hs rename remotes to list 2013-09-19 14:16:55 -04:00
GitAnnexShell.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Init.hs missed some __WINDOWS__ defines 2013-08-04 13:07:55 -04:00
INSTALL symlinks 2010-10-27 15:14:59 -04:00
Limit.hs squash compiler warnings on Windows 2013-08-04 13:18:05 -04:00
Locations.hs untested transition detection on merging, and transition running code 2013-08-28 15:57:42 -04:00
Logs.hs refactor git-annex branch log filename code into central location 2013-08-29 19:13:00 -04:00
Makefile avoid setting PREFIX if already set 2013-09-12 16:22:03 -04:00
Messages.hs annex.debug can now be set to enable debug logging by default. The webapp's debugging check box does this. 2013-06-17 20:41:27 -04:00
NEWS update NEWS 2012-01-19 15:27:39 -04:00
Option.hs annex.debug can now be set to enable debug logging by default. The webapp's debugging check box does this. 2013-06-17 20:41:27 -04:00
README add README 2011-05-13 19:20:54 -04:00
Remote.hs sync: support gcrypt 2013-09-09 10:02:15 -04:00
Seek.hs Fix bug that caused typechanged symlinks to be assumed to be unlocked files, so they were added to the annex by the pre-commit hook. 2013-08-22 13:57:07 -04:00
Setup.hs split out library 2013-04-17 12:02:44 -04:00
Test.hs more win warning squashing 2013-09-06 18:54:24 -04:00
Types.hs moved AssociatedFile definition 2013-07-04 02:36:02 -04:00
Upgrade.hs missed some __WINDOWS__ defines 2013-08-04 13:07:55 -04:00
Usage.hs content: New command line way to view and configure a repository's preferred content settings. 2013-05-25 12:44:58 -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/>