git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)

From
JSJan H. Schönherr <schnhrr@cs.tu-berlin.de>
Date
Dec 11, 2012, 10:24 UTC
Message-ID
<50C709EC.50102@cs.tu-berlin.de>
In-Reply-To
<1355205562-23459-2-git-send-email-prohaska@zib.de>
Am 11.12.2012 06:59, schrieb Steffen Prohaska:
Show 5 quoted lines
> 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

Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 5 of 6 in “shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)”
  1. shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)Steffen Prohaska, Dec 8, 2012
  2. Junio C HamanoDec 9, 2012
  3. 0/2 Re: [PATCH] shortlog: Fix wrapping lines of wraplenSteffen Prohaska, Dec 11, 2012
  4. 1/2 shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)Steffen Prohaska, Dec 11, 2012
  5. Jan H. SchönherrDec 11, 2012
  6. 2/2 strbuf_add_wrapped*(): Remove unused return valueSteffen Prohaska, Dec 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.