Commit graph

68 commits

Author SHA1 Message Date
Joey Hess
34c8af74ba fix inversion of control in CommandSeek (no behavior changes)
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.
2014-01-20 04:57:36 -04:00
Joey Hess
fa3045aa8b make "git annex help options" work outside a git repo
Option parsing for commands that run outside git repos is still screwy,
as there is no Annex monad and so the flags cannot be passed in. But,
any remaining parameters can be, which is enough for this fix.
2013-11-30 15:18:40 -04:00
Joey Hess
9c20185f55 webapp: Check annex.version. 2013-11-17 14:58:35 -04:00
Joey Hess
2233ddd5a2 assistant: When autostarted, wait 5 seconds before running the startup scan, to avoid contending with the user's desktop login process. 2013-10-26 12:42:58 -04:00
Joey Hess
b405295aee hlint
test suite still passes
2013-09-25 03:09:06 -04:00
Joey Hess
c46b263fde Android: Make the "Open webapp" menu item open the just created repository when a new repo is made. 2013-06-10 23:55:53 -04:00
Joey Hess
91c9ae83f1 squash warning 2013-06-02 14:06:17 -04:00
Joey Hess
a48d340abd Android: Work around Android devices where the am command doesn't work. 2013-05-31 21:30:21 -04:00
Joey Hess
cba2942cda Revert "android dupped stderr workaround"
This reverts commit 4cc803c733.

The stderr fd is also trashed after `am` fails to open the web browser.
2013-05-30 16:27:10 -04:00
Joey Hess
4cc803c733 android dupped stderr workaround
Avoid using dupped stderr, since
http://git-annex.branchable.com/bugs/warning_-_WebApp_crashed:___60__file_descriptor_15__62__:_hPutStr:_illegal_operation___40__handle_is_closed__41___on_Android/#comment-a24c73803fb10bd35afdc10d50e071c8
seems to involve that handle not being dupped originally, or perhaps
getting closed when the web browser is started on Android.

Using the dupped stdout is known to work before starting the web browser,
so it should work after -- unless perhaps starting it closes both handles.

In any case, there's no real need to write to stderr here.
2013-05-30 13:55:22 -04:00
Joey Hess
3e2d50a336 Android: Added an "Open WebApp" item to the terminal's menu. Should work for Android devices that cannot auto-open the webapp on start. 2013-05-28 18:25:27 -04:00
Joey Hess
1e2ddcb68a use setCurrentDirectory
On POSIX, this just calls changeWorkingDirectory.
2013-05-11 19:14:30 -04:00
Joey Hess
18bdff3fae clean up from windows porting 2013-05-11 18:23:41 -04:00
Joey Hess
886897f627 fix build 2013-05-02 20:38:57 -04:00
Joey Hess
29df1a6bec fix build 2013-05-02 19:10:30 -04:00
Joey Hess
6dca92defe need cpp 2013-05-02 19:00:50 -04:00
Joey Hess
1e9b8e1467 cannot open file:// url on Android, so don't use the htmlshim there 2013-05-02 16:46:47 -04:00
Bruno Bigras
0fe8eb0953 Fix the URL not showing until the app closes 2013-05-01 15:48:16 +00:00
Joey Hess
2c42e70f6c rename module 2013-04-23 11:38:52 -04:00
Joey Hess
9cb223a8b3 Detect systems that have no user name set in GECOS, and also don't have user.name set in git config, and put in a workaround so that commits to the git-annex branch (and the assistant) will still succeed despite git not liking the system configuration. 2013-04-22 15:36:34 -04:00
Joey Hess
911506bc93 untested browser opening on Android
I've found multiple references to using the `am` command from the adb shell
to open a browser. So I assume it also works in a terminal emulator.
2013-04-18 12:52:55 -04:00
Joey Hess
5e2e4347a3 webapp: New --listen= option allows running the webapp on one computer and connecting to it from another.
Does not yet use HTTPS. I'd need to generate a certificate, and I'm not
sure what's the best way to do that.
2013-04-08 15:04:35 -04:00
Joey Hess
021c564319 clean up urlrenderer handling when the webapp is not built 2013-04-03 17:48:54 -04:00
Joey Hess
cfd3b16fe1 add section metadata to all commands
Not yet used .. mindless train work.
2013-03-24 18:28:21 -04:00
Joey Hess
08bdea7e52 webapp: New preferences page allows enabling/disabling debug logging at runtime, as well as configuring numcopies and diskreserve. 2013-03-03 17:07:27 -04:00
Joey Hess
76ddf9b6d3 webapp: Now allows restarting any threads that crash. 2013-01-26 17:09:33 +11:00
Joey Hess
1713ed95f7 use async to track and manage threads 2013-01-26 14:14:32 +11:00
Joey Hess
d7ca6fb856 webapp: Now always logs to .git/annex/daemon.log
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.
2013-01-15 13:34:59 -04:00
Joey Hess
e872c3f648 convert notBareRepo to a CommandCheck
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.
2012-12-29 14:45:19 -04:00
Joey Hess
0d50a6105b whitespace fixes 2012-12-13 00:45:27 -04:00
Joey Hess
2525fefbb9 The standalone builds now unset their special path and library path variables before running the system web browser.
Should fix a crash reported on OSX.
2012-11-27 17:05:29 -04:00
Joey Hess
ebd576ebcb where indentation 2012-11-12 01:05:04 -04:00
Joey Hess
8f08aa3f45 better handling of lifting from XMPP -> Assistant 2012-11-05 19:39:08 -04:00
Joey Hess
68118b8986 split remaining assistant types 2012-10-30 14:34:48 -04:00
Joey Hess
f78ca9bc58 split out daemonstatus types 2012-10-30 14:11:14 -04:00
Joey Hess
4e765327ca Assistant monad, stage 1
This adds the Assistant monad, and an AssistantData structure.
So far, none of the assistant's threads run in the monad yet.
2012-10-29 00:15:43 -04:00
Joey Hess
4ac2fd0a22 ensure that git-annex branch is pushed after a successful transfer
I now have this topology working:

   assistant ---> {bare repo, special remote} <--- assistant

