summaryrefslogtreecommitdiff
path: root/Annex
Commit message (Collapse)AuthorAge
* update inode cache after copying contentGravatar Joey Hess2013-05-20
| | | | | | | This was also tripped by the test suite's automatic conflict resolution test. Which also shows BTW that an unnecessary copy of content is done sometimes when merging in direct mode. Not going to try to speed that up now.
* didn't quite get removeDirect right before, this passes test suiteGravatar Joey Hess2013-05-20
|
* Fix a bug in the git-annex branch handling code that could cause info from a ↵Gravatar Joey Hess2013-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remote to not be merged and take effect immediately. This bug was turned up by the test suite, running fsck in direct mode. A repository was cloned, was put into direct mode, was fscked, and fsck incorrectly said that no copy existed of a file, that was actually present in origin. This turned out to occur because fsck first did a Annex.Branch.change, recording that it did not locally have the file. That was recorded in the journal. Since neither the git annex direct not the fsck had yet needed to read any info from the branch, but had only made changes to it, the origin/git-annex branch was not yet merged in. So the journal got a location log entry written to it, but this did not include the location log info for the origin. When fsck then did a Annex.Branch.get, it trusted the journal was cosnsitent, and returned it, again w/o merging from origin/git-annex. This latter behavior is the actual bug. Refer to commit e9bfa8eaed3ff59a4c0bc8d4d677bc493177807c for the thinking behind it being ok to make a change to a file on the branch, without first merging the branch. That thinking still stands. However, it means that files in the journal cannot be trusted to be consistent if the branch has not been merged. So, to fix, just enure the branch gets merged, even when reading from the journal. In tests, this does not seem to cause any extra merging. Except, of course, in the one case described above. But git annex add, etc, are able to make changes w/o first merging the branch.
* minor optimisation and warning fixGravatar Joey Hess2013-05-20
|
* direct mode bug fix: After a conflicted merge was automatically resolved, ↵Gravatar Joey Hess2013-05-20
| | | | | | | | | | | | | | | | | the content of a file that was already present could incorrectly be replaced with a symlink. The bug was in movein, which just replaceFile'd the file with a symlink, even if it already had the desired content, before trying to pull the content out of the annex and replace the symlink with it. That was ok-ish for non conflicted merges, where if the file existed it would be an old version of the content. But for conflicted merges, the automatic merge resolver has already run, and will have already put the desired content into the file for the local variant. Also, made removeDirect not trust that the associated files map is correct. Only if it can verify that another file has the content will it not move it into .git/annex/objects.
* Switch to MonadCatchIO-transformers for better handling of state while ↵Gravatar Joey Hess2013-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | catching exceptions. As seen in this bug report, the lifted exception handling using the StateT monad throws away state changes when an action throws an exception. http://git-annex.branchable.com/bugs/git_annex_fork_bombs_on_gpg_file/ .. Which can result in cached values being redundantly calculated, or other possibly worse bugs when the annex state gets out of sync with reality. This switches from a StateT AnnexState to a ReaderT (MVar AnnexState). All changes to the state go via the MVar. So when an Annex action is running inside an exception handler, and it makes some changes, they immediately go into affect in the MVar. If it then throws an exception (or even crashes its thread!), the state changes are still in effect. The MonadCatchIO-transformers change is actually only incidental. I could have kept on using lifted-base for the exception handling. However, I'd have needed to write a new instance of MonadBaseControl for the new monad.. and I didn't write the old instance.. I begged Bas and he kindly sent it to me. Happily, MonadCatchIO-transformers is able to derive a MonadCatchIO instance for my monad. This is a deep level change. It passes the test suite! What could it break? Well.. The most likely breakage would be to code that runs an Annex action in an exception handler, and *wants* state changes to be thrown away. Perhaps the state changes leaves the state inconsistent, or wrong. Since there are relatively few places in git-annex that catch exceptions in the Annex monad, and the AnnexState is generally just used to cache calculated data, this is unlikely to be a problem. Oh yeah, this change also makes Assistant.Types.ThreadedMonad a bit redundant. It's now entirely possible to run concurrent Annex actions in different threads, all sharing access to the same state! The ThreadedMonad just adds some extra work on top of that, with its own MVar, and avoids such actions possibly stepping on one-another's toes. I have not gotten rid of it, but might try that later. Being able to run concurrent Annex actions would simplify parts of the Assistant code.
* warningGravatar Joey Hess2013-05-19
|
* improve handling of receiving object in direct mode when associated files ↵Gravatar Joey Hess2013-05-17
| | | | | | | | | | | | are modified Before, if a direct mode repo had one or more associated files that were modifed, moving the object into it would overwrite the associated files with the pristine object. Now, modified associated files are left unchanged. To ensure that, when an object is moved into a direct mode repo, it's not thrown away, it gets stored in indirect mode.
* store copy in inode cache tooGravatar Joey Hess2013-05-17
|
* test suite passes in direct modeGravatar Joey Hess2013-05-17
| | | | | | | | | | | This fixes a bug with git annex add in direct mode. If some files already existed in the tree pointing at the same key as a file that was just added, and their content was not present, add neglected to copy the content to those files. I also changed the behavior of moveAnnex slightly: When content is moved into the annex in direct mode, it does not overwrite any content already present in direct mode files. That content may be modified after all.
* fix android build, broken by changes for windows portGravatar Joey Hess2013-05-16
|
* Merge branch 'master' into windowsGravatar Joey Hess2013-05-15
|\
| * fix toDirectGen bug introduced in 7d345fcb307cfecb5fa834a0b17be01e4e6f5df8Gravatar Joey Hess2013-05-15
| |
| * start one git-cat-file per index fileGravatar Joey Hess2013-05-15
| | | | | | | | | | | | | | This reverts a5031031f0d596b2381a785925beb574d90a862e and properly fixes the issue discussed there. This makes git-annex behave much nicer in direct mode.
* | fix the day's Windows permissions damageGravatar Joey Hess2013-05-14
| |
* | convert from internal git path when checking symlink standin fileGravatar Joey Hess2013-05-14
| |
* | Merge remote-tracking branch 'gnu/windows' into windowsGravatar Joey Hess2013-05-14
|\ \
* | | fix importsGravatar Joey Hess2013-05-14
| | |
| * | always try to read symlink; only fall back to looking inside fileGravatar Joey Hess2013-05-14
|/ / | | | | | | | | | | On Windows with Cygwin, checking out a git-annex repo will create symlinks on disk, so we need to always try to read the symlink, even when core.symlinks says they're not supported.
* | fix importsGravatar Joey Hess2013-05-14
| |
* | Merge branch 'windows' of git://git-annex.branchable.com into windowsGravatar Joey Hess2013-05-13
|\ \
* | | read inode cache file strictly to avoid failure to drop on windowsGravatar Joey Hess2013-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Seems that Windows doesn't allow deleting a file that the same process has open. Here the inode cache file was read and a the value from it gets used later. But due to laziness, the old file is still open when it gets deleted. Adding strictness avoids this problem. Of course, the file is small, so it's no problem to read it all strictly, so this is probably an improvement even outside of Windows.
| | * fix warningsGravatar Joey Hess2013-05-13
| | |
| * | rename moduleGravatar Joey Hess2013-05-12
| | |
| * | fix the day's windows permissions damageGravatar Joey Hess2013-05-12
|/ /
* | deal with git using / internally, even on DOSGravatar Joey Hess2013-05-12
| |
* | fixGravatar Joey Hess2013-05-12
| |
* | deal with dos path separatorsGravatar Joey Hess2013-05-12
| |
* | fix permission damage (thanks, Windows)Gravatar Joey Hess2013-05-11
| |
* | clean up from windows portingGravatar Joey Hess2013-05-11
| |
* | git-annex now builds on Windows (doesn't work)Gravatar Joey Hess2013-05-11
| |
* | fixup #if 0 stubs to use #ifndef mingw32_HOST_OSGravatar Joey Hess2013-05-10
| | | | | | | | | | | | That's needed in files used to build the configure program. For the other files, I'm keeping my __WINDOWS__ define, as I find that much easier to type. I may search and replace it to use the mingw32_HOST_OS thing later.
* | stub out POSIX stuffGravatar Joey Hess2013-05-10
|/
* git-annex-shell: Ensure that received files can be read. Files transferred ↵Gravatar Joey Hess2013-05-06
| | | | from some Android devices may have very broken permissions as received.
* direct: Fix a bug that could cause some files to be left in indirect mode.Gravatar Joey Hess2013-05-06
| | | | | | | | | It's possible for files in indirect mode to have a direct mode mapping file. Probably from when they were in direct mode. In this case, toDirectGen tried to copy the content from the direct mode file that the mapping said had it. But, being in indirect mode, it didn't really have the content. So it did nothing. This fix makes it always move the content from .git/annex/objects/ when it's there.
* work around git/environment/gecos/android suckGravatar Joey Hess2013-05-03
| | | | | | | I don't know why, but I can't seem to set the environment variables inside git-annex to work around the git error caused by android's crappy username and hostname settings. This workaround works, and that's all that's good about it.
* set EMAIL when GECOS workaround is neededGravatar Joey Hess2013-05-03
| | | | | | | | | Git fails on Android, because it gets some weird domain for local host like "localhost.(none)". This works around that. I made it always set EMAIL when GECOS workaround was needed (unless EMAIL is already set). It might be nicer to try to get the hostname.domain as git does, and only set it if that fails. But I don't want to be stuck trying to exactly duplicate whatever git is doing.
* thaw content directory in direct mode tooGravatar Joey Hess2013-04-30
| | | | | | | | A content directory can be frozen in direct mode. One way this can happen is if the content is transferred before direct mode has a mapping for it, so it's stored in the content directory. So, we need to thaw the content directory before doing things with it.
* refactorGravatar Joey Hess2013-04-30
|
* per-IA-item content directoriesGravatar Joey Hess2013-04-25
|
* sync: Bug fix, avoid adding to the annex the dummy symlinks used on crippled ↵Gravatar Joey Hess2013-04-23
| | | | | | | | | | | | | | | | | | | filesystems. The root of the problem is that toInodeCache sees a non-symlink, and so goes on and generates a new inode cache for the dummy symlink. Any place that toInodeCache, or sameFileStatus, or genInodeCache are called may need to deal with this case. Although many of them are ok. For example, prepSendAnnex calls sameInodeCache, which calls genInodeCache.. but if the file content is not present, the InodeCache generated for its standin file is appropriately not the same, and so it returns Nothing. I've audited some, but have to say I'm not happy with this; it should be handled at the type level somehow, or a toInodeCache wrapper be used that is aware of dummy symlinks. (The Watcher already dealt with it, via the guardSymlinkStandin function.)
* expose Control.Monad.joinGravatar Joey Hess2013-04-22
| | | | | I think I've been looking for that function for some time. Ie, I remember wanting to collapse Just Nothing to Nothing.
* Detect systems that have no user name set in GECOS, and also don't have ↵Gravatar Joey Hess2013-04-22
| | | | user.name set in git config, and put in a workaround so that commits to the git-annex branch (and the assistant) will still succeed despite git not liking the system configuration.
* Allow rsync to use other remote shells.Gravatar guilhem2013-04-13
| | | | | | Introduced a new per-remote option 'annex-rsync-transport' to specify the remote shell that it to be used with rsync. In case the value is 'ssh', connections are cached unless 'sshcaching' is unset.
* implement massReplaceGravatar Joey Hess2013-04-08
| | | | | | This looks at the string one char at a time, which is hardly efficient.. but more than good enough for expanding variables in relatively short command lines.
* Added annex.web-download-command setting.Gravatar Joey Hess2013-04-08
|
* Bugfix: Direct mode no longer repeatedly checksums duplicated files.Gravatar Joey Hess2013-04-06
| | | | | | | | | | | | | | | | | Fixed by storing a list of cached inodes for a key, instead of just one. Backwards compatability note: An old git-annex version will fail to parse an inode cache file that has been written by a new version, and has multiple items. It will succees if just one. So old git-annexes will have even worse behavior when there are duplicated files, if that is possible. I don't think it will be a problem. (Famous last words.) Also, note that it doesn't expire old and unused inode caches for a key. It would be possible to add this if needed; just look through the associated files for a key and if there are more cached inodes, throw out any not corresponding to associated files. Unless a file is being copied repeatedly and the old copy deleted, this lack of expiry should not be a problem.
* Use lower case hash directories for storing files on crippled filesystems, ↵Gravatar Joey Hess2013-04-04
| | | | | | | | | | | | | | | same as is already done for bare repositories. * since this is a crippled filesystem anyway, git-annex doesn't use symlinks on it * so there's no reason to use the mixed case hash directories that we're stuck using to avoid breaking everyone's symlinks to the content * so we can do what is already done for all bare repos, and make non-bare repos on crippled filesystems use the all-lower case hash directories * which are, happily, all 3 letters long, so they cannot conflict with mixed case hash directories * so I was able to 100% fix this and even resuming `git annex add` in the test case will recover and it will all just work.
* hlintGravatar Joey Hess2013-04-03
|
* cleanupGravatar Joey Hess2013-04-02
|