-
-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tree navigation: return objects #924
Comments
With commit @0d79ad8 now the Next will be to remove the |
Sorry, missed this in the post-baby-leave email swamps. This is great! I guess question is how to deal with compatibility? The #903 stuff isn't in a release, so there's a few options:
Personally I'd prefer (3) or (1), but I've only just started using pygit2 so I don't need to do a massive rewrite of old code ;) |
I would declare If we can make objects largely compatible with PD: When the user is only interested in the tree-entry information, loading the object would be sub-optimal. Sometime in the future we may add lazy loading of the object to address this. |
I'm working on this, in progress.. |
Sounds reasonable. Maybe make TreeEntry a parent or mixin class so is-a relationships still work; or implementation-wise, where name/filemode come from? If I get a Tree by ID, I presume name/filemode aren't populated? Because the same tree can appear multiple places, right?
In this example my understanding is that |
Right now I think the next release will be 1.0.0, there will be some small breaking changes, so I won't bother to keep the Yes, the filemode/name come from There're several ways to do comparison, we'll use comparison by id, so they will be the same tree. |
merged |
@rcoup
Follow up from #903 (comment)
To avoid the reference from
TreeEntry
to the repository, the/
operator could return an object instead of aTreeEntry
.Then this example from PR #903
Would become:
It's slightly shorter and in my opinion more intuitive. Just tried with GitPython and apparently it behaves this way.
The text was updated successfully, but these errors were encountered: