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 ee309d6941
lock: Fix edge cases where data loss could occur in v6 mode.
In the case where the pointer file is in place, and not the content
of the object, lock's  performNew was called with filemodified=True,
which caused it to try to repopulate the object from an unmodified
associated file, of which there were none. So, the content of the object
got thrown away incorrectly. This was the cause (although not the root
cause) of data loss in https://github.com/datalad/datalad/issues/1020

The same problem could also occur when the work tree file is modified,
but the object is not, and lock is called with --force. Added a test case
for this, since it's excercising the same code path and is easier to set up
than the problem above.

Note that this only occurred when the keys database did not have an inode
cache recorded for the annex object. Normally, the annex object would be in
there, but there are of course circumstances where the inode cache is out
of sync with reality, since it's only a cache.

Fixed by checking if the object is unmodified; if so we don't need to
try to repopulate it. This does add an additional checksum to the unlock
path, but it's already checksumming the worktree file in another case,
so it doesn't slow it down overall.

Further investigation found a similar problem occurred when smudge --clean
is called on a file and the inode cache is not populated. cleanOldKeys
deleted the unmodified old object file in this case. This was also
fixed by checking if the object is unmodified.

In general, use of getInodeCaches and sameInodeCache is potentially
dangerous if the inode cache has not gotten populated for some reason.
Better to use isUnmodified. I breifly auited other places that check the
inode cache, and did not see any immediate problems, but it would be easy
to miss this kind of problem.
2016-10-17 13:58:43 -04:00
Annex lock: Fix edge cases where data loss could occur in v6 mode. 2016-10-17 13:58:43 -04:00
Assistant convert TMVars that are never left empty into TVars 2016-09-30 19:51:16 -04:00
Backend Improve SHA*E extension extraction code. 2016-05-27 13:14:51 -04:00
Build remove localedir file, fix build 2016-10-05 11:29:14 -04:00
CmdLine addurl, get: Added --json-progress option, which adds progress objects to the json output. 2016-09-09 15:06:54 -04:00
Command lock: Fix edge cases where data loss could occur in v6 mode. 2016-10-17 13:58:43 -04:00
Config webapp: Fix bugs that could result in a relative path such as "." being written to ~/.config/git-annex/autostart 2015-12-02 15:57:30 -04:00
Database slightly more efficient checking of versionUsesKeysDatabase 2016-07-19 14:02:49 -04:00
debian Removed dependency on json library; all JSON is now handled by aeson. 2016-07-26 19:15:34 -04:00
doc Merge branch 'master' of ssh://git-annex.branchable.com 2016-10-13 14:04:51 -04:00
Git fix tree graft-in bug 2016-10-11 15:36:40 -04:00
Limit matchexpression: New plumbing command to check if a preferred content expression matches some data. 2016-01-25 16:16:18 -04:00
Logs Optimised git-annex branch log file timestamp parsing. 10% speedup 2016-09-29 14:04:53 -04:00
Messages add missing case for unknown size with normal output 2016-10-05 15:10:24 -04:00
Remote convert TMVars that are never left empty into TVars 2016-09-30 19:51:16 -04:00
RemoteDaemon make LocalRepo a newtype 2016-06-02 16:34:52 -04:00
standalone Linux standalone: Include locale files in the bundle, and generate locale definition files for the locales in use when starting runshell. 2016-10-04 16:37:43 -04:00
static Revert "remove newlines from static js and css" 2014-06-13 02:20:39 -04:00
templates New url for git-remote-gcrypt, now maintained by spwhitton. 2016-07-05 11:30:58 -04:00
Types drop incremental json object display; clean up code 2016-09-09 18:13:55 -04:00
Upgrade When auto-upgrading a v3 remote, avoid upgrading to version 6, instead keep it at version 5. 2016-10-05 16:23:09 -04:00
Utility use System.Directory not Utility.Directory 2016-09-22 11:34:55 -04:00
.ghci workaround for ghci fragility in reusing objects compiled with ghc 2012-10-20 16:20:42 -04:00
.gitattributes update changelog location 2016-08-22 23:54:11 -04:00
.gitignore fix man page building 2016-06-02 16:54:58 -04:00
.mailmap alias for Yaroslav @ yahoo to mailmap 2015-09-09 12:38:59 -04:00
Annex.hs Optimisations to git-annex branch query and setting, avoiding repeated copies of the environment. 2016-09-29 13:36:48 -04:00
Assistant.hs move old ghc compat code into separate module; eliminate WITH_CLIBS 2016-02-15 11:47:33 -04:00
Backend.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
bash-completion.bash fix bash completion of filenames containing spaces 2015-07-20 11:17:35 -04:00
build.bat let build.bat also be run from cygwin terminal 2015-04-21 14:12:14 -04:00
BuildFlags.hs Remove the EKG build flag, since Gentoo for some reason decided to enable this flag, depsite it not being intended for production use and so enabled by default. 2016-07-06 15:09:56 -04:00
CHANGELOG lock: Fix edge cases where data loss could occur in v6 mode. 2016-10-17 13:58:43 -04:00
CmdLine.hs Make --json and --quiet suppress automatic init messages 2016-09-05 15:34:38 -04:00
Command.hs Make --json and --quiet suppress automatic init messages 2016-09-05 15:34:38 -04:00
Common.hs avoid warnings about not exported System.Directory.isSymbolicLink 2016-04-28 15:18:11 -04:00
Config.hs refactor isBareRepo 2016-06-02 16:59:47 -04:00
COPYRIGHT fix lintian pedantry 2016-07-19 14:43:32 -04:00
Creds.hs plumb RemoteGitConfig through to decryptCipher 2016-05-23 17:33:32 -04:00
Crypto.hs cleanup 2016-05-23 17:51:15 -04:00
ghci fix script 2016-02-15 16:05:52 -04:00
git-annex.cabal releasing package git-annex version 6.20161012 2016-10-12 09:38:03 -04:00
git-annex.hs wire tasty's option parser into the main program option parser 2015-07-13 13:20:10 -04:00
git-union-merge.hs unify handling of unusual GIT_INDEX_FILE relative path 2016-05-17 14:42:06 -04:00
Git.hs Propigate GIT_DIR and GIT_WORK_TREE environment to external special remotes. 2016-05-06 12:26:44 -04:00
Limit.hs Fix bug in annex.largefiles mimetype= matching when git-annex is run in a subdirectory of the repository. 2016-04-12 14:19:34 -04:00
Logs.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Makefile Linux standalone: Include locale files in the bundle, and generate locale definition files for the locales in use when starting runshell. 2016-10-04 16:37:43 -04:00
Messages.hs drop incremental json object display; clean up code 2016-09-09 18:13:55 -04:00
NEWS Updated cabal file explictly lists source files. 2016-05-24 01:28:07 -04:00
README use https 2014-11-06 14:20:10 -04:00
Remote.hs Removed dependency on json library; all JSON is now handled by aeson. 2016-07-26 19:15:34 -04:00
Setup.hs Remove Makefile from cabal tarball; man page building is now handled by a small haskell program. 2016-05-31 13:58:13 -04:00
stack.yaml pin concurrent-output to a version that works on windows 2016-09-21 18:01:46 -04:00
Test.hs lock: Fix edge cases where data loss could occur in v6 mode. 2016-10-17 13:58:43 -04:00
Types.hs remove module unused since switch to optparse-applicative 2016-01-21 12:59:50 -04:00
Upgrade.hs When auto-upgrading a v3 remote, avoid upgrading to version 6, instead keep it at version 5. 2016-10-05 16:23:09 -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 <https://git-annex.branchable.com/>