threads / discuss / 26590

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

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

## tl;dr

One message between Feb 24, 2011 and Feb 24, 2011.

replies: 0people: 1as markdown or json

Michael J Gruber· Feb 24, 2011, 09:41 UTC · lore

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 '+'.

← back to recent threads