Skip to content
Commits on Oct 19, 2009
  1. @dscho @gitster

    Add strbuf_add_wrapped_text() to utf8.[ch]

    dscho committed with gitster Nov 10, 2008
    The newly added function can rewrap text according to a given first-line
    indent, other-indent and text width.
    Signed-off-by: Johannes Schindelin <>
  2. @dscho @gitster

    print_wrapped_text(): allow hard newlines

    dscho committed with gitster Nov 11, 2007
    print_wrapped_text() will insert its own newlines. Up until now, if the
    text passed to it contained newlines, they would not be handled properly
    (the wrapping got confused after that).
    The strategy is to replace a single new-line with a space, but keep double
    new-lines so that already-wrapped text with empty lines between paragraphs
    will be handled properly.
    However, single new-line characters are only handled this way if the
    character after it is an alphanumeric character, as per Linus' suggestion.
    Signed-off-by: Johannes Schindelin <>
Commits on Mar 2, 2007
  1. @dscho

    print_wrapped_text: fix output for negative indent

    dscho committed with Junio C Hamano Mar 2, 2007
    When providing a negative indent, it means that -indent columns were
    already printed. Fix a bug where the function ate the first character
    if already the first word did not fit into the first line.
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on Feb 28, 2007
  1. @dscho

    Actually make print_wrapped_text() useful

    dscho committed with Junio C Hamano Feb 27, 2007
    Now, it returns the current column, does not add a newline, and you can
    pass a negative indent, to indicate that the indent was already printed.
    With this, you can actually continue in the middle of a paragraph, not
    having to print everything into a buffer first.
    Signed-off-by: Johannes Schindelin <>
    Signed-off-by: Junio C Hamano <>
Commits on Dec 24, 2006
  1. @dscho

    commit-tree: encourage UTF-8 commit messages.

    dscho committed with Junio C Hamano Dec 22, 2006
    Introduce is_utf() to check if a text looks like it is encoded
    in UTF-8, utf8_width() to count display width, and implements
    print_wrapped_text() using them.
    git-commit-tree warns if the commit message does not minimally
    conform to the UTF-8 encoding when i18n.commitencoding is either
    unset, or set to "utf-8".
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.