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

[PATCH 0/2] graph API: improve printing of merges

From
Adam Simpkins <adam@adamsimpkins.net>
Date
Jun 1, 2008, 20:56 UTC
Message-ID
<1212353818-7031-1-git-send-email-adam@adamsimpkins.net>
In-Reply-To
<20080529085752.GA31865@adamsimpkins.net>

This is two minor patches to improve the display of merge commits in the graph output. The first fixes the "extra space" that appears sometimes, as pointed out by Teemu Likonen. I had previously posted 2 simple options for fixing the problem, but neither one was best in all cases. This patch is an improved version that dynamically chooses how the merge commit should be displayed, based on the last line of the previous commit's output.

For example, with the new changes, the code now prints:
$ git log --graph --pretty=format:%h -10 8d6afc1
M   8d6afc1
|\  
| M   f2fea68
| |\  
| M \   21dbe12
| |\ \  
M | \ \   41094b8
|\ \ \ \  
| M \ \ \   061ad5f
| |\ \ \ \  
| M \ \ \ \   fe041ad
| |\ \ \ \ \  
| | \ \ \ \ \     
| |  \ \ \ \ \    
| M-. \ \ \ \ \   cd1333d
| |\ \ \ \ \ \ \  
| | * | | | | | | cfcbd34
| | * | | | | | | 5398fed
| M | | | | | | |   539d84f
| |\ \ \ \ \ \ \ \  

The second patch improves the output for octopus merges, by avoiding printing unnecessary padding lines before the commit when there aren't any existing branch lines to the right of the merge.

Adam Simpkins (2):
  graph API: improve display of merge commits
  graph API: avoid printing unnecessary padding before some octopus
    merges
 graph.c |  123 +++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 101 insertions(+), 22 deletions(-)
Previous: Teemu LikonenNext: Adam Simpkins
Message 7 of 12 in “log --graph: extra space with --pretty=oneline”
  1. Teemu LikonenMay 28, 2008
  2. Wincent ColaiutaMay 28, 2008
  3. Adam SimpkinsMay 29, 2008
  4. graph API: improve output for merge commits (option 1)Adam Simpkins, May 29, 2008
  5. graph API: improve output for merge commits (option 2)Adam Simpkins, May 29, 2008
  6. Teemu LikonenMay 29, 2008
  7. 0/2 graph API: improve printing of mergesAdam Simpkins, Jun 1, 2008
  8. 1/2 graph API: improve display of merge commitsAdam Simpkins, Jun 1, 2008
  9. 2/2 graph API: avoid printing unnecessary padding before some octopus mergesAdam Simpkins, Jun 1, 2008
  10. Junio C HamanoJun 1, 2008
  11. Adam SimpkinsJun 2, 2008
  12. Junio C HamanoJun 2, 2008

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.