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

[PATCH v2 0/3] nested expansion

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 19, 2009, 07:30 UTC
Message-ID
<1255937414-10043-1-git-send-email-gitster@pobox.com>

This is a re-roll of the earlier "general syntax for applying functions to pretty-print format output" series, rebased on two patches from Dscho to implement strbuf_add_wrapped_text(). In other words, this will apply on top of b4d784c (Add strbuf_add_wrapped_text() to utf8.[ch], 2008-11-10).

The first one is almost the same, except that it drops the unnecessary cast (pointed out by Dscho) and instead changes the type of return value from expand callback to ssize_t.

The second one has two changes:
 1. w() is renamed to wrap();
 2. it actually rewraps the text by using Dscho's strbuf_add_wrapped_text().

The third one is new. It teaches wrap() to just indent without wrapping when the width parameter is zero or negative.

Junio C Hamano (3):
  strbuf_nested_expand(): allow expansion to interrupt in the middle
  Add %[wrap(width,in1,in2)<<any-string>>%] implementation
  Teach --wrap to only indent without wrapping
 pretty.c |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 strbuf.c |   29 +++++++++++++++++-----
 strbuf.h |    5 ++-
 utf8.c   |   13 ++++++++++
 4 files changed, 115 insertions(+), 11 deletions(-)
Next: Junio C Hamano
Message 1 of 4 in “nested expansion”
  1. 0/3 nested expansionJunio C Hamano, Oct 19, 2009
  2. 1/3 strbuf_nested_expand(): allow expansion to interrupt in the middleJunio C Hamano, Oct 19, 2009
  3. 2/3 Add %[wrap(width,in1,in2)<<any-string>>%] implementationJunio C Hamano, Oct 19, 2009
  4. 3/3 Teach --wrap to only indent without wrappingJunio C Hamano, Oct 19, 2009

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.