Add bindings for git_graph_* methods #173

Merged
AaronO merged 2 commits from add/graph-methods into master 2015-02-13 01:45:14 -06:00
AaronO commented 2015-02-11 05:55:53 -06:00 (Migrated from github.com)

This adds support for git_graph_ahead_behind and git_graph_descendant_of respectively wrapped as Repository.GraphAheadBehind and Repository.GraphDescendantOf.

This adds support for `git_graph_ahead_behind` and `git_graph_descendant_of` respectively wrapped as `Repository.GraphAheadBehind` and `Repository.GraphDescendantOf`.
carlosmn commented 2015-02-12 04:56:27 -06:00 (Migrated from github.com)

I think we could do without the "Graph" prefix. Repository.AheadBehind() etc does not loose any information.

I think we could do without the "Graph" prefix. `Repository.AheadBehind()` etc does not loose any information.
AaronO commented 2015-02-12 05:04:07 -06:00 (Migrated from github.com)

@carlosmn I considered that, but I ended up thinking that it was probably best to stick to libgit2's naming convention to avoid any confusion.

For example: https://github.com/libgit2/libgit2/issues/1440, there was a discussion about implementing git_ahead_behind that returns a list of commits instead of a number, etc ...

If the prefix is unnecessary/redundant, shouldn't the decision to strip it be made at the libgit2 level and git2go should reflect whatever happens there ?

Either way, I can strip the prefix if you think that's best.

Edit: I'm mistaken, they were suggesting to keep the git_graph_ahead_behind name

@carlosmn I considered that, but I ended up thinking that it was probably best to stick to `libgit2`'s naming convention to avoid any confusion. For example: https://github.com/libgit2/libgit2/issues/1440, there was a discussion about implementing `git_ahead_behind` that returns a list of commits instead of a number, etc ... If the prefix is unnecessary/redundant, shouldn't the decision to strip it be made at the `libgit2` level and `git2go` should reflect whatever happens there ? Either way, I can strip the prefix if you think that's best. **Edit:** I'm mistaken, they were suggesting to keep the `git_graph_ahead_behind` name
AaronO commented 2015-02-12 11:50:23 -06:00 (Migrated from github.com)

@carlosmn Voila, I removed the Graph prefix.

@carlosmn Voila, I removed the `Graph` prefix.
carlosmn commented 2015-02-13 01:44:57 -06:00 (Migrated from github.com)

ahead-behind (or left-right in git parlance) isn't a first-class object. It's a question you ask of a pair of commits, so it doesn't get its own namespace. It doesn't fit in the git_repository namespace because it's not about the repository, so it was shoved to "graph".

But in OO syntax, the receiver is the thing you take as source or destination of data, so in the other bindings, it's gone directly there.

ahead-behind (or left-right in git parlance) isn't a first-class object. It's a question you ask of a pair of commits, so it doesn't get its own namespace. It doesn't fit in the `git_repository` namespace because it's not _about_ the repository, so it was shoved to "graph". But in OO syntax, the receiver is the thing you take as source or destination of data, so in the other bindings, it's gone directly there.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#173
No description provided.