Commit graph

1276 commits

Author SHA1 Message Date
Joey Hess
04d07f2c1f --unused: New switch that makes git-annex operate on all data found by the last run of git annex unused. Supported by fsck, get, move, copy. 2013-07-03 15:26:59 -04:00
Joey Hess
c0a5b669ea no migrate --all for now
migrate wants to know the associated filename, in order to look up
the new backend. Can't do that with --all

migrate --all --backend=newvalue could be useful to support, in the future.
2013-07-03 14:07:09 -04:00
Joey Hess
ebfd6fc2fe drop --all cannot check numcopies from .gitattributes, so don't implement it!
I spent a long time worrying about this problem with --all, that it cannot
check .gitattributes files for numcopies settings, and so would not be
entirely safe to use. The solution turns out to be simple, just don't
implement `git annex drop --all`. drop is the only command that needs to
check numcopies (move can also reduce the number of copies, but explicitly
bypasses numcopies settings).

Use cases that might need a drop --all are probably better served by using
unused and dropunused, which already work in a bare repository.
2013-07-03 14:01:31 -04:00
Joey Hess
def7cb706f Add --all option, and support it for fsck 2013-07-03 13:12:53 -04:00
Joey Hess
1b395dcb76 webapp: Fix ssh setup with nonstandard port, broken in last release. 2013-07-02 15:46:02 -04:00
Joey Hess
0292e82eb1 releasing version 4.20130627 2013-06-27 14:58:40 -04:00
Joey Hess
b44c978e2c webapp: Fix bug that caused the webapp to hang when built with yesod 1.2. 2013-06-27 00:01:31 -04:00
Joey Hess
b717823402 Temporarily revert back to building with yesod before 1.2. Version 1.2 of yesod, or the new version of warp seem to have a bug that causes the webapp to hang. 2013-06-26 17:52:39 -04:00
Joey Hess
579446aed4 assistant: Fix bug that prevented adding files written by gnucash, and more generally support adding hard links to files. However, other operations on hard links are still unsupported. 2013-06-26 12:30:37 -04:00
Joey Hess
f1fe8edbbb webapp: Fix bug setting up ssh repo if the user enters "~/" at the start of the path. 2013-06-25 15:43:46 -04:00
Joey Hess
c8e6947693 webapp: Ensure that ssh keys generated for different directories on a server are always different. 2013-06-25 15:31:04 -04:00
Joey Hess
10072157cb webapp: Fix bug when setting up a remote ssh repo repeatedly on the same server.
The ssh setup first runs ssh to the real hostname, to probe if a ssh key is
needed. If one is, it generates a mangled hostname that uses a key. This
mangled hostname was being used to ssh into the server to set up the key.
But if the server already had the key set up, and it was locked down, the
setup would fail. This changes it to use the real hostname when sshing in
to set up the key, which avoids the problem.

Note that it will redundantly set up the key on the ssh server. But it's
the same key; the ssh key generation code uses the key if it already
exists.
2013-06-25 14:46:20 -04:00
Joey Hess
a35bdcb3f2 fsck: Ensures that direct mode is used for files when it's enabled.
A common failure mode for direct mode has been for files to end up still
stored in indirect mode. While I hope that doesn't happen anymore, fsck
should deal with it.
2013-06-24 16:26:00 -04:00
Joey Hess
1f7f9ede3a bup: Handle /~/ in bup remote paths. Thanks, Oliver Matthews 2013-06-23 12:39:37 -04:00
Joey Hess
5e48aa4d4b assistant: Daily sanity check thread is run niced. 2013-06-21 13:29:42 -04:00
Joey Hess
d901ba1781 assistant --autostart: Automatically ionices the daemons it starts. 2013-06-21 13:23:20 -04:00
Joey Hess
62ef805a54 releasing version 4.20130621 2013-06-21 12:12:43 -04:00
Joey Hess
e95e9e2020 Enable assistant and WebDAV support on powerpc and sparc architectures, which now have the necessary dependencies built. 2013-06-21 01:50:00 -04:00
Joey Hess
6e309b63f8 assistant: On Linux, the expensive transfer scan is run niced.
This is a compromise. I would like to nice every thread except for the
webapp thread, but it's not practical to do so. That would need every
thread to run as a bound thread, which could add significant overhead.
And any forkIO would escape the nice level.
2013-06-20 22:25:41 -04:00
Joey Hess
8b3427c52e Windows: The test suite now passes on Windows (a few broken parts are disabled).
Better to have a working test suite that doesn't test a few things
than no working test suite.

