git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/4] streaming conversion API

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2011, 06:58 UTC
Message-ID
<1305961127-26540-1-git-send-email-gitster@pobox.com>

This builds on top of jc/streaming topic, in which I earlier hinted that a filtering mechanism that does not need to slurp everything in core can later be plugged into the git_istream API. This topioc does exactly that.

The first patch moves declarations related to conversion from cache.h to its own convert.h header file, so that new streaming conversion API can be added to it without bloating cache.h even more.

The second patch defines the streaming filter API, adds a pass-through "null" filter, plugs the streaming filter API to the git_istream API and updates the write out codepath to use it. The design of this API is an object-oriented one that is similar to the istream API. The user of the git_istream API first grabs "stream_filter" object based on the path, and passes that filter object when creating a git_istream. The data read from the underlying object is fed to the filter, and the output from the filter is returned to the caller of the read_istream().

The third patch adds a non-guessing LF-to-CRLF streaming filter.

The fourth patch implements the ident filter. As both LF-to-CRLF and ident filters can be active at the same time, it also introduces the "cascade" mechanism that takes two filters, plugs one's output to the other's input, and feeds the former and returns what is read from the latter.

I suspect that "smudge" filter should be relatively easy to add and combine with the existing filters using the same cascade mechanism, but I'll leave it as an exercise to interested readers.

Junio C Hamano (4):
  convert.h: move declarations for conversion from cache.h
  Add streaming filter API
  Add LF-to-CRLF streaming conversion
  streaming filter: ident filter and filter cascading
 cache.h     |   38 +------
 convert.c   |  363 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 convert.h   |   65 +++++++++++
 entry.c     |   16 ++-
 streaming.c |  100 ++++++++++++++++-
 streaming.h |    2 +-
 6 files changed, 530 insertions(+), 54 deletions(-)
 create mode 100644 convert.h
-- 
1.7.5.2.369.g8fc017
Next: Junio C Hamano
Message 1 of 12 in “streaming conversion API”
  1. 0/4 streaming conversion APIJunio C Hamano, May 21, 2011
  2. convert.h: move declarations for conversion from cache.hJunio C Hamano, May 21, 2011
  3. 2/4 Add streaming filter APIJunio C Hamano, May 21, 2011
  4. 3/4 Add LF-to-CRLF streaming conversionJunio C Hamano, May 21, 2011
  5. 4/4 streaming filter: ident filter and filter cascadingJunio C Hamano, May 21, 2011
  6. René ScharfeMay 21, 2011
  7. René ScharfeMay 21, 2011
  8. Junio C HamanoMay 25, 2011
  9. t0021: test application of both crlf and identJunio C Hamano, May 25, 2011
  10. streaming: filter cascadingJunio C Hamano, May 25, 2011
  11. René ScharfeMay 21, 2011
  12. Junio C HamanoMay 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.