]> source.dussan.org Git - jgit.git/commit
Improve layout of branches in the commit graph 53/25753/5
authorKonrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Sun, 9 Mar 2014 12:44:41 +0000 (13:44 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 22 May 2014 20:34:22 +0000 (22:34 +0200)
commit7d6dcd4b34fef87d73d7137b2cf66b3e15216a2f
treecbaaf1146f66bb23925c8e1f711630777fdf75a3
parentc4f3856b39958329c2f19341778c9ae6629d668a
Improve layout of branches in the commit graph

The aim of this change is to place all commits of a branch on the same
lane and commits of other (side) branches on different lanes.

The algorithm treats first parents of a commit specially by placing them
on the same lane as the commit itself. When a commit is the first parent
of multiple children it could be placed on any of these children's
lanes. In this case it is placed on the longest child lane, as this is
usually the lane of the branch the commit actually was made on.

Other (non-first) parents are placed on new lanes. This creates a layout
that should make it easier to see branches and merges and follow linear
branch histories.
This differs from the previous approach, which sometimes plotted the
commits of a side branch on the same lane as the base branch commits and
further commits on the base branch appeared on a different lane.
This made the base branch appear as if it was the side branch and
the side branch appears to be the base branch.

In addition to lane assignment, also the plotting code changed to start
drawing a branch lane from the commit where it forks out. Previously it
started only when the first commit on the branch appeared.

Active lanes are continued with every commit that is processed.
Previously lanes were only continued when the next commit on the lane
was encountered. This could produce (temporarily) dangling commits if
the next commit on the lane was not processed yet.

CQ: 8299
Bug: 419359
Bug: 434945
Change-Id: Ibe547aa24b5948ae264f7d0f56a492a4ef335608
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/revplot/PlotCommitListTest.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/AbstractPlotRenderer.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java
org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommitList.java