Commit graph

21064 commits

Author SHA1 Message Date
Joey Hess
23592716c9 Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-23 16:17:31 -07:00
https://launchpad.net/~pauli-virtanen
bd7fd9c3d9 2014-08-23 23:12:39 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmBmv0HhwTFxkpxlf8ifTlMOHnIwHCHTYs
79ccc7e347 Added a comment: path on windows 2014-08-23 22:02:07 +00:00
https://www.google.com/accounts/o8/id?id=AItOawk7iPiqWr3BVPLWEDvJhSSvcOqheLEbLNo
99771b3404 Added a comment 2014-08-23 18:13:06 +00:00
Joey Hess
53b302d755 Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-23 08:52:30 -07:00
https://www.google.com/accounts/o8/id?id=AItOawk7iPiqWr3BVPLWEDvJhSSvcOqheLEbLNo
51acb30238 2014-08-23 13:59:59 +00:00
warroyo
b768cd1262 2014-08-22 22:15:27 +00:00
zardoz
6bc2419f02 Added a comment 2014-08-22 18:57:37 +00:00
zardoz
d5bce8a3b8 Added a comment 2014-08-22 14:00:42 +00:00
zardoz
3a0d342bfd Added a comment 2014-08-22 13:15:06 +00:00
zardoz
646e36d1d1 Added a comment 2014-08-22 13:07:34 +00:00
zardoz
4f189d0134 Added a comment 2014-08-22 10:15:52 +00:00
zardoz
8002704a3f Added a comment 2014-08-22 09:58:05 +00:00
zardoz
356c782ace Added a comment 2014-08-22 09:38:03 +00:00
zardoz
ef121f0d48 Added a comment 2014-08-22 09:27:34 +00:00
zardoz
71f80ad226 2014-08-22 09:08:23 +00:00
zardoz
0ffd1a8148 2014-08-21 09:33:02 +00:00
Hans_Ryding
7e0cacd273 Added a comment: Change the name of the bug 2014-08-21 09:14:16 +00:00
Hans_Ryding
1b86daa5de Added a comment: Quite right 2014-08-21 08:54:51 +00:00
Joey Hess
aebcc395ff use types to enforce that removeAnnex can only be called inside lockContent
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.
2014-08-20 20:13:47 -04:00
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