jonas/tig — pull request #240 by BenBergman (2014-02-07 05:38:58+00:00)
Title: Rewrite much of the graph code

Fix for jonas/tig#144.

--------------

This patch reimplements much of the logic used to produce the graph in
the main view. A set of git log inputs and expected outputs was created
in tools/test-graph-samples/, and a script to automatically evaluate
these examples was made in tools/unit-test-graph.sh. Please update these
samples if you find a new edge case or if you make changes to the
graphing code.

There are two aspects to the displayed graph which were not included in
this patch as the scope of the changes was deemed too large.

1. Commits that are both merge commits and branch points (or merge
commits and below a commit that is a branch point) can display a bit
ambiguously. The ideal fix for this is creating non-commit lines in the
main view when the graph is displayed. Example input and output can be
found in the samples folder.

2. Line colouring for lines crossing over other lines. Currently, each
pair of symbols (eg. '-|') shares a colour attribute. However, if the
two portions of the symbol are not connected, they should most likely
not share a colour. There are no unit tests implemented for this.

----------------

Let me know if there is anything I can do to improve this pull request. The number of additions is pretty epic, but that is mostly the hashtab library and the sample inputs and expected outputs. The actual changes are fewer than 1000 lines (still large, but nowhere near the full 21000).

I made some changes to the Makefile that could use another set of eyes to make sure I didn't mess something up too badly.