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

Re: [PATCH 3/3] pretty: support multiline subjects with format:

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Dec 28, 2008, 00:12 UTC
Message-ID
<4956C47B.4020602@lsrfire.ath.cx>
In-Reply-To
<200812280024.59096.markus.heidelberg@web.de>
Markus Heidelberg schrieb:
Show 13 quoted lines
>> git log --pretty=format:%s (and tformat:) used to display the first
>> line of the subject, unlike the other --pretty options, which would
>> construct a subject line from all lines of the first paragraph of
>> the commit message.
> 
> And that can be very annoying when working on repositories with a
> history not formatted after the recommendations of git (empty line after
> the summary). Then the output of commands like
> "git log --pretty=oneline", "git format-patch" and "git show-branch"
> is unreadable.
> 
> Sorry, I haven't tested your patch set, what is the output of
> git-shortlog like now?
It's unchanged since it has it's own commit message parser.
Show 7 quoted lines
>> For consistency and increased code reuse, change format: to do the
>> same as the other options.
> 
> What's wrong with using the first line instead of the first paragraph
> for the other pretty options and for cases where only a small subject
> line is desired? A sentence would be broken into a small uncomplete part
> for the subject for example. What else?

I'm inching towards the goal of being able to replicate all of the other --pretty flavours with format: (or tformat:) strings.

--pretty=oneline used to print only the first line, but was changed to the way it's now in 4234a761 more than a year ago. In my mind, "subject" is defined by "what oneline is printing", so I think changing the format: placeholder %s to show the whole first paragraph is a bug fix.

If you actually like the old behaviour then perhaps a new placeholder (%S ?) should be introduced instead?

René
Previous: Markus HeidelbergNext: Markus Heidelberg
Message 8 of 15 in “pretty: factor out skip_empty_lines()”
  1. 1/3 pretty: factor out skip_empty_lines()René Scharfe, Dec 27, 2008
  2. 2/3 pretty: factor out format_subject()René Scharfe, Dec 27, 2008
  3. 3/3 pretty: support multiline subjects with format:René Scharfe, Dec 27, 2008
  4. Markus HeidelbergDec 27, 2008
  5. Nanako ShiraishiDec 28, 2008
  6. Miklos VajnaDec 28, 2008
  7. Markus HeidelbergDec 28, 2008
  8. René ScharfeDec 28, 2008
  9. Markus HeidelbergDec 28, 2008
  10. René ScharfeDec 29, 2008
  11. Junio C HamanoJan 4, 2009
  12. 4/3 shortlog: handle multi-line subjects like log --pretty=oneline et. al. doRené Scharfe, Jan 6, 2009
  13. Junio C HamanoJan 7, 2009
  14. Junio C HamanoDec 28, 2008
  15. Markus HeidelbergDec 28, 2008

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.