summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ef1bf1)
raw | patch | inline | side by side (parent: 4ef1bf1)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 6 Feb 2008 10:07:58 +0000 (11:07 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 6 Feb 2008 10:35:03 +0000 (11:35 +0100) |
The boundary commits are marked using a "^" character, which hopefully
is somewhat intuitive and familiar since git revision specification uses
it as its cut-off prefix.
is somewhat intuitive and familiar since git revision specification uses
it as its cut-off prefix.
tig.c | patch | blob | history |
index 446453d09046565011d8fadc16ffdc94bc655787..14f73e62d9dd8db1d0652dfdd58ea7a6152c552e 100644 (file)
--- a/tig.c
+++ b/tig.c
#define REVGRAPH_MERGE 'M'
#define REVGRAPH_BRANCH '+'
#define REVGRAPH_COMMIT '*'
+#define REVGRAPH_BOUND '^'
#define REVGRAPH_LINE '|'
#define SIZEOF_REVGRAPH 19 /* Size of revision ancestry graphics. */
"git log --no-color --cc --stat -n100 %s 2>/dev/null"
#define TIG_MAIN_CMD \
- "git log --no-color --topo-order --pretty=raw %s 2>/dev/null"
+ "git log --no-color --topo-order --boundary --pretty=raw %s 2>/dev/null"
#define TIG_TREE_CMD \
"git ls-tree %s %s"
if (opt_request == REQ_VIEW_MAIN)
/* XXX: This is vulnerable to the user overriding
* options required for the main view parser. */
- string_copy(opt_cmd, "git log --no-color --pretty=raw");
+ string_copy(opt_cmd, "git log --no-color --pretty=raw --boundary");
else
string_copy(opt_cmd, "git");
buf_size = strlen(opt_cmd);
size_t size;
struct commit *commit;
size_t pos;
+ unsigned int boundary:1;
};
/* Parents of the commit being visualized. */
{
chtype symbol;
- if (graph->parents->size == 0)
+ if (graph->boundary)
+ symbol = REVGRAPH_BOUND;
+ else if (graph->parents->size == 0)
symbol = REVGRAPH_INIT;
else if (graph_parent_is_merge(graph))
symbol = REVGRAPH_MERGE;
}
/* Interleave the new revision parent(s). */
- for (i = 0; i < graph->parents->size; i++)
+ for (i = 0; !graph->boundary && i < graph->parents->size; i++)
push_rev_graph(graph->next, graph->parents->rev[i]);
/* Lastly, put any remaining revisions. */
if (!commit)
return FALSE;
- string_copy_rev(commit->id, line + STRING_SIZE("commit "));
+ line += STRING_SIZE("commit ");
+ if (*line == '-') {
+ graph->boundary = 1;
+ line++;
+ }
+
+ string_copy_rev(commit->id, line);
commit->refs = get_refs(commit->id);
graph->commit = commit;
add_line_data(view, commit, LINE_MAIN_COMMIT);