Most of the disabled stuff is because for some reason "git annex sync"
doesn't work when run inside the test suite. Looks like PATH problems.

The directory and rsync special remotes seem broken on Windows, or
maybe the tests are. Pretty sure the hook special remote test is broken.
2013-06-18 16:16:25 -04:00
Joey Hess
4e2fab90d5 avoid newline translation when writing to git hash-object
They're like mushrooms, just keep popping up.
2013-06-18 15:08:51 -04:00
Joey Hess
1312cffad0 Revert "Windows: Ssh connection caching is now supported."
Yeah, that didn't actually work. Got error messages like it couldn't read
from the control socket, so probably ssh doesn't really support that on
Windows, at least the cygwin ssh build I'm using.
2013-06-17 22:13:28 -04:00
Joey Hess
07a17f58b7 Windows: Ssh connection caching is now supported.
Turns out the socket stuff just works on windows.
2013-06-17 22:05:49 -04:00
Joey Hess
9ef09587dc fsck: Avoid getting confused by Windows path separators 2013-06-17 21:18:43 -04:00
Joey Hess
fa1c1e0f65 annex.debug can now be set to enable debug logging by default. The webapp's debugging check box does this. 2013-06-17 20:41:27 -04:00
Joey Hess
9200e9a5f9 update standards-version 2013-06-17 13:59:17 -04:00
Joey Hess
2844e7175e status: No longer shows dead repositories.
This is because people continually whine about it.  Seemingly not aware
that data generally cannot be deleted from git anyway.
2013-06-17 12:35:33 -04:00
Joey Hess
0527c74c0f assistant: In direct mode, objects are now only dropped when all associated files are unwanted. This avoids a repreated drop/get loop of a file that has a copy in an archive directory, and a copy not in an archive directory. (Indirect mode still has some buggy behavior in this area, since it does not keep track of associated files.) Closes: #712060 2013-06-15 14:44:43 -04:00
Joey Hess
0e05613083 Windows: Fix hang when adding several files at once. 2013-06-14 17:35:45 -04:00
Joey Hess
923d6c81bc Android: Fix use of cp command to not try to use features present only on build system. 2013-06-14 11:54:44 -04:00
Joey Hess
9666addfaa sync: Better support for bare git remotes. Now pushes directly to the master branch on such a remote, instead of to synced/master. This makes it easier to clone from a bare git remote that has been populated with git annex sync or by the assistant. 2013-06-12 14:54:23 -04:00
Joey Hess
6dcf21db93 Direct mode: No longer temporarily remove write permission bit of files when adding them.
This write permission frobbing is very appropriate in indirect mode,
since annexed objects are stored as immutably as can be managed. But not
in direct mode, where files should be able to be modified at any time.

There are already sufficient guards that there's no need to prevent a file
being written to while it's being ingested, in direct mode. The inode cache
will detect (most) types of modifications, and the add will fail. Then a
re-add should be done. The assistant should get another inotify change
event, and automatically add the new version of the file.
2013-06-12 14:02:31 -04:00
Joey Hess
8be3e9baa2 Merge branch 'glacier'
Conflicts:
	debian/changelog
2013-06-11 10:34:55 -04:00
Joey Hess
680d3b5120 webapp: When the user switches to display a different repository, that repository becomes the default repository to be displayed next time the webapp gets started. 2013-06-11 00:06: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
0b11c71740 Android: Add .thumbnails to .gitignore when setting up a camera repository. 2013-06-10 17:10:12 -04:00
Joey Hess
a64106dcef Supports indirect mode on encfs in paranoia mode, and other filesystems that do not support hard links, but do support symlinks and other POSIX filesystem features. 2013-06-10 13:11:33 -04:00
Joey Hess
2465c2abd1 releasing version 4.20130601 2013-06-01 20:58:32 -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
91c4dcfc69 Can now restart certain long-running git processes if they crash, and continue working.
Fuzz tests have shown that git cat-file --batch sometimes stops running.
It's not yet known why (no error message; repo seems ok). But this is
something we can deal with in the CoProcess framework, since all 3 types of
long-running git processes should be restartable if they fail.

Note that, as implemented, only IO errors are caught. So an error thrown
by the reveiver, when it sees something that is not valid output from
git cat-file (etc) will not cause a restart. I don't want it to retry
if git commands change their output or are just outputting garbage.
This does mean that if the command did a partial output and crashed in the
middle, it would still not be restarted.

