summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
Commit message (Collapse)AuthorAge
* Fix bug that prevented enumerating locally present objects in repos tuned ↵Gravatar Joey Hess2015-06-11
| | | | | | | | with annex.tune.objecthash1=true Need to walk 1 level of subdirs less in this case. The git-annex branch traversal code didn't have a similar bug.
* get --incomplete: New option to resume any interrupted downloads.Gravatar Joey Hess2015-06-02
|
* fix windows buildGravatar Joey Hess2015-05-22
|
* better memoize core.sharedrepository handlingGravatar Joey Hess2015-05-19
| | | | | It was memoized, but that was not used consistently. Move it to Types.GitConfig so it will auto-memoize.
* honor core.sharedRepository settings in lockContentGravatar Joey Hess2015-05-19
| | | | | | | | The content file may not be owned by the user running git-annex, in which case, setting the owner write bit was not enough to let lockContent act on the file. However, with some core.sharedRepository configs, the file should be writable by the user's group. So, the thing to do is to call thawContent on it.
* fix inAnnexSafe result for direct file that is being droppedGravatar Joey Hess2015-05-19
| | | | | | | | | | | It was returning Just False in this situation, which differed from indirect mode behavior. I don't think this led to any actual problems; things that checked if the file being dropped was present just failed to fail, and instead reported it wasn't present, possibly incorrectly. Hmm, it's possible that this could have made git annex fsck --from remote update the location log wrongly, if a remote was in direct mode, and was in the middle of trying to drop a key, and the drop later failed.
* convert lockContent to use new LockPoolsGravatar Joey Hess2015-05-19
| | | | | | | | | | | | Also cleaned up the code, avoiding creating a lock file if we're going to open it for create later anyway. And, if there's an exception while preparing to lock the file, but not at the point of actually taking the lock, throw an exception, instead of silently not locking and pretending to succeed. And, on Windows, always use lock file, even if the repo somehow got into indirect mode (maybe with cygwin git..)
* use lock pools throughout git-annexGravatar Joey Hess2015-05-19
| | | | | | | | | | | | | The one exception is in Utility.Daemon. As long as a process only daemonizes once, which seems reasonable, and as long as it avoids calling checkDaemon once it's already running as a daemon, the fcntl locking gotchas won't be a problem there. Annex.LockFile has it's own separate lock pool layer, which has been renamed to LockCache. This is a persistent cache of locks that persist until closed. This is not quite done; lockContent stil needs to be converted.
* Take space that will be used by running downloads into account when checking ↵Gravatar Joey Hess2015-05-12
| | | | annex.diskreserve.
* fix build warning with ghc 7.10Gravatar Joey Hess2015-05-10
|
* When a key's size is unknown, still check the annex.diskreserve, and avoid ↵Gravatar Joey Hess2015-04-17
| | | | | | | getting content if the disk is too full. We can't check if there's enough disk space to download the content, but we *can* check if there's certainly not enough!
* a few hlintsGravatar Joey Hess2015-04-11
|
* contentlocationn: New plumbing command.Gravatar Joey Hess2015-04-09
|
* well along the way to fully quiet --quietGravatar Joey Hess2015-04-04
| | | | | | | Came up with a generic way to filter out progress messages while keeping errors, for commands that use stderr for both. --json mode will disable command outputs too.
* avoid progress bar for url download with --quietGravatar Joey Hess2015-04-03
|
* import Data.Default in CommonGravatar Joey Hess2015-01-28
|
* Repository tuning parameters can now be passed when initializing a ↵Gravatar Joey Hess2015-01-27
| | | | | | | | | | repository for the first time. * init: Repository tuning parameters can now be passed when initializing a repository for the first time. For details, see http://git-annex.branchable.com/tuning/ * merge: Refuse to merge changes from a git-annex branch of a repo that has been tuned in incompatable ways.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* add getFileSize, which can get the real size of a large file on WindowsGravatar Joey Hess2015-01-20
| | | | | | | | | | | | | | Avoid using fileSize which maxes out at just 2 gb on Windows. Instead, use hFileSize, which doesn't have a bounded size. Fixes support for files > 2 gb on Windows. Note that the InodeCache code only needs to compare a file size, so it doesn't matter it the file size wraps. So it has been left as-is. This was necessary both to avoid invalidating existing inode caches, and because the code passed FileStatus around and would have become more expensive if it called getFileSize. This commit was sponsored by Christian Dietrich.
* revert parentDir changeGravatar Joey Hess2015-01-09
| | | | | | | | Reverts 2bba5bc22d049272d3328bfa6c452d3e2e50e86c Unfortunately, this caused breakage on Windows, and possibly elsewhere, because parentDir and takeDirectory do not behave the same when there is a trailing directory separator.
* made parentDir return a Maybe FilePath; removed most uses of itGravatar Joey Hess2015-01-06
| | | | | | | | parentDir is less safe than takeDirectory, especially when working with relative FilePaths. It's really only useful in loops that want to terminate at / This commit was sponsored by Audric SCHILTKNECHT.
* 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.
* 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.
* Do not preserve permissions and acls when copying files from one local git ↵Gravatar Joey Hess2014-08-26
| | | | | | | | | | | | | | | | | repository to another. Timestamps are still preserved as long as cp --preserve=timestamps is supported. This avoids cp -a overriding the default mode acls that the user might have set in a git repository. With GNU cp, this behavior change should not be a breaking change, because git-anex also uses rsync sometimes in the same situation, and has only ever preserved timestamps when using rsync. Systems without GNU cp will no longer use cp -a, but instead just cp. So, timestamps will no longer be preserved. Preserving timestamps when copying between repos is not guaranteed anyway. Closes: #729757
* use types to enforce that removeAnnex can only be called inside lockContentGravatar Joey Hess2014-08-20
| | | | | | | | | | | This fixed one bug where it needed to be and wasn't (in Assistant.Unused). And also found one place where lockContent was used unnecessarily (by drop --from remote). A few other places like uninit probably don't really need to lockContent, but it doesn't hurt to do call it anyway. This commit was sponsored by David Wagner.
* more lock file refactoringGravatar Joey Hess2014-08-20
| | | | | | | | Also fixes a test suite failures introduced in recent commits, where inAnnexSafe failed in indirect mode, since it tried to open the lock file ReadWrite. This is why the new checkLocked opens it ReadOnly. This commit was sponsored by Chad Horohoe.
* avoid trying to create a content file in order to lock itGravatar Joey Hess2014-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The nice refactoring in 7165e4035e9b6cfeaa5d659341749cc957b27e14 highlighted a bug in lockContent -- when the content is not present, this incorrectly created an empty lock file, using the same filename as the content file. This seems like it could result in empty objects, which fsck would detect and complain about. Both drop and move --to call lockContent, as does Remote.Git.dropKey -- I think we got lucky and this bug didn't show up because both all of those only operate on files that are present. So this bug could only manifest if there was a race, and a file's content was dropped at just the wrong time, just as another process was about to drop it. (And then only if the other process's dropping failed, otherwise it'd delete the empty object file.) Hmm, move --from also called lockContent. Unnecessarily, since the content is not being removed from the local annex. In this case, the combination of the 2 bugs could result in an empty lock file being written, and then if the download of the content failed, left in the object directory as the content. This commit also optimises lockContent, avoiding an unncessary doesFileExist test and instead just catching the exception that's thrown when the file doesn't exist. This commit was sponsored by Justine Lam.
* more lock file refactoringGravatar Joey Hess2014-08-20
|
* 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.
* Ensure that all lock fds are close-on-exec, fixing various problems with ↵Gravatar Joey Hess2014-08-20
| | | | | | | | | | | | | | | | | | them being inherited by child processes such as git commands. (With the exception of daemon pid locking.) This fixes at part of #758630. I reproduced the assistant locking eg, a removable drive's annex journal lock file and forking a long-running git-cat-file process that inherited that lock. This did not affect Windows. Considered doing a portable Utility.LockFile layer, but git-annex uses posix locks in several special ways that have no direct Windows equivilant, and it seems like it would mostly be a complication. This commit was sponsored by Protonet.
* unify exception handling into Utility.ExceptionGravatar Joey Hess2014-08-07
| | | | | | | | | | | | | | | | | | | | Removed old extensible-exceptions, only needed for very old ghc. Made webdav use Utility.Exception, to work after some changes in DAV's exception handling. Removed Annex.Exception. Mostly this was trivial, but note that tryAnnex is replaced with tryNonAsync and catchAnnex replaced with catchNonAsync. In theory that could be a behavior change, since the former caught all exceptions, and the latter don't catch async exceptions. However, in practice, nothing in the Annex monad uses async exceptions. Grepping for throwTo and killThread only find stuff in the assistant, which does not seem related. Command.Add.undo is changed to accept a SomeException, and things that use it for rollback now catch non-async exceptions, rather than only IOExceptions.
* 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.
* import metadata from feedsGravatar Joey Hess2014-07-03
| | | | | | | | | | | | | | | | | | | | | | When annex.genmetadata is set, metadata from the feed is added to files that are imported from it. Reused the same feedtitle and itemtitle, feedauthor, itemauthor, etc names that are used in --template. Also added title and author, which are the item title/author if available, falling back to the feed title/author. These are more likely to be common metadata fields. (There is a small bit of dupication here, but once git gets around to packing the object, it will compress it away.) The itempubdate field is not included in the metadata as a string; instead it is used to generate year and month fields, same as is done when adding files with annex.genmetadata set. This commit was sponsored by Amitai Schlair, who cooincidentially is responsible for ikiwiki generating nice feed metadata!
* fixed getting files from bare repos on windowsGravatar Joey Hess2014-06-05
|
* wipGravatar Joey Hess2014-06-05
|
* Fix direct mode getKeysPresent false positive & also sped up direct mode ↵Gravatar Joey Hess2014-03-07
| | | | | | | | | unused and unannex unused: In direct mode, files that are deleted from the work tree are no longer incorrectly detected as unused. Direct mode `git annex info` slows down a bit due to more stringent checking, but not by a lot.
* Put non-object tmp files in .git/annex/misctmp, leaving .git/annex/tmp for ↵Gravatar Joey Hess2014-02-26
| | | | | | | | | | | | | | | | | | | | only partially transferred objects. This allows eg, putting .git/annex/tmp on a ram disk, if the disk IO of temp object files is too annoying (and if you don't want to keep partially transferred objects across reboots). .git/annex/misctmp must be on the same filesystem as the git work tree, since files are moved to there in a way that will not work cross-device, as well as symlinked into there. I first wanted to put the tmp objects in .git/annex/objects/tmp, but that would pose transition problems on upgrade when partially transferred objects existed. git annex info does not currently show the size of .git/annex/misctemp, since it should stay small. It would also be ok to make something clean it out, periodically.
* add UrlOptions sum typeGravatar Joey Hess2014-02-24
|
* Make annex.web-options be used in several places that call curl.Gravatar Joey Hess2014-02-24
|
* unused: Fix to actually detect unused keys when in direct mode.Gravatar Joey Hess2014-02-20
|
* random hlint (to give the autobuilder something new to build)Gravatar Joey Hess2014-02-11
|
* remove workaround for old bugGravatar Joey Hess2014-02-06
| | | | | | | 560b644a52971a7e4706c775982ec29e03ca3ab2 described a bug moving between remotes in direct mode; I can no longer reproduce it with this strange workaround removed. Also test suite still passes. Hope the broken code just got fixed in the meantime.
* work around absNormPath not working on WindowsGravatar Joey Hess2014-02-06
| | | | When making git-annex links, we want unix-style paths in the link targets.
* Windows: Avoid using unix-compat's rename, which refuses to rename directories.Gravatar Joey Hess2014-01-29
| | | | Opened a bug about this: https://github.com/jystic/unix-compat/issues/10
* rework annexed object locking in direct mode & support WindowsGravatar Joey Hess2014-01-28
| | | | | | | | | | | | | | | | Seems that locking of annexed objects when they're being dropped was broken in direct mode: * When taking the lock before dropping, it created the .git/annex/objects file, as an empty file. It seems that the dropping code deleted that, but that is not right, and for all I know could in some situation cause a corrupted object to leak out. * When the lock was checked, it actually tried to open each direct mode file, and checked if it was locked. Not the same lock used above, and could also fail if some consumer of the file locked it. Fixed this, and added windows support by switching direct mode to lock a .lck file.
* added annex.secure-erase-command config option.Gravatar Joey Hess2014-01-24
|
* also check diskreserve for quvi downloadsGravatar Joey Hess2014-01-04
|
* addurl, importfeed: Honor annex.diskreserve as long as the size of the url ↵Gravatar Joey Hess2014-01-04
| | | | | | | | can be checked. This adds a http HEAD before the download is done. That was already the case when the assistant was running, and it seems worth it to avoid filling up the whole disk, like happened to my server today.
* fsck distribution keyGravatar Joey Hess2013-11-23
|