Thread (1 message) 1 message, 1 author, 2026-02-02

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

From: Junio C Hamano <hidden>
Date: 2026-02-02 20:49:39

"D. Ben Knoble" [off-list ref] writes:
On Mon, Feb 2, 2026 at 11:22 AM [off-list ref] wrote:
quoted
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>" ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help