summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 504fbee)
raw | patch | inline | side by side (parent: 504fbee)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 21 Mar 2008 16:53:46 +0000 (17:53 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 21 Mar 2008 17:20:45 +0000 (18:20 +0100) |
TODO | patch | blob | history | |
tig.c | patch | blob | history |
index 464e1226937420918280294de7bec99c6dd040fb..437f0d431d8baf36d60a1c9e279995de0c71024b 100644 (file)
--- a/TODO
+++ b/TODO
- Split sources of tig.c into multiple files.
- - Rewrite revgraph handling to use --parents, which should help to
- cleanup this messy part of the code.
+ - Rewrite revgraph handling.
- Color the revgraph to make it easier to follow branches. Idea by
Dominik Vogt
index 36f03c2a4cd9a2823da14e38bba88d1550a59bed..4a50268b742f08714c10b8bcc6ac083ccfefae6c 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -116,7 +116,7 @@ static size_t utf8_length(const char *string, size_t max_width, int *trimmed, bo
"git log --no-color --cc --stat -n100 %s 2>/dev/null"
#define TIG_MAIN_CMD \
- "git log --no-color --topo-order --boundary --pretty=raw %s 2>/dev/null"
+ "git log --no-color --topo-order --parents --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 --boundary");
+ string_copy(opt_cmd, "git log --no-color --pretty=raw --boundary --parents");
else
string_copy(opt_cmd, "git");
buf_size = strlen(opt_cmd);
struct ref **refs; /* Repository references. */
chtype graph[SIZEOF_REVGRAPH]; /* Ancestry chain graphics. */
size_t graph_size; /* The width of the graph array. */
+ bool has_parents; /* Rewritten --parents seen. */
};
/* Size of rev graph with no "padding" columns */
commit->refs = get_refs(commit->id);
graph->commit = commit;
add_line_data(view, commit, LINE_MAIN_COMMIT);
+
+ while ((line = strchr(line, ' '))) {
+ line++;
+ push_rev_graph(graph->parents, line);
+ commit->has_parents = TRUE;
+ }
return TRUE;
}
switch (type) {
case LINE_PARENT:
+ if (commit->has_parents)
+ break;
push_rev_graph(graph->parents, line + STRING_SIZE("parent "));
break;