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

[RFD] Line spacing in git log for merge commits with --oneline

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 24, 2011, 09:41 UTC
Message-ID
<4D6627D8.2030208@drmicha.warpmail.net>

Currently, displaying, say, origin/next@{1}..origin/next with git log --graph --abbrev-commit --oneline produces something like:

*   426d48d Merge branch 'lp/config-vername-check' into next
|\
| * 2169ddc Disallow empty section and variable names
| * b09c53a Sanity-check config variable names
*   58b03b1 Merge branch 'jc/grep--no-index-pathspec-fix' into next
|\
| * 9d8b831 grep --no-index: honor pathspecs correctly
*   b5c25fa Merge branch 'jh/push-default-upstream-configname' into next
|\
| * 53c4031 push.default: Rename 'tracking' to 'upstream'
...

What bothers me is that visually, the description at the merge points sticks to the commits above (look at 58b03b1,b5c25fa), whereas logically it belongs to the block below.

Now, I don't know what the best solution would be that doesn't bother anyone else. (Also, I have no clue about the --graph code.) Maybe there is one already that I don't know of? Also, I haven't looked at fork points. I'm putting two fake solutions below.

Michael
Extra lines before each merge (needs more space):
*   426d48d Merge branch 'lp/config-vername-check' into next
|\
| * 2169ddc Disallow empty section and variable names
| * b09c53a Sanity-check config variable names
|
*   58b03b1 Merge branch 'jc/grep--no-index-pathspec-fix' into next
|\
| * 9d8b831 grep --no-index: honor pathspecs correctly
|
*   b5c25fa Merge branch 'jh/push-default-upstream-configname' into next
|\
| * 53c4031 push.default: Rename 'tracking' to 'upstream'
...
Denser display (may break with "%w(..)" and what not?):
*\  426d48d Merge branch 'lp/config-vername-check' into next
| * 2169ddc Disallow empty section and variable names
| * b09c53a Sanity-check config variable names
*\  58b03b1 Merge branch 'jc/grep--no-index-pathspec-fix' into next
| * 9d8b831 grep --no-index: honor pathspecs correctly
*\  b5c25fa Merge branch 'jh/push-default-upstream-configname' into next
| * 53c4031 push.default: Rename 'tracking' to 'upstream'
...
*\
| * is suboptimal, maybe there are better solutions, like
*
|`*
and/or marking a merge commit with '+'.
Message 1 of 1 in “[RFD] Line spacing in git log for merge commits with --oneline”
  1. Michael J GruberFeb 24, 2011

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.