diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2015-12-22 16:11:43 +0100 |
---|---|---|
committer | Saša Živkov <sasa.zivkov@sap.com> | 2016-02-04 17:49:43 +0100 |
commit | 3bae524f6f80f9cd9b4a29f456005b51fdaba1ee (patch) | |
tree | c0c145c9d026a5a04010dd80c90ab7fe3f6c4352 /org.eclipse.jgit.pgm/resources | |
parent | 377616aca702144f6f79e1b376f3342ec81ec42b (diff) | |
download | jgit-3bae524f6f80f9cd9b4a29f456005b51fdaba1ee.tar.gz jgit-3bae524f6f80f9cd9b4a29f456005b51fdaba1ee.zip |
Support LFS protocol and a file system based LFS storage
Implement LfsProtocolServlet handling the "Git LFS v1 Batch API"
protocol [1]. Add a simple file system based LFS content store and the
debug-lfs-store command to simplify testing.
Introduce a LargeFileRepository interface to enable additional storage
implementation while reusing the same protocol implementation.
At the client side we have to configure the lfs.url, specify that
we use the batch API and we don't use authentication:
[lfs]
url = http://host:port/lfs
batch = true
[lfs "http://host:port/lfs"]
access = none
the git-lfs client appends the "objects/batch" to the lfs.url.
Hard code an Authorization header in the FileLfsRepository.getAction
because then git-lfs client will skip asking for credentials. It will
just forward the Authorization header from the response to the
download/upload request.
The FileLfsServlet supports file content storage for "Large File
Storage" (LFS) server as defined by the Github LFS API [2].
- upload and download of large files is probably network bound hence use
an asynchronous servlet for good scalability
- simple object storage in file system with 2 level fan-out
- use LockFile to protect writing large objects against multiple
concurrent uploads of the same object
- to prevent corrupt uploads the uploaded file is rejected if its hash
doesn't match id given in URL
The debug-lfs-store command is used to run the LfsProtocolServlet and,
optionally, the FileLfsServlet which makes it easier to setup a
local test server.
[1]
https://github.com/github/git-lfs/blob/master/docs/api/http-v1-batch.md
[2] https://github.com/github/git-lfs/tree/master/docs/api
Bug: 472961
Change-Id: I7378da5575159d2195138d799704880c5c82d5f3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/resources')
-rw-r--r-- | org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties index b4b1261b37..544e234e3a 100644 --- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties +++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties @@ -125,6 +125,7 @@ metaVar_remoteName=name metaVar_revision=REVISION metaVar_seconds=SECONDS metaVar_service=SERVICE +metaVar_lfsStorage=STORAGE metaVar_treeish=tree-ish metaVar_uriish=uri-ish metaVar_url=URL @@ -218,6 +219,10 @@ usage_DisplayTheVersionOfJgit=Display the version of jgit usage_Gc=Cleanup unnecessary files and optimize the local repository usage_Glog=View commit history as a graph usage_IndexPack=Build pack index file for an existing packed archive +usage_LFSDirectory=Directory to store large objects +usage_LFSPort=Server http port +usage_LFSRunStore=fs: store lfs objects in file system +usage_LFSStoreUrl=URL of the LFS store usage_LongFormat=Always output the long format usage_LsRemote=List references in a remote repository usage_lsRemoteHeads=Show only refs starting with refs/heads @@ -347,6 +352,7 @@ usage_resetReference=Reset to given reference name usage_resetHard=Resets the index and working tree usage_resetSoft=Resets without touching the index file nor the working tree usage_resetMixed=Resets the index but not the working tree +usage_runLfsStore=Run LFS Store in a given directory usage_setTheGitRepositoryToOperateOn=set the git repository to operate on usage_show=display one commit usage_showRefNamesMatchingCommits=Show ref names matching commits |