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

git log --pretty=format joins lines in the subject of commit message

From
Kirill Likhodedov <kirill.likhodedov@jetbrains.com>
Date
Sep 15, 2010, 12:55 UTC
Message-ID
<DDB24DEE-934B-4C8D-8DAA-595905035AC4@jetbrains.com>
Commit something to a git repository with a commit message with several newlines like this:

==== commit message starts below === first line second line third line

fifth line === commit message ends above ===

Git treats the first 3 lines as commit message subject and the last line as its body.
'git log' shows the commit message correctly - exactly like I've entered. So does 'git log --pretty=raw'

But 'git log --pretty=format:%s#%b' joins the first three lines: first line second line third line#fifth line

Is it a bug or a feature? If it is a feature how can I acquire the original subject of the commit message by using custom format?

Thanks a lot.

---------------------------------- Kirill Likhodedov JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"

Next: Ævar Arnfjörð Bjarmason
Message 1 of 7 in “git log --pretty=format joins lines in the subject of commit message”
  1. Kirill LikhodedovSep 15, 2010
  2. Ævar Arnfjörð BjarmasonSep 15, 2010
  3. Kirill LikhodedovSep 17, 2010
  4. Jeff KingSep 17, 2010
  5. svn2git question: Build directory inserted at top level?nolan.ring@emc.com, Sep 15, 2010
  6. Daniel JohnsonSep 15, 2010
  7. Torgny NyblomSep 15, 2010

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.