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

[PATCH 1/2] graph API: fix graph mis-alignment after uninteresting commits

From
Adam Simpkins <adam@adamsimpkins.net>
Date
May 24, 2008, 02:24 UTC
Message-ID
<1211595851-11992-2-git-send-email-adam@adamsimpkins.net>
In-Reply-To
<1211595851-11992-1-git-send-email-adam@adamsimpkins.net>

The graphing code had a bug that caused it to output branch lines incorrectly after ignoring an uninteresting commit. When computing how to match up the branch lines from the current commit to the next one, it forgot to take into account that it needed to initially start with 2 empty spaces where the missing commit would have gone.

So, instead of drawing this,
| * | <- Commit with uninteresting parent
|  /
* |
It used to incorrectly draw this:
| * | <- Commit with uninteresting parent
* |
Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
---
 graph.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/graph.c b/graph.c
index 9d6ed30..400f014 100644
--- a/graph.c
+++ b/graph.c
@@ -190,7 +190,10 @@ static void graph_insert_into_new_columns(struct git_graph *graph,
 	 * Ignore uinteresting and pruned commits
 	 */
 	if (commit->object.flags & (UNINTERESTING | TREESAME))
+	{
+		*mapping_index += 2;
 		return;
+	}
 
 	/*
 	 * If the commit is already in the new_columns list, we don't need to
-- 
1.5.5.1.359.gebc23.dirty
Previous: Adam SimpkinsNext: Adam Simpkins
Message 6 of 15 in “bug in "git log --graph" at the tail end?”
  1. Junio C HamanoMay 23, 2008
  2. Reece DunnMay 23, 2008
  3. Adam SimpkinsMay 24, 2008
  4. Junio C HamanoMay 24, 2008
  5. 0/2 fix "log --graph" issues with uninteresting parentsAdam Simpkins, May 24, 2008
  6. 1/2 graph API: fix graph mis-alignment after uninteresting commitsAdam Simpkins, May 24, 2008
  7. 2/2 graph API: don't print branch lines for uninteresting merge parentsAdam Simpkins, May 24, 2008
  8. Teemu LikonenMay 24, 2008
  9. 0/1 graph API: always print 'M' for merge commitsAdam Simpkins, May 24, 2008
  10. 1/1 graph API: always print 'M' for merge commitsAdam Simpkins, May 24, 2008
  11. Adam SimpkinsMay 24, 2008
  12. Junio C HamanoMay 25, 2008
  13. Teemu LikonenMay 25, 2008
  14. Adam SimpkinsMay 25, 2008
  15. Adam SimpkinsMay 24, 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.