Commit graph

38751 commits

Author SHA1 Message Date
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
jwodder
ad180cedc7 2020-12-16 16:03:04 +00:00
Joey Hess
2abda21123
update 2020-12-15 16:35:06 -04:00
Joey Hess
117d270bb4
comment 2020-12-15 16:34:16 -04:00
Joey Hess
f29d49d478
check Remote.hasKeyCheap again
In cd1676d604, it stopped using that to avoid surprising behavior
when the location log and remote content were out of sync.
But, it seems that may have changed some behavior users relied on as
well, and also Remote.hasKeyCheap should be faster than checking then
location log.

So, try Remote.hasKeyCheap first, and only if it does not have the key,
fall back to checking the location log. If the location log still thinks
it's present, go ahead and try to get it, so the user will see a failure
rather than silently skipping a file what whereis says is on the remote.

This does make slightly slower the case where the remote does not have
the key, and location log and Remote.hasKeyCheap agree, since it now
checks both. But only 1 stat slower.
2020-12-15 14:44:00 -04:00
Joey Hess
c2a5f3c44f
followup 2020-12-15 14:05:54 -04:00
Joey Hess
3d49e16a10
comment 2020-12-15 13:21:15 -04:00
Joey Hess
4c1461932f
comment 2020-12-15 13:17:31 -04:00
Joey Hess
4488bbd540
response 2020-12-15 13:03:06 -04:00
Joey Hess
72ec7da41b
OSXMkLibs: skip @loader_path
This may or may not make the OSX build work on a newer version of OSX
than the one that's currently being used for release builds. I have not
been able to find good docs about how exactly to get back from such a
value to the actual path to the library that the linker would use.
2020-12-15 12:47:24 -04:00
Joey Hess
5ae0e07ad0
Merge branch 'master' of ssh://git-annex.branchable.com 2020-12-15 12:40:07 -04:00
Joey Hess
6b13574827
Windows: include= and exclude= containing '/' will also match filenames that are written using '\'
And vice-versa, but it's better to use '/' for portability.

Notably, standardPreferredContent contains "archive/*" and that might not
match if the filename ends up coming in with the slashes the other way
around.
2020-12-15 12:39:34 -04:00
yarikoptic
07b8dc4a8b Added a comment 2020-12-15 16:18:39 +00:00
Joey Hess
e914cb0777
Merge branch 'master' of ssh://git-annex.branchable.com 2020-12-15 12:12:29 -04:00
Joey Hess
3519f1ab7f
reorg 2020-12-15 12:12:03 -04:00