summaryrefslogtreecommitdiff
path: root/Types
Commit message (Collapse)AuthorAge
* add per-remote-type infoGravatar Joey Hess2014-10-21
| | | | | | | | | | Now `git annex info $remote` shows info specific to the type of the remote, for example, it shows the rsync url. Remote types that support encryption or chunking also include that in their info. This commit was sponsored by Ævar Arnfjörð Bjarmason.
* unused importGravatar Joey Hess2014-10-14
|
* vicfg: Deleting configurations now resets to the default, where before it ↵Gravatar Joey Hess2014-10-14
| | | | | | | | | has no effect. Added a Default instance for TrustLevel, and was able to use that to clear up several other parts of the code too. This commit was sponsored by Stephan Schulz
* indent with tabs not spacesGravatar Joey Hess2014-10-09
| | | | | | | | | | | Found these with: git grep "^ " $(find -type f -name \*.hs) |grep -v ': where' Unfortunately there is some inline hamlet that cannot use tabs for indentation. Also, Assistant/WebApp/Bootstrap3.hs is a copy of a module and so I'm leaving it as-is.
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* Promote file not found warning message to an error.Gravatar Joey Hess2014-09-11
|
* New annex.hardlink setting. Closes: #758593Gravatar Joey Hess2014-09-05
| | | | | | | | | | * New annex.hardlink setting. Closes: #758593 * init: Automatically detect when a repository was cloned with --shared, and set annex.hardlink=true, as well as marking the repository as untrusted. Had to reorganize Logs.Trust a bit to avoid a cycle between it and Annex.Init.
* reorganize and refactor lock codeGravatar Joey Hess2014-08-20
| | | | | | | | Added a convenience Utility.LockFile that is not a windows/posix portability shim, but still manages to cut down on the boilerplate around locking. This commit was sponsored by Johan Herland.
* testremote: Add testing of behavior when remote is not availableGravatar Joey Hess2014-08-10
| | | | | | | | | | | | | | | | | | | | Added a mkUnavailable method, which a Remote can use to generate a version of itself that is not available. Implemented for several, but not yet all remotes. This allows testing that checkPresent properly throws an exceptions when it cannot check if a key is present or not. It also allows testing that the other methods don't throw exceptions in these circumstances. This immediately found several bugs, which this commit also fixes! * git remotes using ssh accidentially had checkPresent return an exception, rather than throwing it * The chunking code accidentially returned False rather than propigating an exception when there were no chunks and checkPresent threw an exception for the non-chunked key. This commit was sponsored by Carlo Matteo Capocasa.
* pushed checkPresent exception handling out of Remote implementationsGravatar Joey Hess2014-08-06
| | | | | | | | | | | | | | | | I tend to prefer moving toward explicit exception handling, not away from it, but in this case, I think there are good reasons to let checkPresent throw exceptions: 1. They can all be caught in one place (Remote.hasKey), and we know every possible exception is caught there now, which we didn't before. 2. It simplified the code of the Remotes. I think it makes sense for Remotes to be able to be implemented without needing to worry about catching exceptions inside them. (Mostly.) 3. Types.StoreRetrieve.Preparer can only work on things that return a Bool, which all the other relevant remote methods already did. I do not see a good way to generalize that type; my previous attempts failed miserably.
* better byteRetrieverGravatar Joey Hess2014-08-03
| | | | | | | | | | | | | | Make the byteRetriever be passed the callback that consumes the bytestring. This way, there's no worries about the lazy bytestring not all being read when the resource that's creating it is closed. Which in turn lets bup, ddar, and S3 each switch from using an unncessary fileRetriver to a byteRetriever. So, more efficient on chunks and encrypted files. The only remaining fileRetrievers are hook and external, which really do retrieve to files.
* S3: support chunkingGravatar Joey Hess2014-08-02
| | | | | | | The assistant defaults to 1MiB chunk size for new S3 special remotes. Which will work around a couple of bugs: http://git-annex.branchable.com/bugs/S3_memory_leaks/ http://git-annex.branchable.com/bugs/S3_upload_not_using_multipart/
* specialize Preparer a bit, so resourcePrepare can be addedGravatar Joey Hess2014-08-02
| | | | | | | The forall a. in Preparer made resourcePrepare not seem to be usable, so I specialized a to Bool. Which works for both Preparer Storer and Preparer Retriever, but wouldn't let the Preparer be used for hasKey as it currently stands.
* add new section for testing commandsGravatar Joey Hess2014-08-01
|
* optimise case of remote that retrieves FileContent, when chunks and ↵Gravatar Joey Hess2014-07-29
| | | | | | | | | | encryption are not being used No need to read whole FileContent only to write it back out to a file in this case. Can just rename! Yay. Also indidentially, fixed an attempt to open a file for write that was already opened for write, which caused a crash and deadlock.
* better type for RetrieverGravatar Joey Hess2014-07-29
| | | | | | | | Putting a callback in the Retriever type allows for the callback to remove the retrieved file when it's done with it. I did not really want to make Retriever be fixed to Annex Bool, but when I tried to use Annex a, I got into some type of type mess.
* allow Retriever action to update the progress meterGravatar Joey Hess2014-07-29
| | | | | | | | Needed for eg, Remote.External. Generally, any Retriever that stores content in a file is responsible for updating the meter, while ones that procude a lazy bytestring cannot update the meter, so are not asked to.
* lift types from IO to AnnexGravatar Joey Hess2014-07-29
| | | | | | | | | | | Some remotes like External need to run store and retrieve actions in Annex, not IO. In order to do that lift, I had to dive pretty deep into the utilities, making Utility.Gpg and Utility.Tmp be partly converted to using MonadIO, and Control.Monad.Catch for exception handling. There should be no behavior changes in this commit. This commit was sponsored by Michael Barabanov.
* add ContentSource type, for remotes that act on files rather than ByteStringsGravatar Joey Hess2014-07-29
| | | | | Note that currently nothing cleans up a ContentSource's file, when eg, retrieving chunks.
* resume interrupted chunked uploadsGravatar Joey Hess2014-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Leverage the new chunked remotes to automatically resume uploads. Sort of like rsync, although of course not as efficient since this needs to start at a chunk boundry. But, unlike rsync, this method will work for S3, WebDAV, external special remotes, etc, etc. Only directory special remotes so far, but many more soon! This implementation will also allow starting an upload from one repository, interrupting it, and then resuming the upload to the same remote from an entirely different repository. Note that I added a comment that storeKey should atomically move the content into place once it's all received. This was already an undocumented requirement -- it's necessary for hasKey to work reliably. This resume code just uses hasKey to find the first chunk that's missing. Note that if there are two uploads of the same key to the same chunked remote, one might resume at the point the other had gotten to, but both will then redundantly upload. As before. In the non-resume case, this adds one hasKey call per storeKey, and only if the remote is configured to use chunks. Future work: Try to eliminate that hasKey. Notice that eg, `git annex copy --to` checks if the key is present before sending it, so is already running hasKey.. which could perhaps be cached and reused. However, this additional overhead is not very large compared with transferring an entire large file, and the ability to resume is certianly worth it. There is an optimisation in place for small files, that avoids trying to resume if the whole file fits within one chunk. This commit was sponsored by Georg Bauer.
* fix handling of removal of keys that are not presentGravatar Joey Hess2014-07-28
|
* resume interrupted chunked downloadsGravatar Joey Hess2014-07-27
| | | | | | | | | | | | | | | | | | Leverage the new chunked remotes to automatically resume downloads. Sort of like rsync, although of course not as efficient since this needs to start at a chunk boundry. But, unlike rsync, this method will work for S3, WebDAV, external special remotes, etc, etc. Only directory special remotes so far, but many more soon! This implementation will also properly handle starting a download from one remote, interrupting, and resuming from another one, and so on. (Resuming interrupted chunked uploads is similarly doable, although slightly more expensive.) This commit was sponsored by Thomas Djärv.
* add key stability checking interfaceGravatar Joey Hess2014-07-27
| | | | | | | Needed for resuming from chunks. Url keys are considered not stable. I considered treating url keys with a known size as stable, but just don't feel that is enough information.
* wordingGravatar Joey Hess2014-07-26
|
* use same hash directories for chunked key as are used for its parentGravatar Joey Hess2014-07-25
| | | | | | | | | | | This avoids a proliferation of hash directories when using new-style chunking, and should improve performance since chunks are accessed in sequence and so should have a common locality. Of course, when a chunked key is encrypted, its hash directories have no relation to the parent key. This commit was sponsored by Christian Kellermann.
* add chunk metadata to KeyGravatar Joey Hess2014-07-24
| | | | | | | | Added new fields for chunk number, and chunk size. These will not appear in normal keys ever, but will be used for chunked data stored on special remotes. This commit was sponsored by Jouni K Seppanen.
* migrate: Avoid re-checksumming when migrating from hashE to hash backend.Gravatar Joey Hess2014-07-10
|
* execute remote.<name>.annex-shell on remote, if setGravatar Fraser Tweedale2014-05-16
| | | | | | | | It is useful to be able to specify an alternative git-annex-shell program to execute on the remote, e.g., to run a version not on the PATH. Use remote.<name>.annex-shell if specified, instead of the default "git-annex-shell" i.e., first so-named executable on the PATH.
* ddar special remoteGravatar Robie Basak2014-05-15
|
* add CredPair cacheGravatar Joey Hess2014-04-29
| | | | | | | Note that this does not yet use SecureMem. It would probably make sense for the Password part of a CredPair to use SecureMem, and making that change is better than passing in a String and having it converted to SecureMem in this code.
* reinit: New command that can initialize a new reposotory using the ↵Gravatar Joey Hess2014-04-15
| | | | configuration of a previously known repository. Useful if a repository got deleted and you want to clone it back the way it was.
* reorg matcher types; no non-type code changesGravatar Joey Hess2014-03-29
|
* avoid generating arbitrary MetaData with illegal fieldsGravatar Joey Hess2014-03-26
|
* add desktop notificationsGravatar Joey Hess2014-03-22
| | | | | | | Motivation: Hook scripts for nautilus or other file managers need to provide the user with feedback that a file is being downloaded. This commit was sponsored by THM Schoemaker.
* hilarious typoGravatar Joey Hess2014-03-18
|
* Each for each metadata field, there's now an automatically maintained ↵Gravatar Joey Hess2014-03-18
| | | | | | | | | | "$field-lastchanged" that gives the timestamp of the last change to that field. Note that this is a nearly entirely free feature. The data was already stored in the metadata log in an easily accessible way, and already was parsed to a time when parsing the log. The generation of the metadata fields may even be done lazily, although probably not entirely (the map has to be evaulated to when queried).
* finish wiring up groupwantedGravatar Joey Hess2014-03-15
|
* vicfg: Allows editing preferred content expressions for groups.Gravatar Joey Hess2014-03-15
| | | | | This is stored in the git-annex branch, but not yet actually hooked up and used.
* only run sshCleanup when the command actually used ssh connection cachingGravatar Joey Hess2014-03-13
| | | | | Optimises query commands that do not. More importantly, avoids any ssh connection cleanup delay causing problems at the end of such commands.
* clean up cleanup action enumerationGravatar Joey Hess2014-03-13
|
* annex.startupscan can be set to false to disable the assistant's startup scan.Gravatar Joey Hess2014-03-05
|
* thought of another way to break prop_idempotent_key_decodeGravatar Joey Hess2014-03-05
|
* quickcheck says: "a-s--a" is not a legal key filenameGravatar Joey Hess2014-03-05
| | | | | | | | | | Found this in failed armhf build log, where quickcheck found a way to break prop_idempotent_key_decode. The "s" indicates size, but since nothing comes after it, that's not valid. When encoding the resulting key, no size was present, so it encoded to "a--a". Also, "a-sX--a" is not legal, since X is not a number. Not found by quickcheck.
* pre-commit-annex hook script to automatically extract metadata from lots of ↵Gravatar Joey Hess2014-03-02
| | | | | | | | | | | | | | | | | | types of files Using the extract(1) program to do the heavy lifting. Decided to make git-annex run pre-commit-annex when committing. Since git-annex pre-commit also runs it, it'll be run when git commit is run too, via the pre-commit hook. This basically gives back the pre-commit hook that git-annex took away. The implementation avoids repeatedly looking for the hook script when the assistant is running and committing repeatedly; only checks if the hook is available once. To make the script simpler, made git-annex metadata -s field?=value only set a field when it's not already got a value. This commit was sponsored by bak.
* vadd: Allow listing multiple desired values for a field.Gravatar Joey Hess2014-03-02
|
* view, vfilter: Add support for filtering tags and values out of a view, ↵Gravatar Joey Hess2014-03-02
| | | | | | | | | | using !tag and field!=value. Note that negated globs are not supported. Would have complicated the code to add them, without changing the data type serialization in a non-backwards-compatable way. This commit was sponsored by Denver Gingerich.
* annex.listen can be configured, instead of using --listenGravatar Joey Hess2014-03-01
|
* webapp: Don't list the public repository group when editing a git ↵Gravatar Joey Hess2014-02-28
| | | | repository; it only makes sense for special remotes.
* metadata: FIeld names are now case insensative.Gravatar Joey Hess2014-02-25
|
* metadata: Field names limited to alphanumerics and a few whitelisted ↵Gravatar Joey Hess2014-02-23
| | | | punctuation characters to avoid issues with views, etc.