Commit graph

8697 commits

Author SHA1 Message Date
Joey Hess
357cfa5071 Merge branch 'master' of ssh://git-annex.branchable.com 2013-02-17 16:59:37 -04:00
Joey Hess
151ea3c68a blog for the day 2013-02-17 16:59:09 -04:00
Joey Hess
d7c93b8913 fully support core.symlinks=false in all relevant symlink handling code
Refactored annex link code into nice clean new library.

Audited and dealt with calls to createSymbolicLink.
Remaining calls are all safe, because:

Annex/Link.hs:  ( liftIO $ createSymbolicLink linktarget file
  only when core.symlinks=true
Assistant/WebApp/Configurators/Local.hs:                createSymbolicLink link link
  test if symlinks can be made
Command/Fix.hs: liftIO $ createSymbolicLink link file
  command only works in indirect mode
Command/FromKey.hs:     liftIO $ createSymbolicLink link file
  command only works in indirect mode
Command/Indirect.hs:                    liftIO $ createSymbolicLink l f
  refuses to run if core.symlinks=false
Init.hs:                createSymbolicLink f f2
  test if symlinks can be made
Remote/Directory.hs:    go [file] = catchBoolIO $ createSymbolicLink file f >> return True
  fast key linking; catches failure to make symlink and falls back to copy
Remote/Git.hs:          liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True
  ditto
Upgrade/V1.hs:                          liftIO $ createSymbolicLink link f
  v1 repos could not be on a filesystem w/o symlinks

Audited and dealt with calls to readSymbolicLink.
Remaining calls are all safe, because:

Annex/Link.hs:		( liftIO $ catchMaybeIO $ readSymbolicLink file
  only when core.symlinks=true
Assistant/Threads/Watcher.hs:		ifM ((==) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file))
  code that fixes real symlinks when inotify sees them
  It's ok to not fix psdueo-symlinks.
Assistant/Threads/Watcher.hs:		mlink <- liftIO (catchMaybeIO $ readSymbolicLink file)
  ditto
Command/Fix.hs:	stopUnless ((/=) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file)) $ do
  command only works in indirect mode
Upgrade/V1.hs:	getsymlink = takeFileName <$> readSymbolicLink file
  v1 repos could not be on a filesystem w/o symlinks

Audited and dealt with calls to isSymbolicLink.
(Typically used with getSymbolicLinkStatus, but that is just used because
getFileStatus is not as robust; it also works on pseudolinks.)
Remaining calls are all safe, because:

Assistant/Threads/SanityChecker.hs:                             | isSymbolicLink s -> addsymlink file ms
  only handles staging of symlinks that were somehow not staged
  (might need to be updated to support pseudolinks, but this is
  only a belt-and-suspenders check anyway, and I've never seen the code run)
Command/Add.hs:         if isSymbolicLink s || not (isRegularFile s)
  avoids adding symlinks to the annex, so not relevant
Command/Indirect.hs:                            | isSymbolicLink s -> void $ flip whenAnnexed f $
  only allowed on systems that support symlinks
Command/Indirect.hs:            whenM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f) $ do
  ditto
Seek.hs:notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f
  used to find unlocked files, only relevant in indirect mode
Utility/FSEvents.hs:                    | Files.isSymbolicLink s = runhook addSymlinkHook $ Just s
Utility/FSEvents.hs:                                            | Files.isSymbolicLink s ->
Utility/INotify.hs:                             | Files.isSymbolicLink s ->
Utility/INotify.hs:                     checkfiletype Files.isSymbolicLink addSymlinkHook f
Utility/Kqueue.hs:              | Files.isSymbolicLink s = callhook addSymlinkHook (Just s) change
  all above are lower-level, not relevant

Audited and dealt with calls to isSymLink.
Remaining calls are all safe, because:

Annex/Direct.hs:			| isSymLink (getmode item) =
  This is looking at git diff-tree objects, not files on disk
Command/Unused.hs:		| isSymLink (LsTree.mode l) = do
  This is looking at git ls-tree, not file on disk
Utility/FileMode.hs:isSymLink :: FileMode -> Bool
Utility/FileMode.hs:isSymLink = checkMode symbolicLinkMode
  low-level

Done!!
2013-02-17 16:43:14 -04:00
128.32.34.64
da596b9303 poll vote (An Ubuntu PPA would be supercool! Thanks for your great work!!) 2013-02-17 01:58:17 +00:00
http://edheil.wordpress.com/
6f08b2067c 2013-02-17 01:49:12 +00:00
annexuser
2dc663bcbb 2013-02-16 23:31:34 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmCmNS-oUgYfNg85-LPuxzTZJUp0sIgprM
e20aaa8a35 Added a comment: more homebrew 2013-02-16 19:46:47 +00:00
Joey Hess
0984f3581e build fixes 2013-02-16 13:10:47 -04:00
Joey Hess
2091ab275e add news item for git-annex 3.20130216 2013-02-16 11:37:37 -04:00
Joey Hess
ca53d609cc document release 2013-02-16 11:36:31 -04:00
Joey Hess
8c90875455 phony standalone 2013-02-16 10:45:13 -04:00
Joey Hess
d488905af1 deal with Glob/filemanip conflict 2013-02-16 10:31:59 -04:00
Joey Hess
63ce1a4f71 prep release 2013-02-16 10:26:49 -04:00
79.224.245.36
a8a85dab2b poll vote (My phone (or MP3 player)) 2013-02-16 11:03:30 +00:00
Joey Hess
3fbfc6a9e0 update 2013-02-15 18:22:23 -04:00
Joey Hess
3a21c1ed7a blog for the looooong day 2013-02-15 18:19:27 -04:00
Joey Hess
e699a35380 switch to direct mode when auto-enabling
Gets the direct mode mapping set up correctly. Maybe other stuff, but
probably not, since this is probably a new repo.
2013-02-15 18:16:50 -04:00
Joey Hess
397082013a proper fix for dropunused
Now getKeysPresent checks that the key's content, not only its directory,
exists. In direct mode, the inode cache file is used as a standin for the
content.

