Git development
 help / color / mirror / Atom feed
From: Tanga Joris <tangajoris@gmail.com>
To: andy.koppe@gmail.com
Cc: git@vger.kernel.org, l.s.r@web.de, Johannes.Schindelin@gmx.de
Subject: Re: [PATCH v2] pretty: fix lost indent after newline in %w()
Date: Sun, 22 Nov 2026 01:42:39 +0300	[thread overview]
Message-ID: <20261121224239.161239-1-tangajoris@gmail.com> (raw)
In-Reply-To: <20261017081150.2295695-1-andy.koppe@gmail.com>

Hello Andy,

Thanks for the patch. I tried it and "- foo" followed by an indented
line now keeps both spaces.

> +						space++;
>  						goto new_line;

When I took this space++ out, no test failed, but a paragraph after a
blank line then starts with an extra space: "%w(20)aa%n%nbb" gives
" bb" instead of "bb". Maybe a test like this would help:

	test_expect_success 'format %w keeps a paragraph break' '
		printf "aa\n\nbb\n" >expect &&
		git log -1 --format="%w(20)aa%n%nbb" >actual &&
		test_cmp expect actual
	'

> +	    Newlines that are followed by an ASCII letter or digit are replaced
> +	    by spaces to reflow paragraphs. Existing indentation is kept.

This only happens when wrapping is on. With a width of 0, like
%w(0,2,2), the newlines are kept as they are. Maybe "When wrapping,
newlines that are followed by ..."?

Otherwise it looks good to me.

Thanks,
Tanga

      reply	other threads:[~2026-11-21 22:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 17:23 [PATCH] pretty: fix lost indent after newline in %w() Andy Koppe
2026-10-15 20:11 ` Andy Koppe
2026-10-15 20:42 ` René Scharfe
2026-10-15 20:59   ` Junio C Hamano
2026-10-17  8:26   ` Andy Koppe
2026-10-17  8:11 ` [PATCH v2] " Andy Koppe
2026-11-21 22:42   ` Tanga Joris [this message]

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=20261121224239.161239-1-tangajoris@gmail.com \
    --to=tangajoris@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=andy.koppe@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.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