aboutsummaryrefslogtreecommitdiff
path: root/Utility/InodeCache.hs
Commit message (Collapse)AuthorAge
* Fix build with QuickCheck 2.10.Gravatar Joey Hess2017-06-17
| | | | | | | | QuickCheck added an Arbitrary instance for CTime aka EpochTime. However, while git-annex's instance disallowed times before the epoch, QuickCheck's does not. So, rather than using its instance, convert from an Integer. This commit was sponsored by Thomas Hochstein on Patreon.
* 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.
* 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.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* on second thought, InodeCache should use getFileSizeGravatar Joey Hess2015-01-20
| | | | | | | | This is necessary for interop between inode caches created on unix and windows. Which is more important than supporting inodecaches for large keys with the wrong size, which are broken anyway. There should be no slowdown from this change, except on Windows.
* 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.
* fixed all remaining build warnings on WindowsGravatar Joey Hess2014-12-29
|
* 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.
* fix build on windows with unix-compat-0.4.1.3Gravatar Joey Hess2014-08-11
| | | | | | | FileID type changed, needs Arbitrary instance. On the plus side, getFileStatus on Windows now actually gets file id's, not always 0, so direct mode is safer there now.
* finish fixing windows timezone madnessGravatar Joey Hess2014-06-12
| | | | | | | | | | | | | | | | | | | | | Rather than calculating the TSDelta once, and caching it, this now reads the inode sential file's InodeCache file once, and then each time a new InodeCache is generated, looks at the sentinal file to get the current delta. This way, if the time zone changes while git-annex is running, it will adapt. This adds some inneffiency, but only on Windows, and only 1 stat per new file added. The worst innefficiency is that `git annex status` and `git annex sync` will now (on Windows) stat the inode sentinal file once per file in the repo. It would be more efficient to use getCurrentTimeZone, rather than needing to stat the sentinal file. This should be easy to do, once the time package gets my bugfix patch. This commit was sponsored by Jürgen Lüters.
* fix for Windows file timestamp timezone madnessGravatar Joey Hess2014-06-12
| | | | | | | | | | | | | | | | | | | | | | On Windows, changing the time zone causes the apparent mtime of files to change. This confuses git-annex, which natually thinks this means the files have actually been modified (since THAT'S WHAT A MTIME IS FOR, BILL <sheesh>). Work around this stupidity, by using the inode sentinal file to detect if the timezone has changed, and calculate a TSDelta, which will be applied when generating InodeCaches. This should add no overhead at all on unix. Indeed, I sped up a few things slightly in the refactoring. Seems to basically work! But it has a big known problem: If the timezone changes while the assistant (or a long-running command) runs, it won't notice, since it only checks the inode cache once, and so will use the old delta for all new inode caches it generates for new files it's added. Which will result in them seeming changed the next time it runs. This commit was sponsored by Vincent Demeester.
* minimal exportsGravatar Joey Hess2014-06-11
|
* deal with FAT on Linux timestamp issueGravatar Joey Hess2014-06-11
| | | | | | | | | Deal with FAT's low resolution timestamps, which in combination with Linux's caching of higher res timestamps while a FAT is mounted, caused direct mode repositories on FAT to seem to have modified files after they were unmounted and remounted. This commit was sponsored by Fabrice Rossi.
* relicense general utility library code to BSDGravatar Joey Hess2014-05-10
| | | | | Omitted a couple of files what have had significant contributions from others.
* add, import, assistant: Better preserve the mtime of symlinks, when when ↵Gravatar Joey Hess2013-09-25
| | | | | | | adding content that gets deduplicated. Note that this turned out to remove a syscall, not add any expense. Otherwise, I would not have done it.
* fix permission damage (thanks, Windows)Gravatar Joey Hess2013-05-11
|
* clean up from windows portingGravatar Joey Hess2013-05-11
|
* git-annex now builds on Windows (doesn't work)Gravatar Joey Hess2013-05-11
|
* detect renames during commit, and .. um, do nothing special because it's ↵Gravatar Joey Hess2013-03-11
| | | | | | lunch time But I'm well set up to fast-track direct mode adds for renames now.
* remove Eq instance for InodeCacheGravatar Joey Hess2013-03-11
| | | | | | | | | There are two types of equality here, and which one is right varies, so this forces me to consider and choose between them. Based on this, I learned that the commit in git anex sync was always doing a strong comparison, even when in a repository where the inodes had changed. Fixed that.
* improve importsGravatar Joey Hess2013-02-27
|
* move Arbitrary instances out of Test and into modules that define the typesGravatar Joey Hess2013-02-27
| | | | This is possible now that we build-depend on QuickCheck.
* Direct mode: Support filesystems like FAT which can change their inodes each ↵Gravatar Joey Hess2013-02-19
| | | | time they are mounted.
* split out Utility.InodeCacheGravatar Joey Hess2013-02-14