Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx> --- Documentation/technical/api-history-graph.txt | 2 +- graph.c | 16 ++++++++++++++-- graph.h | 2 +- revision.c | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Documentation/technical/api-history-graph.txt b/Documentation/technical/api-history-graph.txt index ce1c08e..e955979 100644 --- a/Documentation/technical/api-history-graph.txt +++ b/Documentation/technical/api-history-graph.txt @@ -115,7 +115,7 @@ Sample usage ------------ struct commit *commit; -struct git_graph *graph = graph_init(); +struct git_graph *graph = graph_init(opts); while ((commit = get_revision(opts)) != NULL) { graph_update(graph, commit); diff --git a/graph.c b/graph.c index 9d6ed30..85a9ba0 100644 --- a/graph.c +++ b/graph.c @@ -55,6 +55,10 @@ struct git_graph { */ struct commit *commit; /* + * For the --left-right option. + */ + struct rev_info *revs; + /* * The number of parents this commit has. * (Stored so we don't have to walk over them each time we need * this number) @@ -125,10 +129,11 @@ struct git_graph { int *new_mapping; }; -struct git_graph *graph_init(void) +struct git_graph *graph_init(struct rev_info *opt) { struct git_graph *graph = xmalloc(sizeof(struct git_graph)); graph->commit = NULL; + graph->revs = opt; graph->num_parents = 0; graph->expansion_row = 0; graph->state = GRAPH_PADDING; @@ -540,7 +545,14 @@ void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb) if (col_commit == graph->commit) { seen_this = 1; - if (graph->num_parents > 1) + if (graph->revs && graph->revs->left_right) { + if (graph->commit->object.flags + & SYMMETRIC_LEFT) + strbuf_addch(sb, '<'); + else + strbuf_addch(sb, '>'); + } + else if (graph->num_parents > 1) strbuf_addch(sb, 'M'); else strbuf_addch(sb, '*'); diff --git a/graph.h b/graph.h index a7748a5..eab4e3d 100644 --- a/graph.h +++ b/graph.h @@ -8,7 +8,7 @@ struct git_graph; * Create a new struct git_graph. * The graph should be freed with graph_release() when no longer needed. */ -struct git_graph *graph_init(); +struct git_graph *graph_init(struct rev_info *opt); /* * Destroy a struct git_graph and free associated memory. diff --git a/revision.c b/revision.c index 39ceef0..ce0f1ac 100644 --- a/revision.c +++ b/revision.c @@ -1206,7 +1206,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch if (!prefixcmp(arg, "--graph")) { revs->topo_order = 1; revs->rewrite_parents = 1; - revs->graph = graph_init(); + revs->graph = graph_init(revs); continue; } if (!strcmp(arg, "--root")) { -- 1.5.5.1.498.gaaa3c0 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html