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
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Feb 2, 2026, 17:27 UTC
Message-ID
<CALE2CrR5MS=LmXGYW8VbN_trLzMf1tk3BEkh3wv=hju9AWQbeg@mail.gmail.com>
In-Reply-To
<trinity-ed0884d3-098e-44be-aa1a-a96f664ce7ca-1770049279182@trinity-msg-rest-gmx-gmx-live-5dd78c558c-fv4g4>
Hi,
I can reproduce this on Git 2.43.0.
Minimal steps:
    git init
    echo first >test.txt
    git add test.txt
    git commit -m "first"
    echo second >>test.txt
    git add test.txt
    git commit -m "second"
Then:
    git log --graph --pretty='format:%h' -p
I see the same trailing "|" after the commit hash:
    * 0139218|
    | diff --git ...
So the graph character appears on the wrong line, matching your report.
Tested on WSL/Linux.

Thanks, Pushkar

Previous: lolligerhans@gmx.deNext: D. Ben Knoble
Message 2 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.