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

note: lazily get all information about notes. #958

Merged
merged 1 commit into from
Nov 30, 2019

Conversation

herrerog
Copy link
Contributor

Listing notes with below snippet of code could take a lot longer
than the equivalent git command: "git notes list".

import pygit2
repo = pygit2.Repository(".")
for note in repo.notes():
       print(note.id, note.annotated_id)

To avoid this, lazily call git_note_read() only when more information
about the note is needed or when the note id is not provided.

Listing notes with below snippet of code could take a lot longer
than the equivalent git command: "git notes list".
   import pygit2
   repo = pygit2.Repository(".")
   notes = []
   for note in repo.notes():
       print(note.id, note.annotated_id)

To avoid this, lazily call git_note_read() only when more information
about the note is needed or when the note id is not provided.

Signed-off-by: Gregory Herrero <gregory.herrero@oracle.com>
@jdavid jdavid merged commit 8058a01 into libgit2:master Nov 30, 2019
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 this pull request may close these issues.

None yet

2 participants