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

Re: Bug: "git log --format='format:%+s%+b'" doesn't insert newline before body

From
ITIlya Tumaykin <itumaykin@gmail.com>
Date
Jul 25, 2016, 10:49 UTC
Message-ID
<2082892.BZVOcV7i8n@photon>
In-Reply-To
<alpine.DEB.2.20.1607251003360.14111@virtualbox>
On Monday 25 July 2016 10:06:28 Johannes Schindelin wrote:
Show 24 quoted lines
> Hi Ilya,
> 
> On Mon, 25 Jul 2016, Ilya Tumaykin wrote:
> > On Monday 25 July 2016 09:33:00 Johannes Schindelin wrote:
> > > On Sun, 24 Jul 2016, Ilya Tumaykin wrote:
> > > [...]
> > > 
> > > > $ git --no-pager log -1 --format='format:%+s%+b'
> > > > 
> > > > Actual results:
> > > > ```
> > > > 
> > > > This is subject
> > > > And this is body
> > > > ```
> > 
> > According to 'git-log' man page '%+b' should insert linefeed "immediately
> > before the expansion if and only if the placeholder expands to a non-empty
> > string." Here "%b" expands to a non-empty string, thus I expect a linefeed
> > before it. Or am I misinterpreting man page somehow?
> 
> The line break is there: after the subject. The misinterpretation is most
> likely the assumption that the new-line "character" is part of the commit
> subject; It is not.
I see. Thank you very much for the explanation. This does help me.
-- 
Best regards.
Ilya Tumaykin.
Previous: Johannes SchindelinNext: Jakub Narębski
Message 6 of 7 in “Bug: "git log --format='format:%+s%+b'" doesn't insert newline before body”
  1. Ilya TumaykinJul 24, 2016
  2. Beat BolliJul 25, 2016
  3. Johannes SchindelinJul 25, 2016
  4. Ilya TumaykinJul 25, 2016
  5. Johannes SchindelinJul 25, 2016
  6. Ilya TumaykinJul 25, 2016
  7. Jakub NarębskiJul 25, 2016

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.