From 7f260e5a8a1c17c4f186d8c5ad7d3dbb3423c7af Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Fri, 10 Apr 2015 14:25:47 +0100 Subject: [PATCH] Spec: clarify that filepath sharding is used in .git/lfs/objects/ I'd only read the LFS spec, and not the code - thanks to @mhagger for setting me straight last night at the Git Birthday Party! The support I'm trying to put into the BFG has to put files in the same place as the Git LFS client, obviously - I got it [wrong](https://github.com/rtyley/bfg-repo-cleaner/blob/git-lfs-alpha/bfg-library/src/main/scala/com/madgag/git/bfg/cleaner/LfsBlobConverter.scala#L78) because I didn't check the implementation: https://github.com/github/git-lfs/blob/a0d389385/lfs/lfs.go#L44 https://github.com/github/git-lfs/blob/a0d389385/commands/smudge_test.go#L54-L55 --- docs/spec.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/spec.md b/docs/spec.md index 15ed6b2a..e6ac3354 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -87,13 +87,15 @@ to Git as STDOUT. * Stream binary content from STDIN to a temp file, while calculating its SHA-256 signature. -* Check for the file at `.git/lfs/objects/{OID}`. +* Check for the file at `.git/lfs/objects/{OID-PATH}`. * If it does not exist: * Queue the OID to be uploaded. - * Move the temp file to `.git/lfs/objects/{OID}`. + * Move the temp file to `.git/lfs/objects/{OID-PATH}`. * Delete the temp file. * Write the pointer file to STDOUT. +`{OID-PATH}` is a sharded filepath of the form `OID[0:2]/OID[2:4]/OID`. + Note that the `clean` filter does not push the file to the server. Use the `git lfs sync` command to do that. @@ -103,7 +105,7 @@ expects the content to write to the working directory as STDOUT. * Read 100 bytes. * If the content is ASCII and matches the pointer file format: - * Look for the file in `.git/lfs/objects/{OID}`. + * Look for the file in `.git/lfs/objects/{OID-PATH}`. * If it's not there, download it from the server. * Read its contents to STDOUT * Otherwise, simply pass the STDIN out through STDOUT.