8000 Alternates API · Issue #2621 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content
Alternates API #2621
Open
Open
@carlosmn

Description

@carlosmn

If a repository/odb has an alternates file, we follow it to grab objects from other repositories. But we don't have any way of interacting with it from a program.

It is "just" a newline-delimited list of paths in a file so we might not necessarily want to do too much in libgit2, but maybe it can be abstracted just enough so non-default backends can also make use of it.

So I was thinking of maybe having

git_odb_alternates_read(git_strarray*, git_odb *);
git_odb_alternates_write(git_odb *, git_strarray *);
git_odb_alternates_append(git_odb *, const char *);

with the appropriate additions to the odb backend interface, which should make implementing things like git clone --reference or --shared that much easier.

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

      0