Skip to content

nested expansion

Junio C Hamano git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 0 repliesNew

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3strbuf_nested_expand(): allow expansion to interrupt in the middlepretty.c strbuf.c strbuf.h+27 -110 replies
2/3Add %[wrap(width,in1,in2)<<any-string>>%] implementationpretty.c+76 -00 replies
3/3Teach --wrap to only indent without wrappingutf8.c+13 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] nested expansion

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(-)