Skip to content

Implement an LFS repository format version #4533

Closed

Description

@bk2204

Currently, we assume that all LFS repositories look the same. However, there have been proposals to store Git LFS data differently, such as by compressing objects on disk to save space. Such a change would necessarily impede interoperability with older Git LFS versions.

The way that Git handles this is to set core.repositoryFormatVersion to a version number, and if it is not set, default to 0. If the version number is not known, then the repository is rejected. Presently, Git understands version 0, which is the original, and version 1, which is the same, but for a configuration options starting with extension.. If the repository is a v1 repository and any unknown extension is found, the repository is rejected as being in an unknown format.

I propose we adopt a config option, lfs.repositoryFormatVersion, that by default is 0 and that we write into the repository from v3.0.0 on. If we see a version number we don't support, we reject it. We can then adopt a v1 in a minor version in the future with appropriate rejection for extensions (e.g., lfs.repositoryExtensions.*).

Activity

  1. added this to the v3.0.0 milestone on Jun 18, 2021
  2. chrisd8088 commented on Jun 20, 2021

    @chrisd8088
    Member

    This seems eminently sensible to me. My only question is around the wording here, in that the point as I understand it would be for the Git LFS v1 format to accept known extensions; it would only be if a Git LFS v1-aware client saw an unrecognized extension in a v1-format repository that a rejection would occur. In other words, akin to Git's native behaviour, as you noted at the top of the issue.

  3. bk2204 commented on Jun 21, 2021

    @bk2204
    MemberAuthor

    Yes, we would reject any unknown extensions, but accept known ones, in v1 repositories. We would also not parse extensions in v0 repositories. Sorry for the confusing text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions