On Friday, July 31, 2009 4:11am, "Santi Béjar" [off-list ref] said:
Hello,
I've found that in some cases the --graph and
--simplify-by-decoration don't work well together. If you do this in
the git.git repository:
Thanks for reporting the problem, I apologize for taking so long to
investigate and respond.
* | | f29ac4f (tag: v1.6.3-rc2) GIT 1.6.3-rc2
/ /
| | * 66996ec Sync with 1.6.2.4
you can see that f29ac4f looks like it does not have any parents while
the correct parent is 66996ec which seems to have no children. But if
you omit the --oneline you can see that there are a lot of "root"-like
commits (f01f109, a48f5d7, f29ac4f,...).
Yes, there's a bug in graph_is_interesting(). When processing
f29ac4f, the graph code thinks that 66996ec isn't interesting and
won't get displayed in the output, so it doesn't prepare the graph
lines to show lines to 66996ec.
I'll submit a patch shortly.
--
Adam Simpkins
adam@adamsimpkins.net
Updated graph_is_interesting() to use simplify_commit() to determine if
a commit is interesting, just like get_revision() does. Previously, it
would sometimes incorrectly treat an interesting commit as
uninteresting. This resulted in incorrect lines in the graph output.
This problem was reported by Santi Béjar. The following command
would exhibit the problem before, but now works correctly:
git log --graph --simplify-by-decoration --oneline v1.6.3.3
Previously git graph did not display the output for this command
correctly between f29ac4f and 66996ec, among other places.
Signed-off-by: Adam Simpkins <redacted>
---
Note that simplify_commit() may modify the revision list. Calling it
in graph_is_interesting() can modify the revision list earlier than it
otherwise would be (in get_revision()). I don't think this should
cause any problems, but figured I'd point it out in case anyone more
familiar with the code thinks otherwise.
graph.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/graph.c b/graph.c
index e466770..ea21e91 100644
--- a/graph.c
+++ b/graph.c
@@ -286,9 +286,10 @@ static int graph_is_interesting(struct git_graph *graph, struct commit *commit)
}
/*
- * Uninteresting and pruned commits won't be printed
+ * Otherwise, use simplify_commit() to see if this commit is
+ * interesting
*/
- return (commit->object.flags & (UNINTERESTING | TREESAME)) ? 0 : 1;
+ return simplify_commit(graph->revs, commit) == commit_show;
}
static struct commit_list *next_interesting_parent(struct git_graph *graph,
--
1.6.4.314.ge5db