{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/2621","repository_url":"https://api.github.com/repos/libgit2/libgit2","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/2621/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/2621/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/2621/events","html_url":"https://github.com/libgit2/libgit2/issues/2621","id":45973121,"number":2621,"title":"Alternates API","user":{"login":"carlosmn","id":335443,"avatar_url":"https://avatars0.githubusercontent.com/u/335443?v=4","gravatar_id":"","url":"https://api.github.com/users/carlosmn","html_url":"https://github.com/carlosmn","followers_url":"https://api.github.com/users/carlosmn/followers","following_url":"https://api.github.com/users/carlosmn/following{/other_user}","gists_url":"https://api.github.com/users/carlosmn/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosmn/subscriptions","organizations_url":"https://api.github.com/users/carlosmn/orgs","repos_url":"https://api.github.com/users/carlosmn/repos","events_url":"https://api.github.com/users/carlosmn/events{/privacy}","received_events_url":"https://api.github.com/users/carlosmn/received_events","type":"User","site_admin":true},"labels":[{"id":98977,"url":"https://api.github.com/repos/libgit2/libgit2/labels/todo","name":"todo","color":"0b02e1","default":false},{"id":141264967,"url":"https://api.github.com/repos/libgit2/libgit2/labels/up%20for%20grabs","name":"up for grabs","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2014-10-16T11:01:29Z","updated_at":"2018-03-27T11:15:14Z","closed_at":null,"author_association":"OWNER","body":"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.\n\nIt 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.\n\nSo I was thinking of maybe having\n\n``` C\ngit_odb_alternates_read(git_strarray*, git_odb *);\ngit_odb_alternates_write(git_odb *, git_strarray *);\ngit_odb_alternates_append(git_odb *, const char *);\n```\n\nwith the appropriate additions to the odb backend interface, which should make implementing things like `git clone --reference` or `--shared` that much easier.\n"},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/376487682","html_url":"https://github.com/libgit2/libgit2/issues/2621#issuecomment-376487682","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/2621","id":376487682,"user":{"login":"ethomson","id":1130014,"avatar_url":"https://avatars1.githubusercontent.com/u/1130014?v=4","gravatar_id":"","url":"https://api.github.com/users/ethomson","html_url":"https://github.com/ethomson","followers_url":"https://api.github.com/users/ethomson/followers","following_url":"https://api.github.com/users/ethomson/following{/other_user}","gists_url":"https://api.github.com/users/ethomson/gists{/gist_id}","starred_url":"https://api.github.com/users/ethomson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethomson/subscriptions","organizations_url":"https://api.github.com/users/ethomson/orgs","repos_url":"https://api.github.com/users/ethomson/repos","events_url":"https://api.github.com/users/ethomson/events{/privacy}","received_events_url":"https://api.github.com/users/ethomson/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T11:15:14Z","updated_at":"2018-03-27T11:15:14Z","author_association":"OWNER","body":"Yeah, I think I agree.  I don't think that it makes much sense to have this on the ODB layer (at least to match git semantics).  Alternates are queried before looking at _any_ of our ODBs.  This makes it seem like it's an alternate to _an_ ODB, when alternates are really an alternative to _all our_ ODBs."}}
{"actor":{"display_login":"ethomson"}}