Skip to content

Support for shallow repositories #3058

@carlosmn

Description

@carlosmn

git can write a file .git/shallow to indicate that the history is cut off at particular commits. We currently do not read this at all and thus libgit2 will regularly fail to work on these repositories with error messages about failing to find objects.

The typicall way such a repository is created is by the use of git clone --depth N. We do not support this option to clone either, as we do not support the depth negotiation in the protocol.

In order to provide support we would have to make sure to check against the list in .git/shallow whether we're at the end of the history we should expect to be at, and then not try to walk further back or ignore errors when looking up parents.

There are a couple of issues which ask questions about this, I will close them and redirect them here to have a cleaner position from which to start.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions