summaryrefslogtreecommitdiff
path: root/Command
Commit message (Collapse)AuthorAge
* git subcommand cleanupGravatar Joey Hess2013-03-03
| | | | | | Pass subcommand as a regular param, which allows passing git parameters like -c before it. This was already done in the pipeing set of functions, but not the command running set.
* break dependency cycle by special casing running of test commandGravatar Joey Hess2013-02-27
|
* embed test suite into git annex; available by running: git annex testGravatar Joey Hess2013-02-27
| | | | | | | | | | | | | | I have seen some other programs do this, and think it's pretty cool. Means you can test wherever it's deployed, as well as at build time. My other reason for doing it is less happy. Cabal's handling of test suites sucks, requiring duplicated info, and even when that's done, it fails to preprocess hsc files here. Building it in avoids that and avoids having to explicitly tell cabal to enable test suites, which would then make it link the test executable every time, which is unnecessarily slow. This also has the benefit that now "make fast test" does a max speed build and tests it.
* Makefile now builds using cabal, taking advantage of cabal's automatic ↵Gravatar Joey Hess2013-02-27
| | | | | | | | | detection of appropriate build flags. The only thing lost is ./ghci Speed: make fast used to take 20 seconds here, when rebuilding from touching Command/Unused.hs. With cabal, it's 29 seconds.
* annex.version is now set to 4 for direct mode repositoriesGravatar Joey Hess2013-02-26
| | | | | | | To avoid old versions of git-annex getting confused. There is no upgrade required though. We switch back to 3 when going from direct to indirect.
* copy: Update location log when no copy was performed, if the location log ↵Gravatar Joey Hess2013-02-26
| | | | was out of date.
* make adding modified files work on crippled filesystemsGravatar Joey Hess2013-02-20
|
* Direct mode: Fix support for adding a modified file.Gravatar Joey Hess2013-02-20
| | | | | | | | | | | Adding a file that is already annexed, but has been modified, was broken in direct mode. This fix makes the new content be added. It does have the problem that re-running `git annex add` will checksum and re-add the content repeatedly, until it's committed. This happens because the key associated with the file does not change until the new one gets committed, so it keeps thinking the file has changed.
* fully support core.symlinks=false in all relevant symlink handling codeGravatar Joey Hess2013-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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!!
* proper fix for dropunusedGravatar Joey Hess2013-02-15
| | | | | | | | | | 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.
* Revert "Clean up direct mode cache and mapping info when dropping keys."Gravatar Joey Hess2013-02-15
| | | | | | | | | This reverts commit f797939d15a2b414e62b28ccb0bd9e5b77978d76. 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!
* don't allow setting indirect mode on a crippled filesystemGravatar Joey Hess2013-02-15
|
* migrate, rekey: copy rather than hard linking in crippled filesystem modeGravatar Joey Hess2013-02-15
|
* add: Improved detection of files that are modified while being added.Gravatar Joey Hess2013-02-14
| | | | | | | | | | | | | 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.
* split out Utility.InodeCacheGravatar Joey Hess2013-02-14
|
* crippled filesystem support, probing and initial supportGravatar Joey Hess2013-02-14
| | | | | | | | | | | | 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.
* can now build Android targeted binaryGravatar Joey Hess2013-02-10
| | | | | | | | | | | | | | | | Various things that don't work on Android are just ifdefed out. * the webapp (needs template haskell for arm) * --include and --exclude globbing (needs libpcre, which is not ported; probably I'll make it use the pure haskell glob library instead) * annex.diskreserve checking (missing sys/statvfs.h) * timestamp preservation support (yawn) * S3 * WebDAV * XMPP The resulting 17mb binary has been tested on Android, and it is able to, at least, print its usage message.
* Clean up direct mode cache and mapping info when dropping keys.Gravatar Joey Hess2013-02-07
| | | | | | | | | | | | | | These files were left behind, and made getKeysPresent find keys that were not present. It would be expensive to make getKeysPresent check that the actual key files are present (it just lists the directories). But that's not needed if we just clean up the stale cache and mapping files. To handle systems that were in direct mode and got switched back with stale direct mode files, made cleanObjectLoc remove all files in the key's directory. git annex unused will still list keys that are gone but for which the stale direct mode files exists. To deal with that, made dropunused remove the key's directory even if the key does not seem to be present.
* uninit, unannex --fast: If hard link creation fails, fall back to slow mode.Gravatar Joey Hess2013-02-06
|
* pre-commit: Update direct mode mappings.Gravatar Joey Hess2013-02-06
| | | | | | | | | | | | | | | | Making the pre-commit hook look at git diff-index to find changed direct mode files and update the mappings works pretty well. One case where it does not work is when a file is git annex added, and then git rmed, and then this is committed. That's a no-op commit, so the hook probably doesn't even run, and it certianly never notices that the file was deleted, so the mapping will still have the original filename in it. For this and other reasons, it's important that the mappings still be treated as possibly inconsistent. Also, the assistant now allows the pre-commit hook to run when in direct mode, so the mappings also get updated there.
* avoid queueing rm of no filesGravatar Joey Hess2013-02-05
|
* assistant: Fix location log when adding new file in direct mode.Gravatar Joey Hess2013-02-05
|
* webapp: Now allows restarting any threads that crash.Gravatar Joey Hess2013-01-26
|
* use async to track and manage threadsGravatar Joey Hess2013-01-26
|
* fsck: Detect and fix consistency errors in direct mode mapping files.Gravatar Joey Hess2013-01-19
|
* sync: Automatic merge conflict resolution now stages deleted files.Gravatar Joey Hess2013-01-17
|
* avoid running pre-commit hook in direct modeGravatar Joey Hess2013-01-17
| | | | | The code that handles committing unlocked files in indirect mode did something unexpected and data lossy.
* drop: fix misleading messageGravatar Joey Hess2013-01-16
|
* webapp: Now always logs to .git/annex/daemon.logGravatar Joey Hess2013-01-15
| | | | | | | | It used to not log to daemon.log when a repository was first created, and when starting the webapp. Now both do. Redirecting stdout and stderr to the log is tricky when starting the webapp, because the web browser may want to communicate with the user. (Either a console web browser, or web.browser = echo) This is handled by restoring the original fds when running the browser.
* assistant: Avoid committer crashing if a file is deleted at the wrong instant.Gravatar Joey Hess2013-01-14
|
* safe recv-key in direct modeGravatar Joey Hess2013-01-11
| | | | | Checks the key's size and checksum. This is sorta expensive, but it avoids needing to add another round-trip to the protocol.
* drop: Suggest using git annex move when numcopies prevents dropping a file.Gravatar Joey Hess2013-01-09
|
* Special remotes now all rollback storage of keys that get modified during ↵Gravatar Joey Hess2013-01-09
| | | | the transfer, which can happen in direct mode.
* improve direct mode fsckGravatar Joey Hess2013-01-08
| | | | | | | | | | | | An earlier commit (mislabeled) made direct mode fsck check file checksums. While it's expected for files to change at any time in direct mode, and so fsck cannot complain every time there's a checksum mismatch, it is possible for it to detect when a file does not *seem* to have changed, then check its checksum, and so detect disk corruption or other problems. This commit improves that, by checking a second time, if the checksum fails, that the file is still not modified, before taking action. This way, a direct mode file can be modified while being fscked.
* blog for yesterdayGravatar Joey Hess2013-01-08
|
* fix a stupid typo that made fsck loop when it found bad contentGravatar Joey Hess2013-01-07
| | | | Thank goodness for test suites!
* addurl in direct modeGravatar Joey Hess2013-01-06
|
* add works in direct modeGravatar Joey Hess2013-01-06
| | | | | Also, changed sync to no longer automatically add files in direct mode. That was only necessary before because add didn't work.
* optimize pre-commit in direct modeGravatar Joey Hess2013-01-06
|
* support fsck in direct modeGravatar Joey Hess2013-01-06
|
* More commands work in direct mode repositories: find, whereis, move, copy, ↵Gravatar Joey Hess2013-01-05
| | | | | | | | drop, log. These started working, for free, once lookupFile supported direct mode. yay!!
* guard readSymbolicLinkGravatar Joey Hess2013-01-05
| | | | throws an exception if the file is not a symlink
* avoid pre-commit in direct modeGravatar Joey Hess2013-01-05
| | | | | It was a no-op until my recent change that made lookupFile work in direct mode.
* squelch warningGravatar Joey Hess2013-01-05
|
* committer: Fix a file handle leak.Gravatar Joey Hess2013-01-05
|
* type based git config handling for remotesGravatar Joey Hess2013-01-01
| | | | | Still a couple of places that use git config ad-hoc, but this is most of it done.
* type based git config handlingGravatar Joey Hess2012-12-29
| | | | | | | | | | | Now there's a Config type, that's extracted from the git config at startup. Note that laziness means that individual config values are only looked up and parsed on demand, and so we get implicit memoization for all of them. So this is not only prettier and more type safe, it optimises several places that didn't have explicit memoization before. As well as getting rid of the ugly explicit memoization code. Not yet done for annex.<remote>.* configuration settings.
* ensure that direct mode file is not modified while generating its keyGravatar Joey Hess2012-12-29
|
* convert notBareRepo to a CommandCheckGravatar Joey Hess2012-12-29
| | | | | | This avoids some small overhead by only running the check once per command; it also ensures that, even if the command doesn't find anything to run on, it still fails to run when in a bare repo.
* block all commands that don't work in direct modeGravatar Joey Hess2012-12-29
| | | | | I left status working in direct mode, although it doesn't show correct stats for known annex keys.