cblp / gt

A git-based version control system
https://github.com/cblp/gt#readme
GNU General Public License v2.0
3 stars 0 forks source link

Visualize commit graph with straight branches #2

Open cblp opened 10 years ago

cblp commented 10 years ago

When merging two branches, the branch of the first parent must be drawn vertically. When not in a merge, all branches must be drawn vertically if possible.

Now (ugly crossing!)

* 5555555 (HEAD, abranch)
| *   4444444 (master) Merge branch 'abranch'
| |\
| |/
|/|
* | 3333333
| * 2222222
|/
* 1111111

But should be

  *  5555555  (HEAD, abranch)
* |  4444444  (master) Merge branch 'abranch'
| *  3333333
|/
*  2222222
*  1111111

One branch leaps over other in git (curvy):

*   6666666 (HEAD, master) Merge branch 'abranch1'
|\
| * 5555555 (abranch1)
* |   4444444 Merge branch 'abranch2'
|\ \
| * | 3333333 (abranch2)
|/ /
* | 2222222
|/
* 1111111

Less dog-legs. It looks better and is easier to trace.

*  6666666  (HEAD, master) Merge branch 'abranch1'
|\
| \
*  \  4444444  Merge branch 'abranch2'
|\  *  5555555  (abranch1)
| * |  3333333  (abranch2)
|/ /
* /  2222222
|/
*  1111111

Subtasks: