Commit graph

38915 commits

Author SHA1 Message Date
Joey Hess
15000dee07
improve thirdpartypopulated support
May actually work now.

Note that, importKey now has to add the size to the key if it's supposed
to have size. Remote.Directory relied on the importer adding the size,
which is no longer done, so it was changed; it was the only one.
This way, importKey does not need to behave differently between regular
and thirdpartypopulated imports.
2020-12-21 16:19:44 -04:00
jkniiv
21302c00ef Added a comment: well done! 2020-12-21 18:14:26 +00:00
Joey Hess
57b03630b3
support thirdPartyPopulated
These don't have importTree in their config, because they don't support
tree import, but they do still support import, and do not support export
or key/value modification.
2020-12-21 13:49:47 -04:00
Joey Hess
706e2a63fb
fix logic error in thirdPartyPopulated handling 2020-12-21 13:24:07 -04:00
amerlyq+annex@12121d70a602f094228689a0a24d348d478a8af1
825ff92a40 Added a comment: "mirror" workflow: usage of "wanted" expression is inconsistent with regular annex remote 2020-12-21 07:34:28 +00:00
amerlyq+annex@12121d70a602f094228689a0a24d348d478a8af1
f0490ebad1 Added a comment: adb special remote 2020-12-21 06:36:33 +00:00
Joey Hess
bd7b85371f
bug report 2020-12-20 16:27:32 -04:00
dzhu
9fffe46b0d 2020-12-19 23:05:32 +00:00
Joey Hess
ca31d7e54f
refactor
That code was not borg specific, and I can see making more remotes for
other backup software.
2020-12-18 17:08:44 -04:00
Joey Hess
1c054f1cf7
started borg special remote
Still need to implement 3 methods, but importKeyM looks like it will
work well to find annex object files.
2020-12-18 16:56:54 -04:00
Joey Hess
771b6c64f0
Merge branch 'master' into borg 2020-12-18 16:05:09 -04:00
Joey Hess
e0062c4f93
build fix 2020-12-18 16:04:56 -04:00
Joey Hess
3207e8293b
start borg special remote
Compiles, but unusable so far.
2020-12-18 16:03:51 -04:00
Joey Hess
909318dcee
Merge branch 'master' into borg 2020-12-18 15:27:24 -04:00
Joey Hess
9a2c8757f3
add thirdPartyPopulated interface
This is to support, eg a borg repo as a special remote, which is
populated not by running git-annex commands, but by using borg. Then
git-annex sync lists the content of the remote, learns which files are
annex objects, and treats those as present in the remote.

So, most of the import machinery is reused, to a new purpose. While
normally importtree maintains a remote tracking branch, this does not,
because the files stored in the remote are annex object files, not
user-visible filenames. But, internally, a git tree is still generated,
of the files on the remote that are annex objects. This tree is used
by retrieveExportWithContentIdentifier, etc. As with other import/export
remotes, that  the tree is recorded in the export log, and gets grafted
into the git-annex branch.

importKey changed to be able to return Nothing, to indicate when an
ImportLocation is not an annex object and so should be skipped from
being included in the tree.

It did not seem to make sense to have git-annex import do this, since
from the user's perspective, it's not like other imports. So only
git-annex sync does it.

Note that, git-annex sync does not yet download objects from such
remotes that are preferred content. importKeys is run with
content downloading disabled, to avoid getting the content of all
objects. Perhaps what's needed is for seekSyncContent to be run with these
remotes, but I don't know if it will just work (in particular, it needs
to avoid trying to transfer objects to them), so I skipped that for now.

(Untested and unused as of yet.)

This commit was sponsored by Jochen Bartl on Patreon.
2020-12-18 15:23:58 -04:00
Joey Hess
e998320318
Merge branch 'master' of ssh://git-annex.branchable.com 2020-12-18 15:14:10 -04:00
Joey Hess
f62aee0525
fix handling of importtree-only remotes
Don't want to try to use these remotes as key/value remotes, which will
surely fail. It only recently became possible for importtree to be set
w/o exporttree, so before this code was ok.

(cherry picked from commit 97599cb0f7f4115aa5a3e81a91ee3d1d6c52dc84)
2020-12-18 15:13:30 -04:00
Joey Hess
037f8b6863
update 2020-12-18 11:06:23 -04:00
Joey Hess
f930176d6e
change info from export=yes to exporttree=yes and same for import
for consistency
2020-12-17 17:06:50 -04:00
Ilya_Shlyakhter
738d919df3 Added a comment: encryption=onlycreds 2020-12-17 21:01:33 +00:00
Joey Hess
933c86f186
Merge branch 'master' into borg 2020-12-17 16:50:25 -04:00
Joey Hess
e9db382308
avoid redundant set of a S3 verison ID that is already recorded
I think this could cause unnecessary changes to the git-annex branch,
and retrieveExportWithContentIdentifier is now also used for getting
content from importtree=yes remotes, so it would happen more frequently
so let's avoid.
2020-12-17 16:49:17 -04:00
Joey Hess
f0a495fa05
Merge branch 'master' into borg 2020-12-17 16:36:15 -04:00
Joey Hess
e5ef8aea9a
Merge branch 'master' of ssh://git-annex.branchable.com 2020-12-17 16:35:10 -04:00
Joey Hess
4c63cab467
todo 2020-12-17 16:30:51 -04:00
Joey Hess
400bdb48db
update warnExportImportConflict for import-only remotes 2020-12-17 16:25:46 -04:00
Joey Hess
77aedbef8b
fix call to warnExportImportConflict
That needs a Remote that has the right export/import set up, not the input
Remote, which does not yet.
2020-12-17 16:25:02 -04:00
Joey Hess
a4451ac391
add missing space 2020-12-17 15:58:14 -04:00
Joey Hess
f2ecc6e0da
import remotes use ContentIdentifier for getting and checking content
This is better than using the equivilant actions for export remotes,
especially for getting content, since the ContentIdentifier checking
means we can be sure (enough) that the content is valid to not force
verification of content. Which allows getting keys of types that cannot
be verified.

Also, reorganized the internals of adjustExportImport which was becoming
very hard to follow. Now it's clear what each method does in each case.
2020-12-17 15:55:31 -04:00
Joey Hess
5946e7136e
force verification after getting file from export remote
This way, if annex.verify is disabled, it's still checked, since this is
not a key/value store, it has to be checked.
2020-12-17 15:31:22 -04:00
kyle
48da7e002d Added a comment 2020-12-17 19:05:13 +00:00
Joey Hess
ceda8c0066
refactor common code 2020-12-17 14:17:09 -04:00
dscheffy@c203b7661ec8c1ebd53e52627c84536c5f0c9026
c53057caa3 Added a comment 2020-12-17 18:14:16 +00:00
Joey Hess
4d2cd58ee5
provide missing remote actions for importree only remote
Ah, it seemed too easy before when I was implementing importrree only,
and it was because all the key-based actions needed to be handled too.

Mostly copied from isexport, and this works. It does seem that
an import remote could use retrieveExportWithContentIdentifier
rather than retrieveExport, and checkPresentExportWithContentIdentifier
rather than checkPresentExport, which would both be more accurate.
2020-12-17 13:46:34 -04:00
Joey Hess
1b5cb77acf
importtree only remotes are untrusted, same as exporttree remotes
Importtree only remotes are new; importtree remotes used to always also be
exporttree, so were untrusted.

Since an import remote is one that can be edited by something other than
git-annex, it's clearly not trustworthy at all.
2020-12-17 13:45:07 -04:00
kyle
49c4d471ff Added a comment 2020-12-17 17:41:36 +00:00
Joey Hess
e81e43b829
improve comment 2020-12-17 13:12:52 -04:00
Joey Hess
ef8c36254a
docs for borg special remote
(which DNE yet)
2020-12-17 13:12:35 -04:00
Joey Hess
e9af56fef1
typo 2020-12-17 12:53:47 -04:00
Joey Hess
53fd1564b1
improve synopsis 2020-12-17 12:51:49 -04:00
Joey Hess
7c7486a45f
response 2020-12-17 12:47:07 -04:00
Joey Hess
c52550a6a8
Merge branch 'master' of ssh://git-annex.branchable.com 2020-12-17 12:45:07 -04:00
Joey Hess
170185fb78
improve docs 2020-12-17 12:32:41 -04:00
Joey Hess
00352ebe37
man page improvement 2020-12-17 12:17:58 -04:00
Joey Hess
26aad24fd3
simplify
As the only blocking operation now is threadDelaySeconds, no need to
calculate actual time and actual expected minimum size.
2020-12-17 12:09:49 -04:00
kyle
54dc20fb74 Added a comment 2020-12-17 16:06:44 +00:00
dscheffy@c203b7661ec8c1ebd53e52627c84536c5f0c9026
3f95fa2a3a Added a comment: How do I man annex config options? 2020-12-17 10:39:40 +00:00
dscheffy@c203b7661ec8c1ebd53e52627c84536c5f0c9026
a2d5fd0aa6 2020-12-16 18:53:21 +00:00
dscheffy@c203b7661ec8c1ebd53e52627c84536c5f0c9026
05ee618d11 Added a comment: Duplicate content creates frustrating cycles 2020-12-16 17:10:52 +00:00
jwodder
cf43362cae Add post metadata 2020-12-16 16:03:55 +00:00