summaryrefslogtreecommitdiff
path: root/Annex
Commit message (Collapse)AuthorAge
* Fix a few bugs involving filenames that are at or near the filesystem's ↵Gravatar Joey Hess2013-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maximum filename length limit. Started with a problem when running addurl on a really long url, because the whole url is munged into the filename. Ended up doing a fairly extensive review for places where filenames could get too large, although it's hard to say I'm not missed any.. Backend.Url had a 128 character limit, which is fine when the limit is 255, but not if it's a lot shorter on some systems. So check the pathconf() limit. Note that this could result in fromUrl creating different keys for the same url, if run on systems with different limits. I don't see this is likely to cause any problems. That can already happen when using addurl --fast, or if the content of an url changes. Both Command.AddUrl and Backend.Url assumed that urls don't contain a lot of multi-byte unicode, and would fail to truncate an url that did properly. A few places use a filename as the template to make a temp file. While that's nice in that the temp file name can be easily related back to the original filename, it could lead to `git annex add` failing to add a filename that was at or close to the maximum length. Note that in Command.Add.lockdown, the template is still derived from the filename, just with enough space left to turn it into a temp file. This is an important optimisation, because the assistant may lock down a bunch of files all at once, and using the same template for all of them would cause openTempFile to iterate through the same set of names, looking for an unused temp file. I'm not very happy with the relatedTemplate hack, but it avoids that slowdown. Backend.WORM does not limit the filename stored in the key. I have not tried to change that; so git annex add will fail on really long filenames when using the WORM backend. It seems better to preserve the invariant that a WORM key always contains the complete filename, since the filename is the only unique material in the key, other than mtime and size. Since nobody has complained about add failing (I think I saw it once?) on WORM, probably it's ok, or nobody but me uses it. There may be compatability problems if using git annex addurl --fast or the WORM backend on a system with the 255 limit and then trying to use that repo in a system with a smaller limit. I have not tried to deal with those. This commit was sponsored by Alexander Brem. Thanks!
* Fix inverted logic in last release's fix for data loss bug, that caused ↵Gravatar Joey Hess2013-07-30
| | | | git-annex sync on FAT or other crippled filesystems to add symlink standin files to the annex.
* importfeed: git-annex becomes a podcatcher in 150 LOCGravatar Joey Hess2013-07-28
|
* For long hostnames, use a hash of the hostname to generate the socket file ↵Gravatar Joey Hess2013-07-22
| | | | | | | | | | | for ssh connection caching. This is ok to do now that the socket filename never needs to be mapped back to a hostname. Short hostnames will still appear in the clear, which is less obfuscated. So this cannot possibly make ssh connection caching fail for a hostname it used to work for.
* stop cached ssh connection w/o needing to look up host and portGravatar Joey Hess2013-07-21
| | | | | | | | Turns out that with -O stop -S socketfile, ssh does not need the real hostname, or port to be specificed. This is because it simply talks to the ssh behind the socket and tells it to stop. So, can eliminate the conversion back from a socketfile to host and port. Which will allow using shorter filenames for sockets in the future.
* avoid false positives when detecting core.symlinks=false symlink standin filesGravatar Joey Hess2013-07-20
| | | | | | | | If the file is > 8192 bytes, it's certianly not a symlink file. And if it contains nuls or newlines or whitespace, it's certianly not a link to annexed content. But it might be a tarball containing a git-annex repo.
* avoid reading files that are not symlinks when core.symlinks=falseGravatar Joey Hess2013-07-20
| | | | | | This hack is only needed on FAT filesystems, so there's no point in doing it the rest of the time. And it's possible for there to be a false positive, so it's best to avoid the hack when possible.
* fix uninit to delete content from annex when it ended up hard linked back to ↵Gravatar Joey Hess2013-07-18
| | | | the work tree
* fsck: Don't claim to fix direct mode when run on a symlink whose content is ↵Gravatar Joey Hess2013-07-08
| | | | not present.
* detect system with no dot in FQDN, where git commit will fail, and workaroundGravatar Joey Hess2013-07-05
| | | | | Sigh, git is so *fragile*. Or rather, across the set of systems that use git-annex, where are no many horribly broken systems..
* moved AssociatedFile definitionGravatar Joey Hess2013-07-04
|
* avoid failure creating inode sentinal fileGravatar Joey Hess2013-06-18
| | | | | | Test suite on windows failed running git annex init in a bare clone of an annexed repo. The annex directory didn't exist when it tried to write the inode sentinal file.
* Revert "Windows: Ssh connection caching is now supported."Gravatar Joey Hess2013-06-17
| | | | | | Yeah, that didn't actually work. Got error messages like it couldn't read from the control socket, so probably ssh doesn't really support that on Windows, at least the cygwin ssh build I'm using.
* Windows: Ssh connection caching is now supported.Gravatar Joey Hess2013-06-17
| | | | Turns out the socket stuff just works on windows.
* avoid lazy read of file contentsGravatar Joey Hess2013-06-17
| | | | | | | On Windows, that means the file could still be open when later code wants to delete it, which fails. Since we're only reading 8k anyway, just read it, strictly. However, avoid reading the whole file strictly, so no getContentsStrict here.
* typo in commentGravatar Joey Hess2013-06-17
|
* assistant: In direct mode, objects are now only dropped when all associated ↵Gravatar Joey Hess2013-06-15
| | | | files are unwanted. This avoids a repreated drop/get loop of a file that has a copy in an archive directory, and a copy not in an archive directory. (Indirect mode still has some buggy behavior in this area, since it does not keep track of associated files.) Closes: #712060
* avoid warnings when built with ghc 7.6Gravatar Joey Hess2013-06-02
|
* remove debug printGravatar Joey Hess2013-05-27
|
* Merge branch 'robustness'Gravatar Joey Hess2013-05-25
|\
| * make direct mode merge cleanup more robustGravatar Joey Hess2013-05-25
| | | | | | | | | | | | | | | | If the cleanup of a single file fails for some reason, continue to clean up other files. This could happen because of a race. The merge pulls in a change to a file, which gets changed locally at the same time.
| * improve robustness of fromDirect and replaceFileGravatar Joey Hess2013-05-25
| | | | | | | | | | | | | | | | | | Made fromDirect check that a file in the tree has good content (and is not a broken symlink either) before copying it to another file that has the same key. Made replaceFile clean up the temp file if the action that creates it, or the file replacement action fails.
* | assistant: Work around git-cat-file's not reloading the index after files ↵Gravatar Joey Hess2013-05-25
| | | | | | | | | | | | are staged. Argh.
* | refactorGravatar Joey Hess2013-05-24
|/
* XMPP: Avoid redundant and unncessary pushes. Note that this breaks ↵Gravatar Joey Hess2013-05-21
| | | | compatibility with previous versions of git-annex, which will refuse to accept any XMPP pushes from this version.
* 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
|/ /