{"action":"created","issue":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/3385","labels_url":"https://api.github.com/repos/libgit2/libgit2/issues/3385/labels{/name}","comments_url":"https://api.github.com/repos/libgit2/libgit2/issues/3385/comments","events_url":"https://api.github.com/repos/libgit2/libgit2/issues/3385/events","html_url":"https://github.com/libgit2/libgit2/issues/3385","id":101233686,"number":3385,"title":"Use typedef git_error_code instead of int for return methods?","user":{"login":"xoofx","id":715038,"avatar_url":"https://avatars.githubusercontent.com/u/715038?v=3","gravatar_id":"","url":"https://api.github.com/users/xoofx","html_url":"https://github.com/xoofx","followers_url":"https://api.github.com/users/xoofx/followers","following_url":"https://api.github.com/users/xoofx/following{/other_user}","gists_url":"https://api.github.com/users/xoofx/gists{/gist_id}","starred_url":"https://api.github.com/users/xoofx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xoofx/subscriptions","organizations_url":"https://api.github.com/users/xoofx/orgs","repos_url":"https://api.github.com/users/xoofx/repos","events_url":"https://api.github.com/users/xoofx/events{/privacy}","received_events_url":"https://api.github.com/users/xoofx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-16T04:39:50Z","updated_at":"2015-08-18T15:05:32Z","closed_at":null,"body":"Hi there!\r\nThis is just a suggestion/question.\r\n\r\nWoud it be possible that all methods returning an error use a typed version like `typedef int git_error_code;`  instead of a plain int?\r\n\r\nI don't know enough about all the API, but maybe even an global enum would be possible?\r\n\r\nThis would be more practical for many purposes:\r\n- documentation\r\n- automatic interop for language directly from sourcecode: generating a wrapper of libgit2 could be done more automatically by detecting methods returning an error and add proper error handling.\r\n\r\nDo you think this is something that would cause trouble with the current API? (Apart from updating the code?)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/132242169","html_url":"https://github.com/libgit2/libgit2/issues/3385#issuecomment-132242169","issue_url":"https://api.github.com/repos/libgit2/libgit2/issues/3385","id":132242169,"user":{"login":"carlosmn","id":335443,"avatar_url":"https://avatars.githubusercontent.com/u/335443?v=3","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":false},"created_at":"2015-08-18T15:05:32Z","updated_at":"2015-08-18T15:05:32Z","body":"libgit2 is mostly based around I/O, so everything but basic acessor functions can result in all sorts of odd errors, and those accessors already don't have `int` as a return code, as we use `size_t` for offsets.\r\n\r\nI would be surprised if we have anything but a handful of functions which want to return an `int` but can't return an error, so we'd just be swapping one type for a much more verbose one which means the same."}}