Skip to content

buffer: Expose git_buf_put() to bindings #2892

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

Closed
wants to merge 1 commit into from

Conversation

nulltoken
Copy link
Member

This should allow to more easily deal with filters from a binding standpoint.

In libgit2/libgit2sharp#854 and libgit2/libgit2sharp#946, filters invoke git_buf_set() to provide libgit2 with the result of the filtering.

Instead of calling git_buf_set() once, the idea would be to invoke git_buf_put() each time the binding callback outputs a chunk.

This should provide the bindings with a stream-like approach when doing filters (working at the chunk level) until libgit2 provides a real stream oriented API for filters.

Another side effect will be to smoothen the overall memory pressure.

@nulltoken
Copy link
Member Author

/cc @carlosmn @ammeep @dahlbyk

@carlosmn
Copy link
Member

As long as we have git_buf as the output of a filter, then this makes sense, as it lets you have a single large copy of the text.

/**
* Append to an existing buffer a copy of some raw data.
*
* @param buffer The buffer to set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/set/append to/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@ammeep
Copy link
Member

ammeep commented Feb 13, 2015

@nulltoken
Copy link
Member Author

Superseded by #2911

@nulltoken nulltoken closed this Feb 19, 2015
@ethomson ethomson deleted the ntk/expose_git_buf_put branch January 9, 2019 10:25
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.

3 participants