summaryrefslogtreecommitdiff
path: root/Utility
Commit message (Collapse)AuthorAge
* update message based on user feedbackGravatar Joey Hess2012-06-07
|
* refactorGravatar Joey Hess2012-06-06
|
* build watch on non-linux, just don't do anythingGravatar Joey Hess2012-06-06
|
* handle running out of watch descriptorsGravatar Joey Hess2012-06-06
|
* ignore .gitignore and .gitattributesGravatar Joey Hess2012-06-06
|
* factor out nukeFileGravatar Joey Hess2012-06-06
|
* refactorGravatar Joey Hess2012-06-04
|
* deletionGravatar Joey Hess2012-06-04
| | | | | | | | | | | | | | | | | | | | | When a new file is annexed, a deletion event occurs when it's moved away to be replaced by a symlink. Most of the time, there is no problimatic race, because the same thread runs the add event as the deletion event. So, once the symlink is in place, the deletion code won't run at all, due to existing checks that a deleted file is really gone. But there is a race at startup, as then the inotify thread is running at the same time as the main thread, which does the initial tree walking and annexing. It would be possible for the deletion inotify to run in a perfect race with the addition, and remove the newly added symlink from the git cache. To solve this race, added event serialization via a MVar. We putMVar before running each event, which blocks if an event is already running. And when an event finishes (or crashes!), we takeMVar to free the lock. Also, make rm -rf not spew warnings by passing --ignore-unmatch when deleting directories.
* refactorGravatar Joey Hess2012-06-04
|
* workaround other part of moved directory problemGravatar Joey Hess2012-06-04
| | | | | | | | | | | This fixes the scenario where: * directory foo is moved away (and still watched) * a new directory foo is made * file (or directory) foo/bar is created * the old directory's file (or directory) "bar" is deleted We don't want a deletion event for foo/bar in this case.
* add explict test that a closed file even is on a regular fileGravatar Joey Hess2012-06-04
| | | | | | | | | | | | | | | | | There are two reasons for this test. First, there could be a fifo or other non-regular file that was closed. Second, this test avoids ugliness when a subdirectory is moved out of the top of the watch directory to elsewhere, and a file added to it. Since the subdirectory has moved, the file won't be present under the old location, and nothing will be done. I cannot find a way to stop watching such directories, at least not without a lot of pain. The inotify interface in Haskell doesn't make it easy to stop watching a given subdirectory when it's moved out; it would require keeping a map of all watch handles that is shared between threads. This workaround avoids the problem in most cases; the only remaining case being deletion of a file from a moved subdirectory.
* add events for symlink creation and directory removalGravatar Joey Hess2012-06-04
| | | | | | | | | | Improved the inotify code, so it will also notice directory removal and symlink creation. In the watch code, optimised away a stat of a file that's being added, that's done by Command.Add.start. This is the reason symlink creation is handled separately from file creation, since during initial tree walk at startup, a stat was already done, and can be reused.
* add dirContentsRecursiveGravatar Joey Hess2012-05-31
|
* Clean up handling of git directory and git worktree.Gravatar Joey Hess2012-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Baked into the code was an assumption that a repository's git directory could be determined by adding ".git" to its work tree (or nothing for bare repos). That fails when core.worktree, or GIT_DIR and GIT_WORK_TREE are used to separate the two. This was attacked at the type level, by storing the gitdir and worktree separately, so Nothing for the worktree means a bare repo. A complication arose because we don't learn where a repository is bare until its configuration is read. So another Location type handles repositories that have not had their config read yet. I am not entirely happy with this being a Location type, rather than representing them entirely separate from the Git type. The new code is not worse than the old, but better types could enforce more safety. Added support for core.worktree. Overriding it with -c isn't supported because it's not really clear what to do if a git repo's config is read, is not bare, and is then overridden to bare. What is the right git directory in this case? I will worry about this if/when someone has a use case for overriding core.worktree with -c. (See Git.Config.updateLocation) Also removed and renamed some functions like gitDir and workTree that misused git's terminology. One minor regression is known: git annex add in a bare repository does not print a nice error message, but runs git ls-files in a way that fails earlier with a less nice error message. This is because before --work-tree was always passed to git commands, even in a bare repo, while now it's not.
* Pass -a to cp even when it supports --reflink=auto, to preserve permissions.Gravatar Joey Hess2012-05-15
| | | | | | Amoung other things, this makes unlocking a WORM backed file and then re-adding it without making any changes not add a new object, as the timestamp is preserved.
* updateGravatar Joey Hess2012-05-02
|
* rsync protocol?Gravatar Joey Hess2012-05-02
|
* percentage libraryGravatar Joey Hess2012-04-29
|
* Added shared cipher mode to encryptable special remotes.Gravatar Joey Hess2012-04-29
| | | | | | This option avoids gpg key distribution, at the expense of flexability, and with the requirement that all clones of the git repository be equally trusted.
* unbreak code inside ifdefGravatar Joey Hess2012-04-22
|
* bugfixesGravatar Joey Hess2012-04-22
|
* Add annex.httpheaders and annex.httpheader-command config settingsGravatar Joey Hess2012-04-22
| | | | | | Allow custom headers to be sent with all HTTP requests. (Requested by the Internet Archive)
* noopGravatar Joey Hess2012-04-21
|
* in which I discover voidGravatar Joey Hess2012-04-21
| | | | void :: Functor f => f a -> f () -- ah, of course that's useful :)
* honor core.sharedRepository when making all the other files in the annexGravatar Joey Hess2012-04-21
| | | | Lock files, directories, etc.
* better file mode setting codeGravatar Joey Hess2012-04-21
|
* Support git's core.sharedRepository configurationGravatar Joey Hess2012-04-21
| | | | | | This is incomplete, it does not honor it yet for hash directories and other annex bookkeeping files. Some of that is not needed for a bare repo; some of it may be.
* avoid chown call if the current file mode is same as newGravatar Joey Hess2012-04-21
| | | | | | | Not only an optimisation. fsck always tried to preventWrite to make sure file modes are good, and in a shared repo, that will fail on directories not owned by the current user. Although there may be other problems with such a setup.
* tweakGravatar Joey Hess2012-04-18
|
* clear errno after successful callGravatar Joey Hess2012-04-18
| | | | | | | | When preparing the debian stable backport, I am seeing a call to statvfs() succeed, but also set errno to 2 (ENOENT). Not sure why this happens; I am in a schroot when it does happen, or perhaps stable's libc is a little broken and sets errno incorrectly. Anyway, it should be perfectly fine to clear errno after the successful call, rather than before it.
* import jugglingGravatar Joey Hess2012-04-14
|
* Renamed diskfree.c to avoid OSX case insensativity bug.Gravatar Joey Hess2012-04-13
|
* allow add or del events to be ignoredGravatar Joey Hess2012-04-12
|
* allow excluding directories from being watchedGravatar Joey Hess2012-04-12
|
* don't fall over broken linksGravatar Joey Hess2012-04-12
|
* put in a warning so I remember to look at thisGravatar Joey Hess2012-04-12
|
* add waitForTerminationGravatar Joey Hess2012-04-11
|
* recursive inotify thingGravatar Joey Hess2012-04-11
| | | | | | | | | | | | | | | Recursive inotify has beaten me before, with its bad design and races, but not this time! (I think.) This is able to follow the strongest filesystem traffic I can throw at it, and robustly notices every file add and delete. Mostly that's down to Haskell having a quite nice threaded inotify library (that does its own buffering). A key insight was realizing that the inotify directory add race could be dealt with by scanning for files inside newly added directories. TODO: Add support for freebsd/osx kqueue; see http://hackage.haskell.org/package/kqueue Can a git-annex-monitor be far off?
* Disable diskfree on kfreebsd, as I have a build failure on kfreebsd-i386 ↵Gravatar Joey Hess2012-04-07
| | | | that is quite likely caused by it.
* use struct statfs64 on OSXGravatar Joey Hess2012-03-23
|
* tweakGravatar Joey Hess2012-03-22
|
* updateGravatar Joey Hess2012-03-22
|
* break out kfreebsdGravatar Joey Hess2012-03-22
| | | | Now tested on linux and freebsd (amd64).
* Rewrote free disk space checking codeGravatar Joey Hess2012-03-22
| | | | | Moving the portability handling into a small C library cleans up things a lot, avoiding the pain of unpacking structs from inside haskell code.
* fun with symbolsGravatar Joey Hess2012-03-17
| | | | | | Nothing at all on hackage is using <&&> or <||>. (Also, <&&> should short-circuit on failure.)
* optimize monadic ||Gravatar Joey Hess2012-03-16
| | | | | (||) used applicative style runs both conditions rather than short circuiting. Add an orM that properly short-circuits.
* simplifyGravatar Joey Hess2012-03-16
|
* nukes another 15 lines thanks to ifMGravatar Joey Hess2012-03-15
|
* added ifM and nuked 11 lines of codeGravatar Joey Hess2012-03-14
| | | | no behavior changes
* check hook executabilityGravatar Joey Hess2012-03-14
|