[PATCH] graph API: fix bug in graph_is_interesting()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <simpkins@xxxxxxxxxxxx>
---

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

--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]