summaryrefslogtreecommitdiff
path: root/Annex
Commit message (Collapse)AuthorAge
...
* fix failing git-annex unused test case in v6Gravatar Joey Hess2015-12-30
| | | | | | | | | | | | | WorkTree.lookupFile was finding a key for a file that's deleted from the work tree, which is different than the v5 behavior (though perhaps the same as the direct mode behavior). Fix by checking that the work tree file exists before catting its key. Hopefully this won't slow down much, probably the catKey is much more expensive. I can't see any way to optimise this, except perhaps to make Command.Unused check if work tree files exist before/after calling lookupFile. But, it seems better to make lookupFile really only find keys for worktree files; that's what it's intended to do.
* flush queue before cleaning cruftGravatar Joey Hess2015-12-29
| | | | | | | | | | | Else, queued file stages won't have reached the index, and it won't find everthing. This evidently fixes a reversion in my work today, although I don't see how I broke it. It didn't use to flush the queue first, before, and worked somehow. Test suite for v5 is back to 100% green now.
* test suite noticed a direct mode reversionGravatar Joey Hess2015-12-29
|
* renameGravatar Joey Hess2015-12-29
|
* don't disable smudge filter while mergingGravatar Joey Hess2015-12-29
| | | | | | | | | | | The smudge filter does need to be run, because if the key is in the local annex already (due to renaming, or a copy of a file added, or a new file added and its content has already arrived), git merge smudges the file and this should provide its content. This does probably mean that in merge conflict resolution, git smudges the existing file, re-copying all its content to it, and then the file is deleted. So, not efficient.
* avoid renaming file when auto-resolving conflict in annex pointerGravatar Joey Hess2015-12-29
| | | | | | | | | | This is a behavior change for merge conflicts between locked files that both pointed to the same key, in different ways. Before, the conflict was resolved, but the file was renamed to .variant. This was unnecessary, because there was only one variant. Of course, this also handles conflicts between unlocked and locked, or even two unlocked files with different pointer contents.
* fix inode cache consistency bug when a merge unlocks a present fileGravatar Joey Hess2015-12-29
| | | | | | | | Since the file was present and locked, its annex object was not in the inode cache. So, despite not needing to update the annex object when the clean filter is run on the content by git merge, it does need to record the inode cache of the annex object. Otherwise, the annex object will be assumed to be bad, since its inode is not cached.
* 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.
* fix windows buildGravatar Joey Hess2015-12-28
|
* annex.thinGravatar Joey Hess2015-12-27
| | | | | | | | | | | | | | Decided it's too scary to make v6 unlocked files have 1 copy by default, but that should be available to those who need it. This is consistent with git-annex not dropping unused content without --force, etc. * Added annex.thin setting, which makes unlocked files in v6 repositories be hard linked to their content, instead of a copy. This saves disk space but means any modification of an unlocked file will lose the local (and possibly only) copy of the old version. * Enable annex.thin by default on upgrade from direct mode to v6, since direct mode made the same tradeoff. * fix: Adjusts unlocked files as configured by annex.thin.
* get associated files from Keys databaseGravatar Joey Hess2015-12-26
|
* cleanupGravatar Joey Hess2015-12-26
|
* support v6 unlocked filesGravatar Joey Hess2015-12-26
| | | | | | This optimisation was not necessary, and didn't work for v6 unlocked files. Typically only a small number of files will be changed by a commit, so just catKey them all.
* make views work with v6 unlocked filesGravatar Joey Hess2015-12-26
| | | | | Have to only use the view index in one place; lookupFile was failing for unlocked files because it was run using the view index, which was empty.
* remove dead codeGravatar Joey Hess2015-12-26
|
* improve commentGravatar Joey Hess2015-12-26
|
* clean up cruft in assistant fast rename code pathGravatar Joey Hess2015-12-22
|
* move cleanOldKey into ingestGravatar Joey Hess2015-12-22
|
* populate unlocked files with newly available content when ingestingGravatar Joey Hess2015-12-22
| | | | | | This can happen when ingesting a new file in either locked or unlocked mode, when some unlocked files in the repo use the same key, and the content was not locally available before.
* finish v6 support for assistantGravatar Joey Hess2015-12-22
| | | | Seems to basically work now!
* make linkAnnex detect when the file changes as it's being copied/linked inGravatar Joey Hess2015-12-22
| | | | | | | | | This fixes a race where the modified file ended up in annex/objects, and the InodeCache stored in the database was for the modified version, so git-annex didn't know it had gotten modified. The race could occur when the smudge filter was running; now it gets the InodeCache before generating the Key, which avoids the race.
* refactoringGravatar Joey Hess2015-12-22
| | | | no behavior changes
* wip v6 support for assistantGravatar Joey Hess2015-12-21
| | | | Files are not yet added to v6 repos in unlocked mode.
* fix reversion in v5 git-annex add of unlocked fileGravatar Joey Hess2015-12-16
| | | | | | | | | In v5, lookupFile is supposed to only look at symlinks on disk (except when in direct mode). Note that v6 also has a bug when a locked file's symlink is deleted and is replaced with a new file. It sees that a link is staged and gets that key.
* temporarily remove cached keys database connectionGravatar Joey Hess2015-12-16
| | | | | | | | | | | | | | | | | | | | | | The problem is that shutdown is not always called, particularly in the test suite. So, a database connection would be opened, possibly some changes queued, and then not shut down. One way this can happen is when using Annex.eval or Annex.run with a new state. A better fix might be to make both of them call Keys.shutdown (and be sure to do it even if the annex action threw an error). Complication: Sometimes they're run reusing an existing state, so shutting down a database connection could cause problems for other users of that same state. I think this would need a MVar holding the database handle, so it could be emptied once shut down, and another user of the database connection could then start up a new one if it got shut down. But, what if 2 threads were concurrently using the same database handle and one shut it down while the other was writing to it? Urgh. Might have to go that route eventually to get the database access to run fast enough. For now, a quick fix to get the test suite happier, at the expense of speed.
* Use git-annex init --version=6 to get v6 for nowGravatar Joey Hess2015-12-15
| | | | | Not ready to make it default because of the direct mode upgrade needing to all happen at once.
* implemented upgrade of direct mode repo to v6Gravatar Joey Hess2015-12-15
|
* reorgGravatar Joey Hess2015-12-15
|
* update inode cache to cover file even when nothing needs to be done to linkAnnexGravatar Joey Hess2015-12-15
| | | | | | This covers the case where multiple files have the same content and are added with git add. Previously only the one that was linked to the annex got its inode cached; now both are.
* checked getKeysPresent; it's ok for v6 unlocked filesGravatar Joey Hess2015-12-11
| | | | | | When a v6 unlocked files is removed from the work tree, unused doesn't show it. When it gets removed from the index, unused does show it. This is the same as a locked file.
* finish v6 git-annex lockGravatar Joey Hess2015-12-11
| | | | This was a doozy!
* only make 1 hardlink max between pointer file and annex objectGravatar Joey Hess2015-12-11
| | | | | | | If multiple files point to the same annex object, the user may want to modify them independently, so don't use a hard link. Also, check diskreserve when copying.
* Merge branch 'master' into smudgeGravatar Joey Hess2015-12-11
|\
| * fsck: Failed to honor annex.diskreserve when checking a remote.Gravatar Joey Hess2015-12-11
| |
* | wipGravatar Joey Hess2015-12-11
| |
* | add generalized linkAnnex'Gravatar Joey Hess2015-12-10
| |
* | always format pointer file with a trailing newlineGravatar Joey Hess2015-12-10
| | | | | | | | | | | | | | Before the smudge filter added a trailing newline, but other things that wrote formatPointer to a file did not. also some new pointer staging code to use later
* | check InodeCache in inAnnex et alGravatar Joey Hess2015-12-10
| | | | | | | | | | | | This avoids querying the database when the content file doen't exist (or otherwise fails the provided check). However, it does add overhead of querying the database, and will certianly impact performance.
* | check inode cache in prepSendAnnexGravatar Joey Hess2015-12-10
| | | | | | | | | | This does mean one query of the database every time an object is sent. May impact performance.
* | moveGravatar Joey Hess2015-12-10
| |
* | make clear when code is using deprecated direct mode filesGravatar Joey Hess2015-12-09
| |
* | reorderGravatar Joey Hess2015-12-09
| |
* | 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.
* | add inode cache to the dbGravatar Joey Hess2015-12-09
| | | | | | | | | | | | | | | | | | Renamed the db to keys, since it is various info about a Keys. Dropping a key will update its pointer files, as long as their content can be verified to be unmodified. This falls back to checksum verification, but I want it to use an InodeCache of the key, for speed. But, I have not made anything populate that cache yet.
* | move InodeSentinal from direct mode code to its own moduleGravatar Joey Hess2015-12-09
| | | | | | | | | | Will be used outside of direct mode for v6 unlocked files, and is already used outside of direct mode when adding files to annex.
* | link/copy pointer files to object content when it's addedGravatar Joey Hess2015-12-09
| |
* | avoid pre-commit hook messing up new-style unlocked files in v6 repoGravatar Joey Hess2015-12-09
| |
* | refactor and improve pointer file handling codeGravatar Joey Hess2015-12-09
| |
* | require "annex/objects/" before key in pointer filesGravatar Joey Hess2015-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes ambiguity, because while someone might have "WORM--foo" in a file that's not intended to be a git-annex pointer file, "annex/objects/WORM--foo" is less likely. Also, ee0c34c8f2f94775b39ef10ed580cab47d2f929c had a caveat about symlink targets being parsed as pointer files, and now the same parser is used for both. I did not include any hash directories before the key in the pointer file, as they're not needed. However, if they were included, the parser would still work ok.
* | support pointer filesGravatar Joey Hess2015-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backend.lookupFile is changed to always fall back to catKey when operating on a file that's not a symlink. catKey is changed to understand pointer files, as well as annex symlinks. Before, catKey needed a file mode witness, to be sure it was looking at a symlink. That was complicated stuff. Now, it doesn't actually care if a file in git is a symlink or not; in either case asking git for the content of the file will get the pointer to the key. This does mean that git-annex will treat a link foo -> WORM--bar as a git-annex file, and also treats a regular file containing annex/objects/WORM--bar as a git-annex file. Calling catKey could make git-annex commands need to do more work than before. This would especially be the case if a repo contained many regular files, and only a few annexed files, as now git-annex will need to ask git about the contents of the regular files.