aboutsummaryrefslogtreecommitdiff
path: root/Command/FromKey.hs
Commit message (Collapse)AuthorAge
* showStart variant for when there's no worktree fileGravatar Joey Hess2017-11-28
| | | | | | | | | | | | Clean up some uses of showStart with "" for the file, or in some cases, a non-filename description string. That would generate bad json, although none of the commands doing that supported --json. Using "" for the file resulted in output like "foo rest"; now the extra space is eliminated. This commit was sponsored by Fernando Jimenez on Patreon.
* Make all --batch input, as well as fromkey and registerurl stdin be ↵Gravatar Joey Hess2016-12-13
| | | | processed without requiring it to be in the current encoding.
* didn't mean to commit this change yetGravatar Joey Hess2016-12-08
|
* commentGravatar Joey Hess2016-12-08
|
* minor styleGravatar Joey Hess2016-12-05
|
* git-annex fromkey now takes multiple pairs of keys and filenamesGravatar Daniel Brooks2016-12-05
| | | | It also still reads from stdin when none are specified.
* Avoid backtraces on expected failures when built with ghc 8; only use ↵Gravatar Joey Hess2016-11-15
| | | | | | | | | | | | | backtraces for unexpected errors. ghc 8 added backtraces on uncaught errors. This is great, but git-annex was using error in many places for a error message targeted at the user, in some known problem case. A backtrace only confuses such a message, so omit it. Notably, commands like git annex drop that failed due to eg, numcopies, used to use error, so had a backtrace. This commit was sponsored by Ethan Aubin.
* remove 163 lines of code without changing anything except importsGravatar Joey Hess2016-01-20
|
* convert all commands to work with optparse-applicativeGravatar Joey Hess2015-07-08
| | | | Still no options though.
* started converting to use optparse-applicativeGravatar Joey Hess2015-07-08
| | | | | | | | | | | | This is a work in progress. It compiles and is able to do basic command dispatch, including git autocorrection, while using optparse-applicative for the core commandline parsing. * Many commands are temporarily disabled before conversion. * Options are not wired in yet. * cmdnorepo actions don't work yet. Also, removed the [Command] list, which was only used in one place.
* fromkey, registerurl: Improve handling of urls that happen to also be ↵Gravatar Joey Hess2015-05-30
| | | | parsable as strange keys.
* fromkey, registerurl: Allow urls to be specified instead of keys, and ↵Gravatar Joey Hess2015-05-22
| | | | | | | | generate URL keys. This is especially useful because the caller doesn't need to generate valid url keys, which involves some escaping of characters, and may involve taking a md5sum of the url if it's too long.
* fromkey, registerurl: When reading from stdin, allow the filename and url, ↵Gravatar Joey Hess2015-04-07
| | | | respectively, to contain whitespace.
* registerurl: New plumbing command for mass-adding urls to keys.Gravatar Joey Hess2015-03-15
|
* fromkey: Add stdin mode.Gravatar Joey Hess2015-03-15
|
* fromkey --force: Skip test that the key has its content in the annex.Gravatar Joey Hess2015-03-15
|
* Repository tuning parameters can now be passed when initializing a ↵Gravatar Joey Hess2015-01-27
| | | | | | | | | | repository for the first time. * init: Repository tuning parameters can now be passed when initializing a repository for the first time. For details, see http://git-annex.branchable.com/tuning/ * merge: Refuse to merge changes from a git-annex branch of a repo that has been tuned in incompatable ways.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* revert parentDir changeGravatar Joey Hess2015-01-09
| | | | | | | | Reverts 2bba5bc22d049272d3328bfa6c452d3e2e50e86c Unfortunately, this caused breakage on Windows, and possibly elsewhere, because parentDir and takeDirectory do not behave the same when there is a trailing directory separator.
* made parentDir return a Maybe FilePath; removed most uses of itGravatar Joey Hess2015-01-06
| | | | | | | | parentDir is less safe than takeDirectory, especially when working with relative FilePaths. It's really only useful in loops that want to terminate at / This commit was sponsored by Audric SCHILTKNECHT.
* doh't use "def" for command definitions, it conflicts with Data.Default.defGravatar Joey Hess2014-10-14
|
* Windows: Avoid using unix-compat's rename, which refuses to rename directories.Gravatar Joey Hess2014-01-29
| | | | Opened a bug about this: https://github.com/jystic/unix-compat/issues/10
* fix inversion of control in CommandSeek (no behavior changes)Gravatar Joey Hess2014-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've been disliking how the command seek actions were written for some time, with their inversion of control and ugly workarounds. The last straw to fix it was sync --content, which didn't fit the Annex [CommandStart] interface well at all. I have not yet made it take advantage of the changed interface though. The crucial change, and probably why I didn't do it this way from the beginning, is to make each CommandStart action be run with exceptions caught, and if it fails, increment a failure counter in annex state. So I finally remove the very first code I wrote for git-annex, which was before I had exception handling in the Annex monad, and so ran outside that monad, passing state explicitly as it ran each CommandStart action. This was a real slog from 1 to 5 am. Test suite passes. Memory usage is lower than before, sometimes by a couple of megabytes, and remains constant, even when running in a large repo, and even when repeatedly failing and incrementing the error counter. So no accidental laziness space leaks. Wall clock speed is identical, even in large repos. This commit was sponsored by an anonymous bitcoiner.
* fix permission damage (thanks, Windows)Gravatar Joey Hess2013-05-11
|
* git-annex now builds on Windows (doesn't work)Gravatar Joey Hess2013-05-11
|
* Use lower case hash directories for storing files on crippled filesystems, ↵Gravatar Joey Hess2013-04-04
| | | | | | | | | | | | | | | same as is already done for bare repositories. * since this is a crippled filesystem anyway, git-annex doesn't use symlinks on it * so there's no reason to use the mixed case hash directories that we're stuck using to avoid breaking everyone's symlinks to the content * so we can do what is already done for all bare repos, and make non-bare repos on crippled filesystems use the all-lower case hash directories * which are, happily, all 3 letters long, so they cannot conflict with mixed case hash directories * so I was able to 100% fix this and even resuming `git annex add` in the test case will recover and it will all just work.
* add section metadata to all commandsGravatar Joey Hess2013-03-24
| | | | Not yet used .. mindless train work.
* 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.
* add routes to pause/start/cancel transfersGravatar Joey Hess2012-08-08
| | | | | | | | | | | | | | | | This commit includes a paydown on technical debt incurred two years ago, when I didn't know that it was bad to make custom Read and Show instances for types. As the routes need Read and Show for Transfer, which includes a Key, and deriving my own Read instance of key was not practical, I had to finally clean that up. So the compact Key read and show functions are now file2key and key2file, and Read and Show are now derived instances. Changed all code that used the old instances, compiler checked. (There were a few places, particularly in Command.Unused, and the test suite where the Show instance continue to be used for legitimate comparisons; ie show key_x == show key_y (though really in a bloom filter))
* extend Git.Queue to be able to queue more than simple git commandsGravatar Joey Hess2012-06-07
| | | | | | While I was in there, I noticed and fixed a bug in the queue size calculations. It was never encountered only because Queue.add was only ever run with 1 file in the list.
* lintGravatar Joey Hess2011-11-11
|
* The fromkey command now takes the key as its first parameter. The --key ↵Gravatar Joey Hess2011-10-31
| | | | option is no longer used.
* refactoring and cleanupGravatar Joey Hess2011-10-30
| | | | No code changes.
* clean up check selection codeGravatar Joey Hess2011-10-29
| | | | | | | | | This new approach allows filtering out checks from the default set that are not appropriate for a command, rather than having to list every check that is appropriate. It also reduces some boilerplate. Haskell does not define Eq for functions, so I had to go a long way around with each check having a unique id. Meh.
* Fail if --from or --to is passed to commands that do not support them.Gravatar Joey Hess2011-10-27
|
* refactored and generalized pre-command sanity checkingGravatar Joey Hess2011-10-27
|
* renameGravatar Joey Hess2011-10-05
|
* renameGravatar Joey Hess2011-10-04
|
* factor out common importsGravatar Joey Hess2011-10-03
| | | | no code changes
* remove command type definitionsGravatar Joey Hess2011-09-15
| | | | | | | These were a mistake, they make the type signatures harder to read and less flexible. The CommandSeek, CommandStart, CommandPerform, and CommandCleanup types were a good idea, but composing them with the parameters expected is going too far.
* split groups of related functions out of UtilityGravatar Joey Hess2011-08-22
|
* unannex: Clean up use of git commit -a.Gravatar Joey Hess2011-07-14
| | | | | | | | This was more complex than would be expected. unannex has to use git commit -a since it's removing files from git; git commit filelist won't do. Allow commands to be added to the Git queue that have no associated files, and run such commands once.
* remove unused backend machineryGravatar Joey Hess2011-07-05
| | | | | | | | | | | | | The only remaining vestiage of backends is different types of keys. These are still called "backends", mostly to avoid needing to change user interface and configuration. But everything to do with storing keys in different backends was gone; instead different types of remotes are used. In the refactoring, lots of code was moved out of odd corners like Backend.File, to closer to where it's used, like Command.Drop and Command.Fsck. Quite a lot of dead code was removed. Several data structures became simpler, which may result in better runtime efficiency. There should be no user-visible changes.
* rename modules for data types into Types/ directoryGravatar Joey Hess2011-06-01
|
* refactor some boilerplateGravatar Joey Hess2011-05-15
|
* Periodically flush git command queue, to avoid boating memory usage too much.Gravatar Joey Hess2011-04-07
| | | | | | | Since the queue is flushed in between subcommand actions being run, there should be no issues with actions that expect to queue up some stuff and have it run after they do other stuff. So I didn't have to audit for such assumptions.
* avoid version check before running version and upgrade commandsGravatar Joey Hess2011-03-19
| | | | | There are two types of commands; those that access the repository and those that don't. Sorted.
* first pass at using new keysGravatar Joey Hess2011-03-15
| | | | | | | It compiles. It sorta works. Several subcommands are FIXME marked and broken, because things that used to accept separate --backend and --key params need to be changed to accept just a --key that encodes all the key info, now that there is metadata in keys.
* fix up commands that are trouble on bare reposGravatar Joey Hess2011-03-03
| | | | | Most will just abort. init does a basic init and gives a command to run elsewhere to finish it.