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

Re: [BUG] git log --graph --pretty=format misplaces graph characters when -p given

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 2, 2026, 20:49 UTC
Message-ID
<xmqqo6m6yiov.fsf@gitster.g>
In-Reply-To
<CALnO6CCqwnTcQWSUBPV+o3OO=sMZJjj6jRuMNnBjV3F-dYx+0w@mail.gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 12 quoted lines
> On Mon, Feb 2, 2026 at 11:22 AM <lolligerhans@gmx.de> wrote:
>>
>> Hello,
>>
>> Git can pretty-print a commit graph with git log --graph and a custom --pretty
>> format. I alias some uses of git log --graph --pretty, to which I then want to
>> manually add "-p" upon invocation.
>> ...
> Yep. I think this is because format:%h doesn't add a newline by
> default. With tformat:%h or format:%h%n, the issue goes away. (See
> "git help log" under "tformat:"—this is probably what you want in
> order to get "oneline"-style format.)

FWIW, "git log --pretty=tformat:<whatever>" has a handy short-hand that is "git log --format=<whatever>" ;-)

Previous: D. Ben Knoble
Message 4 of 4 in “[BUG] git log --graph --pretty=format misplaces graph characters when -p given”
  1. lolligerhans@gmx.deFeb 2, 2026
  2. Pushkar SinghFeb 2, 2026
  3. D. Ben KnobleFeb 2, 2026
  4. Junio C HamanoFeb 2, 2026

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.