libgit2/libgit2 — pull request #1618 by yorah (2013-05-29 16:49:57+00:00)
Title: WIP - Open up the API to custom filters

While trying to implement an API to allow streaming filtered content from blobs (#1264), I realized my life would be a lot more easier if I could add custom filters to cover all test cases (e.g.: filters that remove some content, filters that add some, combinations of both when applying several filters, ...).

This PR is an attempt at that: opening up the filters API.

Tasks:
- [x] Rework the `struct git_filter` definition so that it can be EXTERNed. `git_filter` is now just the *definiton* of a filter (i.e.: when should the filter be applied and what is the filtering logic).
- [x] Make it so that a `git_repository` contains a `git_vector` of `git_filter`s.
- [x] Make it so that the current only existing filter (crlf) goes through this new logic
- [ ] Add functions to allow adding (removing?) filters to a repository
- [ ] Add tests with custom filters

This is currently a WIP, but I would appreciate some feedback (to know for example if I should just abandon this idea :wink:)!