Skip to content
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

generator implementation issue with libgit2 #183

Closed
cholin opened this issue Mar 3, 2013 · 4 comments · Fixed by #312
Closed

generator implementation issue with libgit2 #183

cholin opened this issue Mar 3, 2013 · 4 comments · Fixed by #312

Comments

@cholin
Copy link

cholin commented Mar 3, 2013

As you may have noticed there are some problems to implement a python generator with these *_foreach iterators of libgit2. I've opened an issue libgit2/libgit2#1384 for that. I'll let this issue open to collect some problematic _foreach functions. For the moment there are:

  • git_references_foreach
  • git_note_foreach

Diff seems to support as well some old fashioned way of iterating (not callback based). I'll look into that.

@richo
Copy link
Contributor

richo commented Mar 3, 2013

I had a crack at this when I did git_object_foreach.

Currently I'm building a list because I could get it out quickly, and I needed the functionality, but python does support the iter protocol which does what's needed here. The code got pretty hairy reasonably quick but I'm happy to have another stab at it.

This was referenced Mar 4, 2013
@cholin
Copy link
Author

cholin commented Mar 10, 2013

git_config_foreach seems problematic as well. Unfortunately it's the only way of iterating config entries and to extending it will be much more work than for notes.

@arrbee
Copy link
Member

arrbee commented Mar 11, 2013

@cholin I peeked at creating a callback-free version of the config API and (as you probably noticed) it will require changes all the way into the config storage backend abstraction, I fear. If you are interested in pursuing it, I'd open an issue on libgit2/libgit2 and specifically cc @ethomson to ask his thoughts on API changes for the config storage backend object. One potential nice thing is that if we replace the existing foreach() callback with a simpler enumeration API, things like the pattern matching behavior could possibly be moved into common code instead of having to be supported by each backend implementation.

@cholin
Copy link
Author

cholin commented Mar 11, 2013

I wanted to get a closer look at this in the next days. I already talked to @carlosmn about git_config (and the default backend). Would be great if you can open an issue for that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants