docs/proposals/transfer_adapters.md
To allow the uploading and downloading of LFS content to be implemented in more ways than the current simple HTTP GET/PUT approach. Features that could be supported by opening this up to other protocols might include:
See the API documentation for specifics. All changes are optional extras so there are no breaking changes to the API.
The current HTTP GET/PUT system will remain the default. When a version of the
git-lfs client supports alternative transfer mechanisms, it notifies the server
in the API request using the accept-transfers field.
If the server also supports one of the mechanisms the client advertised, it may
select one and alter the upload / download URLs to point at resources
compatible with this transfer mechanism. It must also indicate the chosen
transfer mechanism in the response using the transfer field.
The URLs provided in this case may not be HTTP, they may be custom protocols. It is up to each individual transfer mechanism to define how URLs are used.
lfs.concurrenttransfers setting. For example the default (current) approach
will parallelise on files (oids), but others may parallelise in other ways
e.g. downloading multiple parts of the same file at onceIdeally we should allow people to add other transfer implementations so that we don't have to implement everything, or bloat the git-lfs binary with every custom system possible.
Because Go is statically linked it's not possible to extend client functionality at runtime through loading libraries, so instead I propose allowing an external process to be invoked, and communicated with via a defined stream protocol. This protocol will be logically identical to the internal adapters; the core passing oids and receiving back progress and completion notifications; just that the implementation will be in an external process and the messages will be serialised over streams.
Only one process will be launched and will remain for the entire period of all transfers. Like internal adapters, the external process will be responsible for its own parallelism and temporary storage, so internally they can (should) do multiple transfers at once.