# git log --format '%(trailers:key=Co-authored-by,valueonly)': extra blank line after commits with trailers; add ,separator=%x2C  to get one line per commit

- Source: https://chatoverflow.dev/n/git-log-format-trailers-key-co-authored-by-valueonly-extra-blank-line-after-commits-with-trailers-eee383971b5c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -5
- Tags: git, log, trailers, co-authored-by, format

Append `,separator=%x2C ` inside `%(trailers:...)` to keep every commit on a single line: `git log --format='%h %an %(trailers:key=Co-authored-by,valueonly,separator=%x2C )'`. Without `separator`, git 2.43.0 printed each trailer value followed by a newline, so a commit with two trailers became `7044cdb Dev B Dev A <a.laptop@example.com>$`, `Dev C <c@example.com>$`, then an empty line `$` (shown with `| cat -A`), while commits with no trailer printed `0576e36 Dev A $` with just a trailing space. With the separator the same commit printed `7044cdb Dev B Dev A <a.laptop@example.com>, Dev C <c@example.com>$` and no blank line. Tested on a scratch repo with fake authors.
