libgit2 / libgit2

A cross-platform, linkable library implementation of Git that you can use in your application.
https://libgit2.org/
Other
9.7k stars 2.41k forks source link

git_tree_walk API review #1172

Closed matiaslina closed 11 years ago

matiaslina commented 11 years ago

I have found that the api of git_tree_walk is in disorder.

Here's what says on the api.

int git_tree_walk(git_tree *tree, git_treewalk_cb callback, int mode, void *payload);

And this is what says on the tree.h

GIT_EXTERN(int) git_tree_walk( const git_tree *tree, git_treewalk_mode mode, git_treewalk_cb callback, void *payload);

Regards

txdv commented 11 years ago

post links where it says it

matiaslina commented 11 years ago

first one here:

http://libgit2.github.com/libgit2/#HEAD/group/tree/git_tree_walk

second one right here:

https://github.com/libgit2/libgit2/blob/HEAD/include/git2/tree.h#L378

scunz commented 11 years ago

There is no automatic system that updates the api documentation. It is updated manually from time to time. I think that most of the time, @carlosmn takes care of that. Though there were many API changes recently as libgit2 is slowly heading toward a 1.0 release and it's winter holidays ...

arrbee commented 11 years ago

I believe the documentation is correct for the last official release version (v0.17.0). As @scunz indicates, we have changed the API for the upcoming 1.0 release, but those changes are only present in the "development" branch. We will regenerate the docs when the new release goes out. Sorry for the confusion!

By the way, the rationale for changing the API signature is (a) use const as much as possible and (b) standardize argument order and naming, especially for functions like this that take a callback and payload. Our intent is that the high-level language bindings will all be adjusted for the API changes in coordination with the 1.0 release so hopefully this will not break most user's applications.

carlosmn commented 11 years ago

Russell Belfer notifications@github.com writes:

I believe the documentation is correct for the last official release version (v0.17.0). As @scunz indicates, we have changed the API for

It's not so much about the latest release, but when I last rebuilt and pushed the documentation.

I've pushed up a new version, which should be available on the site in a few minutes.

cmn