Repository navigation
LFS repository format version - #4552
Merged
Merged
Conversation
bk2204
force-pushed
the
repo-format-version
branch
from
July 19, 2021 20:45
3353d3a to
b6cf6f8
Compare
bk2204
marked this pull request as ready for review
July 20, 2021 20:26
The smudge, clean, and filter-process commands all operate on the contents of the repository, since they all expect to read or write files into the LFS store in the repository. As a result, let's call setupRepository to verify that we are, in fact, in a repository and if not, produce an error message.
We've had several proposals to change how data is stored on disk, such as by compressing files when stored inside the .git directory. Unfortunately, those proposals are incompatible with how data is stored now and we would likely break older clients if we implemented them. To make it possible for us to implement them in the future, let's do what Git does and add support for a repository format version. We read the configuration option lfs.repositoryFormatVersion from the local configuration, and if it is nonzero, we exit with an error. We also assume that if the value is not set, then it is implicitly 0 and set it if possible. We ignore any errors when writing to allow working with read-only repositories in the limited circumstances where that can be valuable. The plan in the future is to support repository format v1, which, like Git's, will be the same but for a set of lfs.repositoryextension.* keys which denote extensions. Such extensions will be ignored in v0, but will be mandatory to understand in v1; unknown keys will cause Git LFS to abort. The implementation of this functionality is left to the future, however.
bk2204
force-pushed
the
repo-format-version
branch
from
July 21, 2021 13:29
b6cf6f8 to
6b5f740
Compare
chrisd8088
approved these changes
Jul 21, 2021
| git config --local lfs.repositoryFormatVersion 1 | ||
|
|
||
| git lfs track '*.bin' >output 2>&1 && exit 1 | ||
| cat output |
Member
There was a problem hiding this comment.
I'm guessing the cat is here in case of test failure, so it's a bit easier to debug what went wrong -- similar to the one in t/t-locks.sh discussed in #4446 (comment).
Member
Author
There was a problem hiding this comment.
Yes, that's exactly the case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We've had several proposals to change how data is stored on disk, such as by compressing files when stored inside the .git directory. Unfortunately, those proposals are incompatible with how data is stored now and we would likely break older clients if we implemented them.
To make it possible for us to implement them in the future, let's do what Git does and add support for a repository format version. We read the configuration option
lfs.repositoryFormatVersionfrom the local configuration, and if it is nonzero, we exit with an error. We also assume that if the value is not set, then it is implicitly 0 and set it if possible. We ignore any errors when writing to allow working with read-only repositories in the limited circumstances where that can be valuable.The plan in the future is to support repository format v1, which, like Git's, will be the same but for a set of
lfs.repositoryextension.*keys which denote extensions. Such extensions will be ignored in v0, but will be mandatory to understand in v1; unknown keys will cause Git LFS to abort. The implementation of this functionality is left to the future, however.In addition, make sure we set up the repositories where appropriate so that all major subsystems set the proper value.
Fixes #4533