git-annex/Types
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
..
ActionItem.hs wip RawFilePath 2x git-annex find speedup 2019-11-26 16:01:58 -04:00
AdjustedBranch.hs make sync update --unlock-present branch 2020-11-13 15:04:34 -04:00
Availability.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Backend.hs convert getFileSize to RawFilePath 2020-11-05 11:32:57 -04:00
Benchmark.hs benchmark: Add --databases to benchmark sqlite databases 2019-10-29 16:59:27 -04:00
BranchState.hs cache one more log file for metadata 2020-07-07 14:18:55 -04:00
CatFileHandles.hs cat-file resource pool 2020-04-20 15:19:31 -04:00
CleanupActions.hs propagate signals to the transferrer process group 2020-12-11 15:32:00 -04:00
Command.hs add "input" field to json output 2020-09-15 16:22:44 -04:00
Concurrency.hs differentiate between concurrency enabled at command line and by git config 2020-09-16 11:47:12 -04:00
Creds.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Crypto.hs remove Show Cipher 2020-09-01 18:11:22 -04:00
DeferredParse.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
DesktopNotify.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
Difference.hs annex.addunlocked expressions 2019-12-20 15:56:25 -04:00
Distribution.hs annex.addunlocked expressions 2019-12-20 15:56:25 -04:00
Export.hs deepseq all things returned from ResourceT http 2020-09-14 18:30:06 -04:00
FileMatcher.hs avoid using MatchingKey where MatchingFile can be used now 2020-12-14 17:54:25 -04:00
GitConfig.hs stall detection is working 2020-12-08 15:22:18 -04:00
Group.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Import.hs improve docs 2020-12-17 12:32:41 -04:00
IndexFiles.hs cache annex index filename for 1.5% speedup to queries 2020-04-10 13:37:04 -04:00
Key.hs new protocol for transferkeys, with message serialization 2020-12-03 16:21:20 -04:00
KeySource.hs convert KeySource to RawFilePath 2020-02-21 10:04:44 -04:00
LockCache.hs more RawFilePath conversion 2020-10-29 10:50:29 -04:00
Messages.hs simplify transferr protocol 2020-12-11 12:52:22 -04:00
MetaData.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Mime.hs Added mimeencoding= term to annex.largefiles expressions. 2019-04-30 12:17:22 -04:00
NumCopies.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
ProposedAccepted.hs separate RemoteConfig parsing basically working 2020-01-14 12:35:08 -04:00
RefSpec.hs Windows: include= and exclude= containing '/' will also match filenames that are written using '\' 2020-12-15 12:39:34 -04:00
Remote.hs add thirdPartyPopulated interface 2020-12-18 15:23:58 -04:00
RemoteConfig.hs GETCONFIG name fix 2020-03-09 12:38:04 -04:00
RemoteState.hs improve comment 2020-01-06 12:53:09 -04:00
RepoVersion.hs v7 2018-10-25 18:24:23 -04:00
ScheduledActivity.hs avoid using MonadFail in ParseDuration 2020-08-15 15:53:35 -04:00
StallDetection.hs stall detection is working 2020-12-08 15:22:18 -04:00
StandardGroups.hs a few forgotten remote config fields 2020-01-15 11:22:36 -04:00
StoreRetrieve.hs make removeKey throw exceptions 2020-05-14 14:11:05 -04:00
Test.hs remove many old version ifdefs 2019-07-05 15:09:37 -04:00
Transfer.hs more RawFilePath conversion 2020-10-29 12:03:50 -04:00
Transferrer.hs simplify transferr protocol 2020-12-11 12:52:22 -04:00
TransferrerPool.hs propagate signals to the transferrer process group 2020-12-11 15:32:00 -04:00
TrustLevel.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
UrlContents.hs remove SafeFilePath 2020-05-11 14:04:56 -04:00
UUID.hs support boolean git configs that are represented by the name of the setting with no value 2020-04-13 13:35:22 -04:00
View.hs test: Fix some test cases that assumed git's default branch name 2020-06-23 16:40:51 -04:00
WorkerPool.hs improve transfer stages for some commands 2020-05-26 11:55:50 -04:00