aboutsummaryrefslogtreecommitdiff
path: root/Utility
Commit message (Collapse)AuthorAge
* avoid warnings about not exported System.Directory.isSymbolicLinkGravatar Joey Hess2016-04-28
|
* Fix build with directory-1.2.6.2.Gravatar Joey Hess2016-04-28
| | | | | | It started exporting a isSymbolicLink which supports windows. But, git-annex does no use symlinks on windows yet and this conflicts with the function by the same name from unix-compat, so hide it.
* fix build on windows with older ghcGravatar Joey Hess2016-04-08
|
* hard links on windowsGravatar Joey Hess2016-04-08
| | | | | * annex.thin and annex.hardlink are now supported on Windows. * unannex --fast now makes hard links on Windows.
* build without disk-free-space on androidGravatar Joey Hess2016-03-08
|
* merge from propellorGravatar Joey Hess2016-03-06
|
* fix build with old ghcGravatar Joey Hess2016-03-05
|
* another windows build fixGravatar Joey Hess2016-03-05
|
* more windows build fixesGravatar Joey Hess2016-03-05
|
* fix windows build moreGravatar Joey Hess2016-03-05
|
* Merge branch 'no-cbits'Gravatar Joey Hess2016-03-05
|\
* | fix windows buildGravatar Joey Hess2016-03-03
| |
* | fix windows buildGravatar Joey Hess2016-03-03
| |
* | Fix shared lock file FD leak.Gravatar Joey Hess2016-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes behavior in this situation: l1 <- lockShared Nothing "lck" l2 <- lockShared Nothing "lck" dropLock l1 dropLock l2 Before, the lock was dropped upon the second dropLock call, but the fd remained open, and would never be closed while the program was running. Fixed by a rather round-about method, but it should work well enough. It would have been simpler to open open the shared lock once, and not open it again in the second call to lockShared. But, that's difficult to do atomically. This also affects Windows and PID locks, not just posix locks. In the case of pid locks, multiple calls to waitLock within the same process are allowed because the side lock is locked using a posix lock, and so multiple exclusive locks can be taken in the same process. So, this change fixes a similar problem with pid locks. l1 <- waitLock (Seconds 1) "lck" l2 <- waitLock (Seconds 1) "lck" dropLock l1 dropLock l2 Here the l2 side lock fd remained open but not locked, although the pid lock file was removed. After this change, the second dropLock will close both fds to the side lock, and delete the pidlock.
* | commentGravatar Joey Hess2016-03-01
| |
* | Fix bug preventing moving files to/from a repository with annex.pidlock set.Gravatar Joey Hess2016-03-01
| |
* | comment typo fixGravatar Joey Hess2016-03-01
| |
* | remove support for network older than 2.4Gravatar Joey Hess2016-02-23
| | | | | | | | debian stable has 2.4
* | avoid warning on windows buildGravatar Joey Hess2016-02-15
| |
| * move old ghc compat code into separate module; eliminate WITH_CLIBSGravatar Joey Hess2016-02-15
| | | | | | | | | | This avoids hsc2hs being run except when building for the old version of ghc. Should speed up builds.
| * switch from homegrown code to disk-free-spaceGravatar Joey Hess2016-02-15
| | | | | | | | | | | | | | | | According to https://github.com/redneb/disk-free-space/issues/3 , disk-free-space should be at least as portable as my homegrown code was. One change I noticed is, getDiskSize was not implemented for windows in the old code, and should work now.
| * remove Utility.Mounts et al; moved to mountpoints packageGravatar Joey Hess2016-02-15
|/
* deprecatedGravatar Joey Hess2016-02-14
|
* remove unused Read instanceGravatar Joey Hess2016-02-14
|
* better typesGravatar Joey Hess2016-02-14
|
* if keys database cannot be opened due to permissions, ignoreGravatar Joey Hess2016-02-12
| | | | | | This lets readonly repos be used. If a repo is readonly, we can ignore the keys database, because nothing that we can do will change the state of the repo anyway.
* Zap redundant constraintsGravatar Gabor Greif2016-01-28
| | | | these are shown by GHC 7.11/8.0
* remove TDFA build flagGravatar Joey Hess2016-01-26
|
* Roll the dns build flag into the assistant build flag.Gravatar Joey Hess2016-01-26
|
* remove 3 build flagsGravatar Joey Hess2016-01-26
| | | | | | | | | | | | | * Removed the webapp-secure build flag, rolling it into the webapp build flag. * Removed the quvi and tahoe build flags, which only adds aeson to the core dependencies. * Removed the feed build flag, which only adds feed to the core dependencies. Build flags have cost in both code complexity and also make Setup configure have to work harder to find a usable set of build flags when some dependencies are missing.
* remove unused support for ADNS libraryGravatar Joey Hess2016-01-26
|
* matchexpression: New plumbing command to check if a preferred content ↵Gravatar Joey Hess2016-01-25
| | | | expression matches some data.
* Fix build with QuickCheck 2.8.2Gravatar Joey Hess2016-01-24
| | | | It added some instances I had also implemented.
* Revert "convert fail to error"Gravatar Joey Hess2016-01-24
| | | | | | | | | | This reverts commit 7f5fc3ec8f2d274c068e5662d04233bc0169c740. That changed the type of error from an IOError to something else, so broke stuff that was catching IOErrors. So back to a UserError, but be explicit this time that's what it's throwing.
* convert fail to errorGravatar Joey Hess2016-01-21
| | | | | | | | | Using fail here causes a "user error" exception to be thrown, which implies the user is at fault in its wording, which is incorrect. Also audited for other uses of fail in git-annex; the others are in monadic contexts where fail may not throw an exception, and involve user input, so kept them as-is.
* remove now unused toCygPathGravatar Joey Hess2016-01-13
|
* Merge remote-tracking branch 'pkitslaar/master'Gravatar Joey Hess2016-01-13
|\
* | When annex.http-headers is used to set the User-Agent header, avoid sending ↵Gravatar Joey Hess2016-01-11
| | | | | | | | User-Agent: git-annex
| * Added new toMSYS2Path function for use with rsync on Windows.Gravatar Pieter Kitslaar2016-01-11
|/
* clarify absPathFromGravatar Joey Hess2016-01-05
| | | | | | | | | | | | The repo path is typically relative, not absolute, so providing it to absPathFrom doesn't yield an absolute path. This is not a bug, just unclear documentation. Indeed, there seem to be no reason to simplifyPath here, which absPathFrom does, so instead just combine the repo path and the TopFilePath. Also, removed an export of the TopFilePath constructor; asTopFilePath is provided to construct one as-is.
* automatic conflict resolution for v6 unlocked filesGravatar Joey Hess2015-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several tricky parts: * When the conflict is just between the same key being locked and unlocked, the unlocked version wins, and the file is not renamed in this case. * Need to update associated file map when conflict resolution renames an unlocked file. * git merge runs the smudge filter on the conflicting file, and actually overwrites the file with the same content it had before, and so invalidates its inode cache. This makes it difficult to know when it's safe to remove such files as conflict cruft, without going so far as to compare their entire contents. Dealt with this by preventing the smudge filter from populating the file when a merge is run. However, that also prevents the smudge filter being run for non-conflicting files, so eg moving a file won't put its new content into place. * Ideally, if a merge or a merge conflict resolution renames an unlocked file, the file in the work tree can just be moved, rather than copying the content to a new worktree file. This is attempted to be done in merge conflict resolution, but due to git merge's behavior of running smudge filters, what actually seems to happen is the old worktree file with the content is deleted and rewritten as a pointer file, so doesn't get reused. So, this is probably not as efficient as it optimally could be. If that becomes a problem, could look into running the merge in a separate worktree and updating the real worktree more efficiently, similarly to the direct mode merge. However, the direct mode merge had a lot of bugs, and I'd rather not use that more error-prone method unless really needed.
* clean build warning on windowsGravatar Joey Hess2015-12-28
|
* optimise read and write for Keys database (untested)Gravatar Joey Hess2015-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writes are optimised by queueing up multiple writes when possible. The queue is flushed after the Annex monad action finishes. That makes it happen on program termination, and also whenever a nested Annex monad action finishes. Reads are optimised by checking once (per AnnexState) if the database exists. If the database doesn't exist yet, all reads return mempty. Reads also cause queued writes to be flushed, so reads will always be consistent with writes (as long as they're made inside the same Annex monad). A future optimisation path would be to determine when that's not necessary, which is probably most of the time, and avoid flushing unncessarily. Design notes for this commit: - separate reads from writes - reuse a handle which is left open until program exit or until the MVar goes out of scope (and autoclosed then) - writes are queued - queue is flushed periodically - immediate queue flush before any read - auto-flush queue when database handle is garbage collected - flush queue on exit from Annex monad (Note that this may happen repeatedly for a single database connection; or a connection may be reused for multiple Annex monad actions, possibly even concurrent ones.) - if database does not exist (or is empty) the handle is not opened by reads; reads instead return empty results - writes open the handle if it was not open previously
* Merge branch 'master' into smudgeGravatar Joey Hess2015-12-21
|\
| * fix build warnings under ghc 7.10Gravatar Joey Hess2015-12-19
| | | | | | | | | | | | Caused by AMP.. Since I've finally upgraded my dev laptop to 7.10, I may start missing imports that are not needed with it but are with older versions..
* | Merge branch 'master' into smudgeGravatar Joey Hess2015-12-16
|\|
| * bring back some deleted functions that git-repair usesGravatar Joey Hess2015-12-15
| |
| * improve temp dir securityGravatar Joey Hess2015-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://bugs.debian.org/807341 * Fix insecure temporary permissions when git-annex repair is used in in a corrupted git repository. Other calls to withTmpDir didn't leak any potentially private data, but repair clones the git repository to a temp directory which is made using the user's umask. Thus, it might expose a git repo that is otherwise locked down. * Fix potential denial of service attack when creating temp dirs. Since withTmpDir used easily predictable temporary directory names, an attacker could create foo.0, foo.1, etc and as long as it managed to keep ahead of it, could prevent it from ever returning. I'd rate this as a low utility DOS attack. Most attackers in a position to do this could just fill up the disk /tmp is on to prevent anything from writing temp files. And few parts of git-annex use withTmpDir anyway, so DOS potential is quite low. Examined all callers of withTmpDir and satisfied myself that switching to mkdtmp and so getting a mode 700 temp dir wouldn't break any of them. Note that withTmpDirIn continues to not force temp dir to 700. But it's only used for temp directories inside .git/annex/wherever/ so that is not a problem. Also re-audited all other uses of temp files and dirs in git-annex.
* | use InodeCache when dropping a key to see if a pointer file can be safely resetGravatar Joey Hess2015-12-09
|/ | | | | | | | | | | | | | | | The Keys database can hold multiple inode caches for a given key. One for the annex object, and one for each pointer file, which may not be hard linked to it. Inode caches for a key are recorded when its content is added to the annex, but only if it has known pointer files. This is to avoid the overhead of maintaining the database when not needed. When the smudge filter outputs a file's content, the inode cache is not updated, because git's smudge interface doesn't let us write the file. So, dropping will fall back to doing an expensive verification then. Ideally, git's interface would be improved, and then the inode cache could be updated then too.
* cleanupGravatar Joey Hess2015-12-06
|