And, I think, also this one:

        +----------- bare repo --------+
        v                              v
  assistant ---> special remote <--- assistant

While before with assistant <---> assistant connections, both sides got
location info updated after a transfer, in this topology, the bare repo
*might* get its location info updated, but the other assistant has no way to
know that it did. And a special remote doesn't record location info,
so transfers to it won't propigate out location log changes at all.

So, for these to work, after a transfer succeeds, the git-annex branch
needs to be pushed. This is done by recording a synthetic commit has
occurred, which lets the pusher handle pushing out the change (which will
include actually committing any still journalled changes to the git-annex
branch).

Of course, this means rather a lot more syncing action than happened
before. At least the pusher bundles together very close together pushes,
somewhat. Currently it just waits 2 seconds between each push.
2012-10-28 16:05:34 -04:00
Joey Hess
c71836269b (re)start XMPP when it's configured in the webapp 2012-10-27 00:50:14 -04:00
Joey Hess
51ef707a59 nub the autostart file
It's possible for the file to get duplicate lines in it, and if so, we want
to ignore the dups.
2012-10-14 15:19:34 -04:00
Joey Hess
80b3952930 webapp: display message about starting web browser
One reason to do this is that on OSX, it doesn't jump to the web browser
when opening a new page. Linux seems ahead in usability here... :P
2012-10-11 15:19:48 -04:00
Joey Hess
bbf2c31aa7 better message 2012-10-11 12:14:23 -04:00
Joey Hess
c0aec874a2 webapp: avoid infinite loop on start
If the autostart file lists a repository, for which a directory exists,
but there's not actually a valid git repo in there, the web app used to
try to use it, and see it wasn't valid, and then try to autostart again.

The ensuing runaway loop also ate memory, although not as fast as I was led
to belive was happening to someone on IRC yesterday. So that guy may have
had a different problem. But this seems otherwise a reasonable fit for the
circumstances described, if git-annex was started before something that
occurred during desktop login that made the repository available.
2012-10-11 12:08:11 -04:00
Joey Hess
3da78cc241 make the standalone OSX app automatically install itself when run 2012-09-26 16:50:04 -04:00
Joey Hess
582316f66f avoid webapp crash on startup when there's no ~/.gitconfig
git config --list --global exits nonzero when there's no global config
2012-09-23 12:43:14 -04:00
Joey Hess
ba0334116c more descriptive name for oneshot 2012-09-15 20:46:38 -04:00
Joey Hess
df337bb63b hlint 2012-09-13 00:57:52 -04:00
Joey Hess
e59b0a1c88 first pass at alert buttons
They work fine. But I had to go to a lot of trouble to get Yesod to render
routes in a pure function. It may instead make more sense to have each
alert have an assocated IO action, and a single route that runs the IO
action of a given alert id. I just wish I'd realized that before the past
several hours of struggling with something Yesod really doesn't want to
allow.
2012-09-08 19:57:15 -04:00
Joey Hess
a00f1d26bc display errors when any named thread crashes 2012-09-06 14:56:04 -04:00
Joey Hess
b6b8f6da9c implement resuming of paused transfers
Currently waits for a new transfer slot to open up, which probably needs to
change..
2012-08-12 12:11:20 -04:00
Joey Hess
fb4b19deed make the webapp honor the web.browser git config 2012-08-08 13:15:35 -04:00