From: "\"Jan H. Schönherr\"" <schnhrr@cs.tu-berlin.de>
To: Steffen Prohaska <prohaska@zib.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)
Date: Tue, 11 Dec 2012 11:24:44 +0100 [thread overview]
Message-ID: <50C709EC.50102@cs.tu-berlin.de> (raw)
In-Reply-To: <1355205562-23459-2-git-send-email-prohaska@zib.de>
Am 11.12.2012 06:59, schrieb Steffen Prohaska:
> A recent commit [1] fixed a off-by-one wrapping error. As
> a side-effect, the conditional in add_wrapped_shortlog_msg() whether to
> append a newline needs to be removed. add_wrapped_shortlog_msg() should
> always append a newline, which was the case before the off-by-one fix,
> because strbuf_add_wrapped_text() never returned a value of wraplen.
I agree with this explanation, although there exists a case where wraplen
(or wraplen+1 after the off-by-one fix) is returned: This happens
when there is not a single space within the string and it has just the
correct length. But also in this case, the newline must be added to get
a correctly formatted output. So your patch is good as it is. :)
But I still wonder about the original motivation for the removed
conditional. It looks like, it wasn't even needed in the very first
version (3714e7c8)?! (And it wasn't present in the version on the mailing
list: http://article.gmane.org/gmane.comp.version-control.git/35221)
Regards
Jan
next prev parent reply other threads:[~2012-12-11 10:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-08 19:09 [PATCH] shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix) Steffen Prohaska
2012-12-09 9:36 ` [PATCH] shortlog: Fix wrapping lines of wraplen Junio C Hamano
2012-12-11 5:59 ` [PATCH 0/2] " Steffen Prohaska
2012-12-11 5:59 ` [PATCH 1/2] shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix) Steffen Prohaska
2012-12-11 10:24 ` "Jan H. Schönherr" [this message]
2012-12-11 5:59 ` [PATCH 2/2] strbuf_add_wrapped*(): Remove unused return value Steffen Prohaska
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=50C709EC.50102@cs.tu-berlin.de \
--to=schnhrr@cs.tu-berlin.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=prohaska@zib.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).