removeAnnex always removes the inode cache file, and drop and move --from
always call removeAnnex, even if the object does not seem to be inAnnex,
to ensure it's always deleted.
2013-02-15 17:58:49 -04:00
Joey Hess
55069f0fab update for reversion 2013-02-15 16:39:11 -04:00
Joey Hess
5a8fb26d0a Revert "Clean up direct mode cache and mapping info when dropping keys."
This reverts commit 57780cb3a4.

This was buggy, it caused the direct mode cache to be lost when dropping
keys, so when the file is gotten back, it's stored in indirect mode.

Note to self: Do not attempt bug fixes at 6 am!
2013-02-15 16:37:57 -04:00
Joey Hess
80fa144d79 fixed test suite build after recent changes broke it 2013-02-15 16:06:22 -04:00
Joey Hess
5ea4b91fb4 start to support core.symlinks=false
Utility functions to handle no symlink mode, and converted Annex.Content to
use them; still many other places to convert.
2013-02-15 16:03:11 -04:00
Joey Hess
2cd696a124 update 2013-02-15 14:36:49 -04:00
Joey Hess
2e49a7e729 don't allow setting indirect mode on a crippled filesystem 2013-02-15 14:17:31 -04:00
Joey Hess
4da932a48f improve 2013-02-15 13:53:28 -04:00
Joey Hess
5e6a60c17d migrate, rekey: copy rather than hard linking in crippled filesystem mode 2013-02-15 13:51:50 -04:00
Joey Hess
96613e85a9 build fix 2013-02-15 13:48:25 -04:00
Joey Hess
9e69fca5bb optimise sending to encrypted rsync
With an encrypted rsync remote, the encrpyted file can be renamed, rather
than being copied, in crippled filesystem mode. This gets back to just as
fast as non-crippled mode for this very common case.
2013-02-15 13:42:41 -04:00
Joey Hess
92b4a63a06 rsync special remote support for crippled filesystem mode
Cannot make a hard link, have to copy.

I did find a way to make it work without setting up a tree, just using
--include and --exclude. But it needs the same hash directories to be used
on both sides, which is normally not the case. Still, I hope one day I will
convert non-bare repos to use the same hash dirs as everything else, and
then this will get more efficient.
2013-02-15 13:33:36 -04:00
Joey Hess
b3b5b7631d Merge branch 'master' of ssh://git-annex.branchable.com 2013-02-15 13:09:19 -04:00
Joey Hess
630f4531a7 fix assistant's use of lsof in crippled filesystem mode 2013-02-15 13:08:22 -04:00
Joey Hess
a988b90826 avoid warning 2013-02-15 13:05:39 -04:00
Joey Hess
a3a567da13 little xargs eqivilant as a pure function 2013-02-15 13:05:19 -04:00
http://nullroute.eu.org/~grawity/
4b98996fd7 Added a comment 2013-02-15 00:38:01 +00:00
Joey Hess
0583b4686a fixed 2013-02-14 19:06:18 -04:00
Joey Hess
071d07ca29 fixed 2013-02-14 19:06:08 -04:00
Joey Hess
0d0034b9d7 add standalone target 2013-02-14 18:51:30 -04:00
Joey Hess
ae53f0a4b5 Merge branch 'master' of ssh://git-annex.branchable.com 2013-02-14 17:13:58 -04:00
Joey Hess
9be67c28f0 blog for the day 2013-02-14 17:13:45 -04:00
Joey Hess
7ce30b534f add: Improved detection of files that are modified while being added.
In indirect mode, now checks the inode cache to detect changes to a file.
Note that a file can still be changed if a process has it open for write,
after landing in the annex.

In direct mode, some checking of the inode cache was done before, but
from a much later point, so fewer modifications could be detected. Now it's
as good as indirect mode.

On crippled filesystems, no lock down is done before starting to add a
file, so checking the inode cache is the only protection we have.
2013-02-14 16:54:36 -04:00
Joey Hess
a52f8f382b split out Utility.InodeCache 2013-02-14 16:17:40 -04:00
Joey Hess
47477b2807 crippled filesystem support, probing and initial support
git annex init probes for crippled filesystems, and sets direct mode, as
well as `annex.crippledfilesystem`.

Avoid manipulating permissions of files on crippled filesystems.
That would likely cause an exception to be thrown.

Very basic support in Command.Add for cripped filesystems; avoids the lock
down entirely since doing it needs both permissions and hard links.
Will make this better soon.
2013-02-14 14:15:26 -04:00
Joey Hess
35b7b1a406 remove unused item
This moved to annexDirect in GitConfig.
2013-02-14 13:22:56 -04:00
117.197.11.130
e267637cd6 poll vote (Google Drive) 2013-02-14 13:18:52 +00:00
108.254.104.238
77bd3a0ee3 poll vote (I need a Windows port) 2013-02-14 05:16:14 +00:00
http://a-or-b.myopenid.com/
253a198d0e Added a comment 2013-02-13 22:16:17 +00:00
Joey Hess
6e0f8c343b couple more android build fixes 2013-02-13 17:56:10 -04:00
Joey Hess
f342a0519b fix make -C 2013-02-13 16:44:46 -04:00
Joey Hess
86c296fddd Merge branch 'master' of ssh://git-annex.branchable.com 2013-02-13 16:38:53 -04:00
Joey Hess
6ca2b8ea30 blog for the day 2013-02-13 16:38:19 -04:00