summaryrefslogtreecommitdiff
path: root/Annex
Commit message (Collapse)AuthorAge
* Fix transfer lock file FD leak that could occur when two separate git-annex ↵Gravatar Joey Hess2014-09-11
| | | | processes were both working to perform the same set of transfers.
* 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
* fix imports for windowsGravatar Joey Hess2014-08-23
|
* 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.
* fix lockFileShared to actually create lock fileGravatar Joey Hess2014-08-20
| | | | | | | This was a bug, but it was only used for ssh locks and by the hook special remote locking. At least in the case of ssh locks, the lock files happened to already exist before this tried to use them, so the bug didn't cause anything to break.
* whoops, I the debug printsGravatar Joey Hess2014-08-20
|
* When accessing a local remote, shut down git-cat-file processes afterwards, ↵Gravatar Joey Hess2014-08-20
| | | | | | | | | | | | | | | to ensure that remotes on removable media can be unmounted. Closes: #758630 This does mean that eg, copying multiple files to a local remote will become slightly slower, since it now restarts git-cat-file after each copy. Should not be significant slowdown. The reason git-cat-file is run on the remote at all is to update its location log. In order to add an item to it, it needs to get the current content of the log. Finding a way to avoid needing to do that would be a good path to avoiding this slowdown if it does become a problem somehow. This commit was sponsored by Evan Deaubl.
* forgot some liftsGravatar Joey Hess2014-08-20
|
* 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.
* memoize construction of the Request -> Request function to apply the UrlOptionsGravatar Joey Hess2014-08-15
|
* git-annex-shell sendkey: Don't fail if a remote asks for a key to be sent ↵Gravatar Joey Hess2014-08-15
| | | | that already has a transfer lock file indicating it's being sent to that remote. The remote may have moved between networks, or reconnected.
* direct: Avoid leaving file content in misctemp if interrupted.Gravatar Joey Hess2014-08-15
|
* direct: Fix ugly warning messages.Gravatar Joey Hess2014-08-12
| | | | | | | | | | | | | replaceFileOr was broken and ran the rollback action always. Luckily, for replaceFile, the rollback action was safe to run, since it just nuked a temp file that had already been moved into place. However, when `git annex direct` used replaeFileOr, its rollback printed a scary message: /home/joey/tmp/rrrr/.git/annex/misctmp/tmp32268: rename: does not exist (No such file or directory) There was actually no bad result though.
* 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.
* Merge branch 'newchunks'Gravatar Joey Hess2014-08-01
|\ | | | | | | I am happy enough with this to make it live!
* | Display exception message when a transfer fails due to an exception.Gravatar Joey Hess2014-07-30
| | | | | | | | | | | | For example, I had a copy to a remote that was failing for an unknown reason. This let me see the exception was createDirectory: permission denied; the underlying problem being a permissions issue.
* | add missing Ord constraint (fixes android build)Gravatar Joey Hess2014-07-30
| | | | | | | | | | Probably the new ghc used on android is the root cause of needing this constraint.
| * 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.
| * add some more exception handling primitivesGravatar Joey Hess2014-07-26
|/
* implement chunk logsGravatar Joey Hess2014-07-24
| | | | | | | Slightly tricky as they are not normal UUIDBased logs, but are instead maps from (uuid, chunksize) to chunkcount. This commit was sponsored by Frank Thomas.
* fix windows buildGravatar Joey Hess2014-07-14
|
* resolvemerge: finish up by committingGravatar Joey Hess2014-07-11
|
* Deal with change in git 2.0 that made indirect mode merge conflict ↵Gravatar Joey Hess2014-07-11
| | | | | | | | | | resolution leave behind old files. I think this is a git behavior change, but have not checked to be sure. Conflict cruft used to look like $foo~HEAD, but now just $foo is left behind as conflict cruft. With test case.
* resolvemerge: New plumbing command that runs the automatic merge conflict ↵Gravatar Joey Hess2014-07-11
| | | | resolver.
* direct: Fix handling of case where a work tree subdirectory cannot be ↵Gravatar Joey Hess2014-07-10
| | | | | | | | | written to due to permissions. Running `git annex direct` would cause loss of data, because the object was moved to a temp file, which it then tried to replace the work tree file with, and on failure, the temp file got deleted. Now it's instead moved back into the annex object location.
* refactor lockingGravatar Joey Hess2014-07-10
|
* refactorGravatar Joey Hess2014-07-10
|
* Fix minor FD leak in journal code.Gravatar Joey Hess2014-07-09
| | | | | | | | | | | | | | | | | | | | | | | | Minor because normally only 1 FD is leaked per git-annex run. However, the test suite leaks a few hundred FDs, and this broke it on the Debian autobuilders, which seem to have a tigher than usual ulimit. The leak was introduced by the lazy getDirectoryContents' that was introduced in b54de1dad4874b7561d2c5a345954b6b5c594078 in order to scale to millions of journal files -- if the lazy list was never fully consumed, the directory handle did not get closed. Instead, pull in openDirectory/readDirectory/closeDirectory code that I already developed and submitted in a patch to the haskell directory library earlier. Using this in journalDirty avoids the place that the lazy list caused a problem. And using it in stageJournal eliminates the need for getDirectoryContents'. The getJournalFiles* functions are switched back to using the regular strict getDirectoryContents. I'm not sure if those always consume the whole list, so this avoids any leak. And the things that call those are things like git annex unused, which also look at every file committed to the git-annex branch, so would need more work to scale to insane numbers of files anyway.
* fix build warning5.20140709Gravatar Joey Hess2014-07-09
|
* fix windows buildGravatar Joey Hess2014-07-09
|
* prospective fix for bad_merge_commit_deleting_all_filesGravatar Joey Hess2014-07-09
| | | | | Assuming my analysis of a race is correct. In any case, this certianly closes a race..
* Fix bug in automatic merge conflict resolutionGravatar Joey Hess2014-07-08
| | | | | | | | | | | | | | | | When one side is an annexed symlink, and the other side is a non-annexed symlink. In this case, git-merge does not replace the annexed symlink in the work tree with the non-annexed symlink, which is different from it's handling of conflicts between annexed symlinks and regular files or directories. So, while git-annex generated the correct merge commit, the work tree didn't get updated to reflect it. See comments on bug for additional analysis. Did not add this to the test suite yet; just unloaded a truckload of firewood and am feeling lazy. This commit was sponsored by Adam Spiers.
* assistant: Fix bug, introduced in last release, that caused the assistant to ↵Gravatar Joey Hess2014-07-05
| | | | make many unncessary empty merge commits.
* work around getDirectoryContents not streaming lazilyGravatar Joey Hess2014-07-04
|
* Fix memory leak when committing millions of changes to the git-annex branchGravatar Joey Hess2014-07-04
| | | | | | | | | Eg after git-annex add has run on 2 million files in one go. Slightly unhappy with the neeed to use a temp file here, but I cannot see any other alternative (see comments on the bug report). This commit was sponsored by Hamish Coleman.
* support commit.gpgsignGravatar Joey Hess2014-07-04
| | | | | | | | | | | | | | | | | | | | | Support users who have set commit.gpgsign, by disabling gpg signatures for git-annex branch commits and commits made by the assistant. The thinking here is that a user sets commit.gpgsign intending the commits that they manually initiate to be gpg signed. But not commits made in the background, whether by a deamon or implicitly to the git-annex branch. gpg signing those would be at best a waste of CPU and at worst would fail, or flood the user with gpg passphrase prompts, or put their signature on changes they did not directly do. See Debian bug #753720. Also makes all commits done by git-annex go through a few central control points, to make such changes easier in future. Also disables commit.gpgsign in the test suite. This commit was sponsored by Antoine Boegli.
* really add non-date metadata tooGravatar Joey Hess2014-07-03
|
* 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!
* refactorGravatar Joey Hess2014-06-16
|
* work around a bug in gitGravatar Joey Hess2014-06-12
| | | | | | | | | | | http://marc.info/?l=git&m=140262402204212&w=2 This git bug manifested on FAT and Windows as the test suite failing in 3 places. All involved merge conflict resolution. It turned out that the associated file mappings were getting messed up, and that happened because this git bug lost track of what files were supposed to be symlinks. This commit was sponsored by Eric Kidd.
* 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.
* export CreateProcess fields from Utility.ProcessGravatar Joey Hess2014-06-10
| | | | update code to avoid cwd and env redefinition warnings
* simplifyGravatar Joey Hess2014-06-09
|