Commit graph

21044 commits

Author SHA1 Message Date
Joey Hess
9cb78e18ad Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-20 19:46:04 -04:00
Joey Hess
747bf6ce79 devblog 2014-08-20 19:45:41 -04:00
Joey Hess
59eae904b1 final scary locking refactoring (for now)
Note that while before checkTransfer this called getLock with WriteLock,
getLockStatus's use of ReadLock will also notice any exclusive locks.
Since transfer info files are only locked exclusively, never shared,
there is no behavior change.

Also, fixes checkLocked to actually return Just False when the file
exists, but is not locked.
2014-08-20 19:30:40 -04:00
Joey Hess
1994771215 more lock file refactoring
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.
2014-08-20 18:58:14 -04:00
Joey Hess
e386e26ef2 avoid trying to create a content file in order to lock it
The nice refactoring in ec7dd0446a
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.
2014-08-20 17:25:30 -04:00
Joey Hess
ec7dd0446a more lock file refactoring 2014-08-20 17:03:04 -04:00
Joey Hess
d279180266 reorganize and refactor lock code
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.
2014-08-20 16:45:58 -04:00
https://www.google.com/accounts/o8/id?id=AItOawkftzaCvV7EDKVDfJhsQZ3E1Vn-0db516w
f4b69fb749 Added a comment: GHC 7.8 Issue 2014-08-20 20:06:01 +00:00
Joey Hess
0a4d301051 fix lockFileShared to actually create lock file
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.
2014-08-20 15:49:49 -04:00
Joey Hess
bf3133ebb0 whoops, I the debug prints 2014-08-20 12:14:56 -04:00
Joey Hess
f92fd1b1e4 Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-20 12:11:05 -04:00
Joey Hess
96dc423e39 When accessing a local remote, shut down git-cat-file processes afterwards, 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.
2014-08-20 12:07:57 -04:00
Joey Hess
83dc82c232 forgot some lifts 2014-08-20 11:51:47 -04:00
Joey Hess
092041fab0 Ensure that all lock fds are close-on-exec, fixing various problems with 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.
2014-08-20 11:37:02 -04:00
http://joeyh.name/
12b2a89e91 Added a comment 2014-08-20 14:37:31 +00:00
Hans_Ryding
dfec2ffb22 2014-08-20 11:11:54 +00:00
Hans_Ryding
45b59e0ef4 2014-08-20 11:10:39 +00:00
Hans_Ryding
e5f09276bc 2014-08-20 11:09:27 +00:00
jg123h12jh3y12g3y
2bffae54ff Added a comment: Log with --debug 2014-08-20 05:49:02 +00:00
Ganwell
74aa8452b5 Added a comment: brew doesn't include git-remote-gcrypt 2014-08-19 21:54:16 +00:00
Joey Hess
dc5f1038de Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-19 12:58:44 -04:00
Joey Hess
37293dc28f Make --help work when not in a git repository. Closes: #758592
Note that this means getopt parsing is done even when not in a git
repository, even though currently cmdnorepo is not passed the results of
it. I'd like to move to cmdnorepo not doing its own ad-hoc option parsing,
so this is really a good thing. (But as long as eg, getOptionFlag needs an
Annex monad, it cannot be used in cmdnorepo handling.)

There is a potential for problems if any cmdnorepo branch of a command
handles options that are not in its regular getopt, but that would be a bug
anyway.
2014-08-19 12:55:15 -04:00
Joey Hess
4b3f03ef38 clarify that --all doesn't operate on a single file 2014-08-19 12:11:19 -04:00
https://www.google.com/accounts/o8/id?id=AItOawnPgn611P6ym5yyL0BS8rUzO0_ZKRldMt0
4531770729 Added a comment: git annex view */=podcast 2014-08-19 06:11:50 +00:00
Yaroslav Halchenko
2d2d0a4d75 doc/ minor typos/trailing whitespaces + extension on get options 2014-08-19 01:22:24 -04:00
https://www.google.com/accounts/o8/id?id=AItOawmP36qgLdH9-5VjmK2lTTs8S2rs2xSGCjk
898209661e 2014-08-19 00:40:22 +00:00
zardoz
f78da404e5 Added a comment 2014-08-18 20:54:11 +00:00
http://joeyh.name/
10bf03aa34 Added a comment 2014-08-18 18:39:33 +00:00
Joey Hess
71c22504d7 cleanup branch list 2014-08-17 17:12:49 -04:00
Joey Hess
8b15af309a add compat cruft for old versions of http-types and http-conduit 2014-08-17 15:39:46 -04:00
Joey Hess
5f749a0665 fix lower bounds on version of exceptions
This is needed only because of the new MonadMask needed for bracket
in the new version. Ifdefing it everywhere is not practical, since the
Setup.hs uses it.
2014-08-17 14:37:14 -04:00
Joey Hess
ca7831ce79 add news item for git-annex 5.20140817 2014-08-17 10:50:02 -04:00
Joey Hess
5ab991322f Merge remote-tracking branch 'refs/remotes/dgit/dgit/sid' 2014-08-17 10:45:49 -04:00
Joey Hess
f273882567 prep release 2014-08-17 10:31:21 -04:00
Joey Hess
5934a45f34 missing peice
Forgot to use runner in 852185c242
2014-08-16 15:19:37 -04:00
Joey Hess
153053d0cd Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-16 13:52:29 -04:00
Joey Hess
1f6d3ae62f fix path 2014-08-16 13:50:12 -04:00
EskildHustvedt
961babae90 Added a comment 2014-08-16 15:22:35 +00:00
zardoz
d8a50f49ed Added a comment 2014-08-16 13:58:28 +00:00
zardoz
c5267cb543 Added a comment 2014-08-16 11:42:22 +00:00
Joey Hess
be52dc1b9b Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-15 18:04:49 -04:00
Joey Hess
8f83844693 devblog 2014-08-15 18:04:04 -04:00
Joey Hess
6ab0737a75 work around default Accept-Encoding in http-client 2014-08-15 18:02:17 -04:00
Joey Hess
e0227dfedf memoize construction of the Request -> Request function to apply the UrlOptions 2014-08-15 17:47:21 -04:00
Joey Hess
dd619c7166 Switched from the old haskell HTTP library to http-conduit.
The hoary old HTTP library was only used when checking if an url exists,
when curl was not available. It had many problems, including not supporting
https at all.

Now, this is done using http-conduit for all urls that it supports. Falls
back to curl for any url that http-conduit doesn't like (probably ftp etc,
but could also be an url that its parser chokes on for whatever reason).

This adds a new dependency on http-conduit, but webdav support already
indirectly depended on that, and the s3-aws branch also uses it.

This opens up the possibility of using http-conduit for large file
downloads, but for now I've left it using wget/curl.

This commit was sponsored by Paul Tötterman.
2014-08-15 17:37:42 -04:00
Francois
29b219cc51 Added a comment 2014-08-15 20:51:12 +00:00
Francois
7801c53bcd Added a comment 2014-08-15 20:45:38 +00:00
Joey Hess
f93a631f51 silly markdown.. 2014-08-15 15:47:15 -04:00
http://joeyh.name/
ac36a76f93 Added a comment 2014-08-15 19:45:28 +00:00
Joey Hess
f6134c95a5 Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-15 15:27:12 -04:00