Skip to contentSkip to conversation

graph API: display uninteresting commits as '^' instead of '*'

PATCH New Adam Simpkins 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 graph API: display uninteresting commits as '^' instead of '*'

Using --graph and --show-all together now displays UNINTERESTING commits using '^' characters instead of '*'.

Something like the following command will demonstrate the change:

   git log --graph --show-all ^HEAD~2 HEAD
---
 graph.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
graph.c +8 -0
index 6746d42..50b68a4 100644
@@ -775,6 +775,14 @@ static void graph_output_commit_char(struct git_graph *graph, struct strbuf *sb)
 	}
 
 	/*
+	 * For UNINTERESTING commits (displayed with --show-all), print '^'
+	 */
+	if (graph->commit->object.flags & UNINTERESTING) {
+		strbuf_addch(sb, '^');
+		return;
+	}
+
+	/*
 	 * If revs->left_right is set, print '<' for commits that
 	 * come from the left side, and '>' for commits from the right
 	 * side.
Signature · 1 line
1.6.0.4