git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Git Mailing List <git@vger.kernel.org>,
	Johannes Gilger <heipei@hackvalue.de>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/3] print_wrapped_text(): allow hard newlines
Date: Wed, 23 Sep 2009 17:00:58 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0909231659010.3303@localhost.localdomain> (raw)
In-Reply-To: <alpine.DEB.1.00.0909232232560.4985@pacific.mpi-cbg.de>



On Wed, 23 Sep 2009, Johannes Schindelin wrote:
> 
> 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.

May I suggest doing this _only_ if the newline is followed by an 
alphanumeric characer?

If the thing is indented ("newline + space") or quoted ("newline + ">" or 
whatever) then reflowing it is likely wrong and will result in an unholy 
mess.

			Linus

  parent reply	other threads:[~2009-09-24  0:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 22:47 [PATCH] git-log --format: Add %B tag with %B(x) option Johannes Gilger
2009-09-17 23:27 ` Junio C Hamano
2009-09-18 18:00   ` [PATCHv2] " Johannes Gilger
2009-09-18 19:12     ` Junio C Hamano
2009-09-19  9:58       ` [PATCHv3] " Johannes Gilger
2009-09-22 19:41         ` Junio C Hamano
2009-09-22 21:30           ` [PATCHv4] git-log --format: Add %B tag with %B(n) option Johannes Gilger
2009-09-23 20:34             ` [PATCH 0/3] Add a pretty format to rewrapping/indenting commit messages Johannes Schindelin
2009-09-23 20:34               ` [PATCH 1/3] print_wrapped_text(): allow hard newlines Johannes Schindelin
2009-09-23 20:34                 ` [PATCH 2/3] Add strbuf_add_wrapped_text() to utf8.[ch] Johannes Schindelin
2009-09-23 20:34                   ` [PATCH 3/3] Add "%w" to pretty formats, which rewraps the commit message Johannes Schindelin
2009-09-23 21:00                     ` Johannes Gilger
2009-09-23 23:19                       ` Junio C Hamano
2009-10-05  6:25                         ` Junio C Hamano
2009-09-24  0:00                 ` Linus Torvalds [this message]
2009-09-24  0:19                   ` [PATCH 1/3] print_wrapped_text(): allow hard newlines Johannes Schindelin
2009-09-25  8:21                   ` Johannes Schindelin
2009-10-10  0:57             ` [PATCHv4] git-log --format: Add %B tag with %B(n) option Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0909231659010.3303@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=heipei@hackvalue.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).