git-annex/Assistant/Threads
Joey Hess 6d7ecd9e5d
merge git-annex branch in memory in read-only repository
Improved support for using git-annex in a read-only repository, git-annex
branch information from remotes that cannot be merged into the git-annex
branch will now not crash it, but will be merged in memory.

To avoid this making git-annex behave one way in a read-only repository,
and another way when it can write, it's important that Annex.Branch.get
return the same thing (modulo log file compaction) in both cases.

This manages that mostly. There are some exceptions:

- When there is a transition in one of the remote git-annex branches
  that has not yet been applied to the local or other git-annex branches.
  Transitions are not handled.
- `git-annex log` runs git log on the git-annex branch, and so
  it will not be able to show information coming from the other, not yet
  merged branches.
- Annex.Branch.files only looks at files in the git-annex branch and not
  unmerged branches. This affects git-annex info output.
- Annex.Branch.hs.overBranchFileContents ditto. Affects --all and
  also importfeed (but importfeed cannot work in a read-only repo
  anyway).
- CmdLine.Seek.seekFilteredKeys when precaching location logs.
  Note use of Annex.Branch.fullname
- Database.ContentIdentifier.needsUpdateFromLog and updateFromLog

These warts make this not suitable to be merged yet.

This readonly code path is more expensive, since it has to query several
branches. The value does get cached, but still large queries will be
slower in a read-only repository when there are unmerged git-annex
branches.

When annex.merge-annex-branches=false, updateTo skips doing anything,
and so the read-only repository code does not get triggered. So a user who
is bothered by the extra work can set that.

Other writes to the repository can still result in permissions errors.
This includes the initial creation of the git-annex branch, and of course
any writes to the git-annex branch.

Sponsored-by: Dartmouth College's Datalad project
2021-12-27 13:21:15 -04:00
..
Committer.hs defer write permissions checking in import until after copy to repo 2021-09-02 13:45:21 -04:00
ConfigMonitor.hs add git ls-tree --long parser 2021-03-23 12:47:00 -04:00
Cronner.hs assistant: Avoid unncessary git repository repair 2021-06-30 18:00:16 -04:00
DaemonStatus.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Exporter.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Glacier.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
Merger.hs merge git-annex branch in memory in read-only repository 2021-12-27 13:21:15 -04:00
MountWatcher.hs finished this stage of the RawFilePath conversion 2020-11-04 14:20:37 -04:00
NetWatcher.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
PairListener.hs convert TopFilePath to use RawFilePath 2019-12-09 15:07:21 -04:00
ProblemFixer.hs assistant: Avoid unncessary git repository repair 2021-06-30 18:00:16 -04:00
Pusher.hs update licenses from GPL to AGPL 2019-03-13 15:48:14 -04:00
RemoteControl.hs convert to withCreateProcess for async exception safety 2020-06-04 12:44:09 -04:00
SanityChecker.hs switch from hslogger to purpose-built Utility.Debug 2021-04-05 13:40:31 -04:00
TransferPoller.hs convert getFileSize to RawFilePath 2020-11-05 11:32:57 -04:00
Transferrer.hs propagate git-annex -c on to transferrer child process 2020-12-15 11:36:25 -04:00
TransferScanner.hs add SeekInput (not yet used) 2020-09-15 15:41:13 -04:00
TransferWatcher.hs finished this stage of the RawFilePath conversion 2020-11-04 14:20:37 -04:00
Upgrader.hs fix windows assistant upgrade glitch 2020-11-19 12:50:25 -04:00
UpgradeWatcher.hs finished this stage of the RawFilePath conversion 2020-11-04 14:20:37 -04:00
Watcher.hs improve function name 2021-09-27 12:52:30 -04:00
WebApp.hs switch from hslogger to purpose-built Utility.Debug 2021-04-05 13:40:31 -04:00