There is currently no guard against restarting a command repeatedly, if,
for example, it crashes repeatedly on startup.
2013-05-31 12:42:13 -04:00
Joey Hess
88d2d59f83 glacier: Better handling of the glacier inventory, which avoids duplicate uploads to the same glacier repository by git annex copy.
The checkpresent hook can return either True or, False, or fail with a message
if it cannot successfully check the remote. Currently for glacier, when
--trust-glacier is not set, it always returns False. Crucially, in the case
when a file is in glacier, this is telling git-annex it's not there, so copy
re-uploads it. This is not desirable; it breaks using glacier-cli to retreive
that file later, and it wastes money/bandwidth.

What if it instead, when the glacier inventory is missing a
file, it returns False. And when the glacier inventory has a file, unless
--trust-glacier is set, it *fails*.

The result would be:

* `git annex copy --to glacier` would only send things not listed in inventory. If a file is listed in the inventory, `copy`
  would complain that --trust-glacier` is not set, and not re-upload the file.
* `git annex drop` would only trust that glacier has a file when --trust-glacier is set. Behavior unchanged.
* `git annex move --to glacier`, when the file is not listed in inventory, would send the file, and delete it locally. Behavior unchanged.
* `git annex move --to glacier`, when the file is listed in inventory, would only trust that glacier has the file when --trust-glacier is set
* `git annex copy --from glacier` / `git annex get`, when the file is located in glacier, would trust the location log, and attempt to get the file from glacier.
2013-05-29 13:52:42 -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
c092b4fc16 XMPP: Fix a file descriptor leak. 2013-05-26 20:49:16 -04:00
Joey Hess
919a7d7316 sync: Fix double merge conflict resolution handling.
Ie, when there'a a conflicted merge we may get foo.variant-xxxx
created in a merge. If a second merge conflict occurs on that new file,
it was not falling back to putting in the whole key (which should stop
the merge conflicts happening for good, but is ugly).
2013-05-26 17:42:15 -04:00
Joey Hess
b276857a7a content: New command line way to view and configure a repository's preferred content settings. 2013-05-25 12:44:58 -04:00
Joey Hess
e3c1586997 Improve error handling when getting uuid of http remotes to auto-ignore, like with ssh remotes. 2013-05-25 01:47:19 -04:00
Joey Hess
729eab1f89 assistant: Work around git-cat-file's not reloading the index after files are staged.
Argh.
2013-05-25 00:37:41 -04:00
Joey Hess
f8e940eb8e Fix bug in parsing of parens in some preferred content expressions. This fixes the behavior of the manual mode group.
The current manual mode preferred content expression is:

"present and (((exclude=*/archive/* and exclude=archive/*) or (not (copies=archive:1 or copies=smallarchive:1))) or (not copies=semitrusted+:1))"

The old matcher misparsed this, to basically:

OR (present and (...)) (not copies=semitrusted+:1))

The paren handling and indeed the whole conversion from tokens to the
matcher was just wrong. The new way may not be the cleverest, but I think
it is correct, and you can see how it pattern matches structurally against
the expressions when parsing them.

That expression is now parsed to:

MAnd (MOp <function>)
  (MOr (MOr (MAnd (MOp <function>) (MOp <function>)) (MNot (MOr (MOp <function>) (MOp <function>))))
    (MNot (MOp <function>)))

Which appears correct, and behaves correct in testing.

Also threw in a simplifier, so the final generated Matcher has less
unnecessary clutter in it. Mostly so that I could more easily read &
confirm them.

Also, added a simple test of the Matcher to the test suite.

There is a small chance of badly formed preferred content expressions
behaving differently than before due to this rewrite.
2013-05-24 21:46:33 -04:00
Joey Hess
4713f0c89d Android app: Avoid using hard links to app's lib directory, which is sometimes on a different filesystem than the data directory.
Assumes symlinks work on all android. If not, this would need to be adapted
to try both. This worked for me.
2013-05-23 13:54:49 -04:00
Joey Hess
99324eac9a XMPP: Send pings and use them to detect when contact with the server is lost.
I noticed that when my modem hung up and redialed, my xmpp client was left
sending messages into the void. This will also handle any idle
disconnection issues.
2013-05-22 17:03:46 -04:00
Joey Hess
2dce874c77 hook special remote: Added combined hook program support. 2013-05-21 19:19:03 -04:00
Joey Hess
08c03b2af3 XMPP: Avoid redundant and unncessary pushes. Note that this breaks compatibility with previous versions of git-annex, which will refuse to accept any XMPP pushes from this version. 2013-05-21 18:24:29 -04:00
Joey Hess
b3a521db70 releasing version 4.20130521 2013-05-21 14:23:27 -04:00
Joey Hess
5be88def0a mention autobuild fixes 2013-05-20 18:49:47 -04:00
Joey Hess
e0327eaafc Detect bad content in ~/.config/git-annex/program and look in PATH instead. 2013-05-20 17:42:40 -04:00
Joey Hess
3d8355d984 Fix a bug in the git-annex branch handling code that could cause info from a remote to not be merged and take effect immediately.
This bug was turned up by the test suite, running fsck in direct mode.
A repository was cloned, was put into direct mode, was fscked, and fsck
incorrectly said that no copy existed of a file, that was actually present
in origin.

This turned out to occur because fsck first did a Annex.Branch.change,
recording that it did not locally have the file. That was recorded in the
journal. Since neither the git annex direct not the fsck had yet needed to
read any info from the branch, but had only made changes to it, the
origin/git-annex branch was not yet merged in. So the journal got a
location log entry written to it, but this did not include
the location log info for the origin. When fsck then did a
Annex.Branch.get, it trusted the journal was cosnsitent, and returned it,
again w/o merging from origin/git-annex. This latter behavior is the
actual bug.

Refer to commit e9bfa8eaed for the thinking
behind it being ok to make a change to a file on the branch, without
first merging the branch. That thinking still stands. However, it means
that files in the journal cannot be trusted to be consistent if the branch
has not been merged. So, to fix, just enure the branch gets merged, even
when reading from the journal.

In tests, this does not seem to cause any extra merging. Except, of course,
in the one case described above. But git annex add, etc, are able to make
changes w/o first merging the branch.
2013-05-20 15:14:59 -04:00
Joey Hess
475e705643 run the test suite twice, once in direct mode
On a filesystem that only supports direct mode, it will test
direct mode twice, but oh well.
2013-05-20 14:09:50 -04:00
Joey Hess
f4ba19f2b8 direct mode bug fix: After a conflicted merge was automatically resolved, the content of a file that was already present could incorrectly be replaced with a symlink.
The bug was in movein, which just replaceFile'd the file with a symlink,
even if it already had the desired content, before trying to pull the
content out of the annex and replace the symlink with it.

That was ok-ish for non conflicted merges, where if the file existed it would
be an old version of the content. But for conflicted merges, the automatic
merge resolver has already run, and will have already put the desired
content into the file for the local variant.

Also, made removeDirect not trust that the associated files map is correct.
Only if it can verify that another file has the content will it not move it
into .git/annex/objects.
2013-05-20 13:41:09 -04:00
Joey Hess
9fa063a00f debian architecture build fun 2013-05-19 21:44:33 -04:00
Joey Hess
d5ba9cb728 Allow building with gpg2. 2013-05-19 17:59:58 -04:00
Joey Hess
1c72e0709b Fix a zombie that could result when running a process like gpg to read and write to it. 2013-05-19 15:52:22 -04:00
Joey Hess
345ee4f37c Switch to MonadCatchIO-transformers for better handling of state while catching exceptions.
As seen in this bug report, the lifted exception handling using the StateT
monad throws away state changes when an action throws an exception.
http://git-annex.branchable.com/bugs/git_annex_fork_bombs_on_gpg_file/
  .. Which can result in cached values being redundantly calculated, or other
     possibly worse bugs when the annex state gets out of sync with reality.

This switches from a StateT AnnexState to a ReaderT (MVar AnnexState).
All changes to the state go via the MVar. So when an Annex action is
running inside an exception handler, and it makes some changes, they
immediately go into affect in the MVar. If it then throws an exception
(or even crashes its thread!), the state changes are still in effect.

The MonadCatchIO-transformers change is actually only incidental.
I could have kept on using lifted-base for the exception handling.
However, I'd have needed to write a new instance of MonadBaseControl
for the new monad.. and I didn't write the old instance.. I begged Bas
and he kindly sent it to me. Happily, MonadCatchIO-transformers is
able to derive a MonadCatchIO instance for my monad.

This is a deep level change. It passes the test suite! What could it break?

Well.. The most likely breakage would be to code that runs an Annex action
in an exception handler, and *wants* state changes to be thrown away.
Perhaps the state changes leaves the state inconsistent, or wrong. Since
there are relatively few places in git-annex that catch exceptions in the
Annex monad, and the AnnexState is generally just used to cache calculated
data, this is unlikely to be a problem.

Oh yeah, this change also makes Assistant.Types.ThreadedMonad a bit
redundant. It's now entirely possible to run concurrent Annex actions in
different threads, all sharing access to the same state! The ThreadedMonad
just adds some extra work on top of that, with its own MVar, and avoids
such actions possibly stepping on one-another's toes. I have not gotten
rid of it, but might try that later. Being able to run concurrent Annex
actions would simplify parts of the Assistant code.
2013-05-19 14:16:36 -04:00
Joey Hess
86912bc498 add new dep 2013-05-17 12:10:46 -04:00
Joey Hess
39ac8d18ed Sanitize debian changelog version before putting it into cabal file. Closes: #708619 2013-05-17 11:24:18 -04:00
Joey Hess
eb8344c598 releasing version 4.20130516 2013-05-16 11:35:52 -04:00
Joey Hess
4fddc522cf fixups 2013-05-15 22:48:27 -04:00
Joey Hess
aba49995b6 Merge branch 'master' into windows 2013-05-15 19:18:04 -04:00
Joey Hess
c62b54d80d start one git-cat-file per index file
This reverts 1c83b6c439 and properly fixes
the issue discussed there.

This makes git-annex behave much nicer in direct mode.
2013-05-15 18:46:38 -04:00
Joey Hess
3c98920422 Debian: Add a menu file. 2013-05-14 20:27:03 -04:00
Joey Hess
dc66b1f27d Merge branch 'master' into windows
Conflicts:
	Annex/Environment.hs
	Build/Configure.hs
	Git/Construct.hs
	Utility/FileMode.hs
2013-05-14 15:37:24 -04:00
Joey Hess
c553f56634 migrate: Detect if a file gets corrupted while it's being migrated. 2013-05-13 14:27:39 -04:00
Joey Hess
924ed999c5 add unix-compat to deps 2013-05-11 17:21:12 -04:00
Joey Hess
ff587d5261 update 2013-05-11 17:18:05 -04:00
Joey Hess
629dd2767c rename var 2013-05-10 18:52:35 -04:00
Joey Hess
2477bf1016 reorder 2013-05-09 13:58:23 -04:00
Joey Hess
f92eaf6315 rsync special remotes: When sending from a crippled filesystem, use the destination's default file permissions, as the local ones can be arbitrarily broken. (Ie, ----rwxr-x for files on Android) 2013-05-09 13:55:18 -04:00
Joey Hess
d38854f3d1 configure: Better checking that sha commands output in the desired format.
Run the same code git-annex used to get the sha, including its sanity
checking. Much better than old grep. Should detect FreeBSD systems with
sha commands that output in stange format.
2013-05-08 11:17:09 -04:00
Joey Hess
cda0ed5d25 SHA: Add a runtime sanity check that sha commands output something that appears to be a real sha.
This after fielding a bug where git-annex was built with a sha256 program
whose output checked out, but was then run with one that output lines
like:

SHA256 (file) = <sha here>

Which it then parsed as having a SHA256 of "SHA256"!

Now the output of the command is required to be of the right length,
and contain only the right characters.
2013-05-07 20:19:37 -04:00
Joey Hess
adde00f4f3 git-annex-shell: Ensure that received files can be read. Files transferred from some Android devices may have very broken permissions as received. 2013-05-06 17:30:57 -04:00
Joey Hess
a0f6dab8de When initializing a directory special remote with a relative path, the path is made absolute.
Using a relative path would work, until the user changed to some other
directory in the repo and tried to access the remote from there..
2013-05-06 17:15:36 -04:00
Joey Hess
247b7e9e58 direct: Fix a bug that could cause some files to be left in indirect mode.
It's possible for files in indirect mode to have a direct mode mapping
file. Probably from when they were in direct mode. In this case,
toDirectGen tried to copy the content from the direct mode file that the
mapping said had it. But, being in indirect mode, it didn't really have the
content. So it did nothing. This fix makes it always move the content from
.git/annex/objects/ when it's there.
2013-05-06 12:43:03 -04:00
Joey Hess
2d51434341 Avoid depending on regex-tdfa on mips, mipsel, and s390, where it fails to build. 2013-05-06 09:44:55 -04:00
Joey Hess
f387a00484 try to fix build on hurd, which lacks haskell-network-info 2013-05-06 09:39:15 -04:00
Joey Hess
8860cff556 Disable building with the haskell threaded runtime when the assistant is not built. This may fix builds on s390x and sparc, which are failing to link -lHSrts_thr 2013-05-06 09:35:43 -04:00
Joey Hess
8df0611e00 Temporarily add an upper bound to the version of yesod that can be built with, since yesod 1.2 has a great many changes that will require extensive work on the webapp. 2013-05-02 23:12:47 -04:00
Joey Hess
f7d2523adc work around strange endianness bug in port number on Android 2013-05-02 22:38:45 -04:00
Joey Hess
b61740e6d3 releasing version 4.20130501 2013-05-01 13:19:29 -04:00
Joey Hess
0f06eb5ecf reorder 2013-04-30 20:56:43 -04:00
Joey Hess
1111552efd update 2013-04-30 19:33:32 -04:00
Joey Hess
e363cefcb3 assistant: Fix bug that could cause incoming pushes to not get merged into the local tree.
Observed that the pushed refs were received, but not merged into master.
The merger never saw an add event for these refs. Either git is not writing
to a new file and renaming it into place, or the inotify code didn't notice
that. Changed it to also watch for modify events and that seems to have
fixed it!
2013-04-30 16:37:13 -04:00
Joey Hess
bcb23eca4b update changelog
Note that the note on df88c51334 turned out
to be wrong. Multiple repository pairing over XMPP does work, because the
annex-uuid of the xmpp remote is updated to the uuid of the new repo
when pairing takes place. So the push from it is accepted. (And the other
UUIDs are listed in uuid.log, so pushes from those repositories also are
accepted of course.)
2013-04-30 16:01:25 -04:00
Joey Hess
543a78bae0 Support building with DAV 0.4. 2013-04-30 14:10:55 -04:00
Joey Hess
883b17af01 Store an annex-uuid file in the bucket when setting up a new S3 remote. 2013-04-27 17:01:24 -04:00
Joey Hess
c3498042fd webapp: Now automatically fills in any creds used by an existing remote when creating a new remote of the same type. Done for Internet Archive, S3, Glacier, and Box.com remotes. 2013-04-27 15:16:06 -04:00
Joey Hess
85d83e7756 To enable an existing special remote, the new enableremote command must be used. The initremote command now is used only to create new special remotes. 2013-04-26 18:22:52 -04:00
Joey Hess
0ae8c82c53 per-IA-item content directories 2013-04-25 23:44:55 -04:00
Joey Hess
3c7f4d2bd1 Automatically register public urls for files uploaded to the Internet Archive. 2013-04-25 17:28:25 -04:00
Joey Hess
e3ea36174b webapp: Display some additional information about a repository on its edit page. 2013-04-25 16:42:17 -04:00
Joey Hess
3e396a3b89 S3: Dropping content from the Internet Archive doesn't work, but their API indicates it does. Always refuse to drop from there. 2013-04-25 15:20:31 -04:00
Joey Hess
2810807ca5 Internet Archive!
* Add public repository group.
* webapp: Can now set up Internet Archive repositories.

TODO: Enabling IA repositories.
2013-04-25 12:23:36 -04:00
Joey Hess
49547ad32d initremote: If two existing remotes have the same name, prefer the one with a higher trust level. 2013-04-24 21:53:58 -04:00
Joey Hess
46529c0129 assistant: Sanitize XMPP presence information logged for debugging. 2013-04-24 21:13:10 -04:00
Joey Hess
25aabf4ffe add TList, built on DList 2013-04-24 16:01:01 -04:00
Joey Hess
a435a88c56 changelog 2013-04-24 13:09:28 -04:00
Joey Hess
4b1cf3d731 Detect when the remote is broken like bitbucket is, and exits 0 when it fails to run git-annex-shell. 2013-04-23 20:06:02 -04:00
Joey Hess
07580dc3df sync: Bug fix, avoid adding to the annex the dummy symlinks used on crippled filesystems.
The root of the problem is that toInodeCache sees a non-symlink, and so
goes on and generates a new inode cache for the dummy symlink.

Any place that toInodeCache, or sameFileStatus, or genInodeCache are called
may need to deal with this case. Although many of them are ok. For example,
prepSendAnnex calls sameInodeCache, which calls genInodeCache.. but if
the file content is not present, the InodeCache generated for its standin
file is appropriately not the same, and so it returns Nothing.

I've audited some, but have to say I'm not happy with this; it should be
handled at the type level somehow, or a toInodeCache wrapper be used that
is aware of dummy symlinks.

(The Watcher already dealt with it, via the guardSymlinkStandin function.)
2013-04-23 17:14:28 -04:00
Joey Hess
6be815a30c rmurl: New command, removes one of the recorded urls for a file. 2013-04-22 17:18:53 -04:00
Joey Hess
450baa02e9 assistant: When built with git before 1.8.0, use git remote rm to delete a remote. Newer git uses git remote remove. 2013-04-22 16:53:09 -04:00
Joey Hess
dc39da52f8 direct, indirect: Refuse to do anything when the assistant or git-annex watch daemon is running. 2013-04-22 16:41:46 -04:00
Joey Hess
e92a207df5 webapp: When told to add a git repository on a remote server, and the repository already exists as a non-bare repository, use it, rather than initializing a bare repository in the same directory. 2013-04-22 16:21:37 -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
8861e270be sync, assistant: Sync with remotes that have annex-ignore set
This is so git remotes on servers without git-annex installed can be used
to keep clients' git repos in sync.

This is a behavior change, but since annex-sync can be set to disable
syncing with a remote, I think it's acceptable.
2013-04-22 14:57:09 -04:00
Joey Hess
4ddf9b7467 webapp: Don't default to making repository in cwd when started from within a directory containing a git-annex file (eg, standalone tarball directory). 2013-04-20 18:53:04 -04:00
Joey Hess
d2e92e2494 Install FDO desktop menu file when webapp is started in standalone mode. 2013-04-20 18:48:05 -04:00
Joey Hess
090a69f00c assistant: Work around misfeature in git 1.8.2 that makes git commit --alow-empty -m "" run an editor.
See http://git-annex.branchable.com/bugs/assistant_hangs_during_commit/
2013-04-18 16:27:17 -04:00
Joey Hess
67eadf3fa2 releasing version 4.20130417 2013-04-17 11:16:44 -04:00
Joey Hess
7d11511d54 new build dep 2013-04-16 19:00:44 -04:00
Joey Hess
22afcdf2a5 fsck: Check content of direct mode files (only when the inode cache thinks they are unmodified).
I wrote this earlier, but it never worked because it was looking at the
.git/annex/object content, which is not there..
2013-04-16 16:20:30 -04:00
Joey Hess
6490418a4e Fall back to internal url downloader when built without curl. 2013-04-16 15:42:51 -04:00
Joey Hess
8b27c366b8 add wget and curl to build deps, so configure can find them 2013-04-16 14:50:31 -04:00
Joey Hess
7956177445 webapp: Include the repository directory in the mangled hostname and ssh key name, so that a locked down ssh key for one repository is not re-used when setting up additional repositories on the same server. 2013-04-16 13:49:39 -04:00
Joey Hess
087814c880 reorder changelog 2013-04-14 19:26:30 -04:00
Joey Hess
83004de111 avoid runghc 2013-04-14 16:10:38 -04:00
Joey Hess
aca9e4f0b4 random ssh keys (╯°□°)╯︵ ┻━┻ gnome-keyring
assistant: Work around horrible, terrible, very bad behavior of
gnome-keyring, by not storing special-purpose ssh keys in ~/.ssh/*.pub.

Apparently gnome-keyring apparently will load and indiscriminately use such
keys in some cases, even if they are not using any of the standard ssh key
names. Instead store the keys in ~/.ssh/annex/, which gnome-keyring will
not check.

Note that neither I nor #debian-devel were able to quite reproduce this
problem, but I believe it exists, and that this fixes it. And it certianly
won't hurt anything..
2013-04-14 15:34:59 -04:00
Joey Hess
5ad34153bd update 2013-04-13 19:28:24 -04:00
Joey Hess
9e11699c76 connect existing meters to the transfer log for downloads
Most remotes have meters in their implementations of retrieveKeyFile
already. Simply hooking these up to the transfer log makes that information
available. Easy peasy.

This is particularly valuable information for encrypted remotes, which
otherwise bypass the assistant's polling of temp files, and so don't have
good progress bars yet.

Still some work to do here (see progressbars.mdwn changes), but this
is entirely an improvement from the lack of progress bars for encrypted
downloads.
2013-04-11 17:32:31 -04:00
Joey Hess
1eb3fff787 addurl: Register transfer so the webapp can see it.
* addurl: Register transfer so the webapp can see it.
* addurl: Automatically retry downloads that fail, as long as some
  additional content was downloaded.
2013-04-11 16:14:17 -04:00
Joey Hess
7b4733f0e8 addurl: Bugfix: Did not properly add file in direct mode. 2013-04-11 13:35:52 -04:00
Joey Hess
04a27ad926 assistant: Bug fix to avoid annexing the files that git uses to stand in for symlinks on FAT and other filesystem not supporting symlinks.
also, blog for the day..
2013-04-10 19:57:26 -04:00
Joey Hess
271a919d14 assistant: Added sequence numbers to XMPP git push packets. (Not yet used.)
For backwards compatability, "" is treated as "0" sequence number.

--debug will show xmpp sequence numbers now, but they are not otherwise
used.
2013-04-10 18:39:56 -04:00
Joey Hess
d8f8aa6921 assistant: Stop any transfers the assistant initiated on shutdown. 2013-04-10 17:38:53 -04:00
Joey Hess
3369af61ba changelog 2013-04-10 17:28:42 -04:00
Joey Hess
59f616684d The version number is now derived from git, unless built with VERSION_FROM_CHANGELOG. 2013-04-10 16:53:38 -04:00
Joey Hess
d440b6047b Added annex.web-download-command setting. 2013-04-08 23:34:05 -04:00
Joey Hess
740ec66dcf webapp: When a repository's group is changed, rescan for transfers. 2013-04-08 16:45:12 -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
1112628cdf Avoid using runghc when building the Debian package, as that needs ghci. 2013-04-07 17:15:58 -04:00
Joey Hess
84de4a14ad better archive directory handling
Adjust preferred content expressions so that content in archive directories
is preferred until it has reached an archive or smallarchive repository.
2013-04-06 18:29:52 -04:00
Joey Hess
c511eb048f changelog & minor style fixes 2013-04-06 16:14:57 -04:00
Joey Hess
602baae12e Bugfix: Direct mode no longer repeatedly checksums duplicated files.
Fixed by storing a list of cached inodes for a key, instead of just one.

Backwards compatability note: An old git-annex version will fail to parse
an inode cache file that has been written by a new version, and has
multiple items. It will succees if just one. So old git-annexes will have
even worse behavior when there are duplicated files, if that is possible.
I don't think it will be a problem. (Famous last words.)

Also, note that it doesn't expire old and unused inode caches for a key.
It would be possible to add this if needed; just look through the
associated files for a key and if there are more cached inodes, throw out
any not corresponding to associated files. Unless a file is being copied
repeatedly and the old copy deleted, this lack of expiry should not be a
problem.
2013-04-06 16:07:25 -04:00
Joey Hess
c709623ff8 prep release 2013-04-05 11:12:41 -04:00
Joey Hess
f1b0a4b404 Use lower case hash directories for storing files on crippled filesystems, 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.
2013-04-04 15:46:33 -04:00
Joey Hess
bd5d664a0c init: Probe whether the filesystem supports fifos, and if not, disable ssh connection caching. 2013-04-04 13:14:55 -04:00
Joey Hess
0f6a6f2a8b avoid queueing uploads to remotes that already have the content 2013-04-02 15:51:58 -04:00
Joey Hess
38d61f934d Update working tree files fully atomically
This avoids commit churn by the assistant when eg,
replacing a file with a symlink.

But, just as importantly, it prevents the working tree being left with a
deleted file if git-annex, or perhaps the whole system, crashes at the
wrong time.

(It also probably avoids confusing displays in file managers.)
2013-04-02 15:02:00 -04:00
Joey Hess
31cbde8190 assistant: Fix bug that could cause direct mode files to be unstaged from git.
My test case for this bug is to have the assistant running and syncing to
a remote, and create a file in the annex. Then at the command line run
git annex drop. The assistant sees that the file is gone, sees it's a wanted
file, and downloads it from the remote.

With a directory special remote and a small file, I was seeing around 1
time in 3, a race where the file got unstaged from git after it got
downloaded.

Looking at what direct mode content managing code does in this case, it
deletes the symlink, and then adds the file content back. It would be
possible, sometimes, to avoid removing the symlink and do this atomically.
And I probably should.. but in some cases, particularly where the file
needs to be run through `cp` (multiple direct mode files with same
content), there's no way to atomically replace the symlink with the
content.

Anyway, the bug turns out to be something that the watcher does right for
indirect mode, but not for direct mode. When it got an add event, it
checked to see if this was a new file, or one we've already added. In the
latter case, no add event was queued. But that means that only the rm event
is queued, and so it unstages the file.

Fixed by queueing an add event even when the file is already in git.

Tested by running hundreds of drops in a loop; file remained staged.
2013-04-02 12:45:31 -04:00
Joey Hess
d87af82d97 drop --auto: Fix bug that prevented dropping files from untrusted repositories.
This is a corresponding bug to the one I fixed yesterday in the assistant.
2013-04-01 15:20:42 -04:00
Joey Hess
d888fb6a4b move content from remote when user asks to delete it 2013-03-31 19:00:43 -04:00
Joey Hess
940e167ecc Adjust built-in preferred content expressions to make most types of repositories want content that is only located on untrusted or dead repositories. 2013-03-31 17:10:25 -04:00
Joey Hess
c57baaaa30 webapp: Added UI to delete repositories. Closes: #689847 2013-03-31 16:38:05 -04:00