Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Ryan Hope | reiser4 for 2.6.27-rc1 |
| David | sdhci: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter - disabling IRQ |
| H. Peter Anvin | Re: Reiser4. BEST FILESYSTEM EVER? I need help. |
| Alan Cox | [PATCH 01/20] tty: Introduce a tty_port common structure |
git: | |
| Johannes Schindelin | Re: git on MacOSX and files with decomposed utf-8 file names |
| Avery Pennarun | Re: Considering teaching plumbing to users harmful |
| Mark Levedahl | Re: [PATCH] Teach remote machinery about remotes.default config variable |
| Junio C Hamano | Re: tracking repository |
| Richard Stallman | Real men don't attack straw men |
| Tony Abernethy | Re: What is our ultimate goal?? |
| Siju George | This is what Linus Torvalds calls openBSD crowd |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Brandon S. Allbery | Re: mkdir says "no space left on device" and more problems... |
| Paul Douglas Page | Where is mkfs? |
| Desmond A. Kirkpatrick | ATI GUP bug with Linux 'tickler' |
